{"id":48577857,"url":"https://github.com/why15w/lanzou","last_synced_at":"2026-04-08T16:03:42.777Z","repository":{"id":348642016,"uuid":"1122700077","full_name":"WhY15w/lanzou","owner":"WhY15w","description":"一个基于 Express 的蓝奏云直链解析服务。","archived":false,"fork":false,"pushed_at":"2026-04-02T04:43:07.000Z","size":136,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-02T17:37:38.710Z","etag":null,"topics":["express","lanzoucloud","parser","url"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WhY15w.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-25T10:10:27.000Z","updated_at":"2026-04-02T05:28:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/WhY15w/lanzou","commit_stats":null,"previous_names":["why15w/lanzou"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/WhY15w/lanzou","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhY15w%2Flanzou","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhY15w%2Flanzou/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhY15w%2Flanzou/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhY15w%2Flanzou/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WhY15w","download_url":"https://codeload.github.com/WhY15w/lanzou/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhY15w%2Flanzou/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31562697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","lanzoucloud","parser","url"],"created_at":"2026-04-08T16:03:42.523Z","updated_at":"2026-04-08T16:03:42.767Z","avatar_url":"https://github.com/WhY15w.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lanzou URL Parser\n\n一个基于 Express 的蓝奏云链接解析服务。\n\n## 📋 项目简介\n\n本项目提供了一个 API 服务，用于解析和获取蓝奏云（Lanzou）分享链接中的文件信息，包括文件名、大小、下载链接等。\n\n## ✨ 主要功能\n\n- **链接解析**：解析蓝奏云分享链接并获取文件信息\n- **密码支持**：支持有密码的蓝奏云链接\n- **重定向/JSON**：支持直接重定向到下载链接或返回 JSON 响应\n- **速率限制**：内置速率限制（15分钟内最多300个请求）\n- **跨域支持**：支持 CORS 跨域请求\n- **请求日志**：使用 Morgan 记录所有 HTTP 请求\n\n## 🚀 快速开始\n\n### 前置要求\n\n- Node.js 16+\n- pnpm 10.33.0+\n\n### 安装依赖\n\n```bash\npnpm install\n```\n\n### 开发模式\n\n```bash\npnpm run dev\n```\n\n服务会在 `http://localhost:1103` 启动。\n\n### 构建项目\n\n```bash\npnpm run build\n```\n\n### 生产模式\n\n```bash\npnpm start\n```\n\n## 📚 API 文档\n\n### 获取文件信息\n\n**端点：** `GET /lanzou/`\n\n**查询参数：**\n\n| 参数   | 类型   | 必需 | 说明                                          |\n| ------ | ------ | ---- | --------------------------------------------- |\n| `url`  | string | ✓    | 蓝奏云分享链接                                |\n| `pwd`  | string | ✗    | 分享密码（如果链接有密码）                    |\n| `type` | string | ✗    | 响应类型：`json` 或 `redirect`，默认为 `json` |\n\n**示例请求：**\n\n```bash\n# 获取文件信息（JSON 格式）\ncurl \"http://localhost:1103/lanzou/?url=https://lanzou.com/xxx\"\n\n# 带密码的请求\ncurl \"http://localhost:1103/lanzou/?url=https://lanzou.com/xxx\u0026pwd=1234\"\n\n# 重定向到下载链接\ncurl \"http://localhost:1103/lanzou/?url=https://lanzou.com/xxx\u0026type=redirect\"\n```\n\n**响应示例：**\n\n```json\n{\n  \"code\": 0,\n  \"message\": \"success\",\n  \"data\": {\n    \"filename\": \"example.zip\",\n    \"filesize\": \"1.2MB\",\n    \"downloads\": 100,\n    \"redirect\": \"https://...\"\n  }\n}\n```\n\n**错误响应：**\n\n```json\n{\n  \"code\": 1,\n  \"message\": \"error message\"\n}\n```\n\n## ⚙️ 配置说明\n\n默认配置位于 [config/config.ts](config/config.ts)：\n\n- **PORT**：服务监听端口（默认：1103）\n- **rateLimit**：速率限制配置\n  - `windowMs`：时间窗口（15分钟）\n  - `max`：时间窗口内最大请求数（300）\n\n## 📁 项目结构\n\n```\n├── app.ts                              # 主应用文件\n├── config/\n│   └── config.ts                      # 配置文件\n├── routes/\n│   └── lanzou.ts                      # 蓝奏云 API 路由\n├── utils/\n│   ├── types.ts                       # 类型定义\n│   ├── lanzou/\n│   │   ├── anti_acw_sc__v2.ts        # 反爬虫处理\n│   │   ├── lanzouHttpClient.ts       # HTTP 客户端\n│   │   └── lanzouParser.ts           # URL 解析器\n│   └── reply/\n│       └── reply.ts                  # 响应格式化\n├── package.json\n├── tsconfig.json\n└── README.md\n```\n\n## 🛠️ 使用的技术栈\n\n- **框架**：Express.js\n- **语言**：TypeScript\n- **HTTP 客户端**：Axios\n- **日志**：Morgan\n- **跨域**：CORS\n- **速率限制**：express-rate-limit\n- **HTML 解析**：jsdom\n- **时间处理**：dayjs\n\n## 📝 脚本命令\n\n| 命令         | 说明                            |\n| ------------ | ------------------------------- |\n| `pnpm dev`   | 使用 tsx 开发模式运行           |\n| `pnpm build` | 将 TypeScript 编译为 JavaScript |\n| `pnpm start` | 编译并运行生产版本              |\n\n## ⚠️ 注意事项\n\n- 请遵守蓝奏云的使用条款和协议\n- 合理使用 API，避免对服务器造成压力\n- 若遇到频繁被限制，可根据需要调整速率限制配置\n- 某些蓝奏云链接可能需要特殊的 User-Agent 或其他请求头\n\n## 📄 许可证\n\nISC\n\n## 🤝 贡献\n\n欢迎提交 Issue 和 Pull Request！\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhy15w%2Flanzou","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhy15w%2Flanzou","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhy15w%2Flanzou/lists"}