{"id":15408942,"url":"https://github.com/sec-ant/masginfogencfw","last_synced_at":"2026-01-26T04:30:20.291Z","repository":{"id":136827447,"uuid":"289932078","full_name":"Sec-ant/MASGInfoGenCFW","owner":"Sec-ant","description":"MASGInfoGen Cloudflare Workers Implementation: https://info.secant.workers.dev","archived":false,"fork":false,"pushed_at":"2020-08-29T12:13:56.000Z","size":127,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-30T07:28:08.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sec-ant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-08-24T13:12:45.000Z","updated_at":"2022-06-01T09:03:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"9e3b98d4-d13a-442d-9f35-1c0c0fa4bb91","html_url":"https://github.com/Sec-ant/MASGInfoGenCFW","commit_stats":{"total_commits":34,"total_committers":1,"mean_commits":34.0,"dds":0.0,"last_synced_commit":"ce1b349561c39e836d574b62bf0beee53b251b8e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sec-ant%2FMASGInfoGenCFW","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sec-ant%2FMASGInfoGenCFW/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sec-ant%2FMASGInfoGenCFW/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sec-ant%2FMASGInfoGenCFW/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sec-ant","download_url":"https://codeload.github.com/Sec-ant/MASGInfoGenCFW/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239768930,"owners_count":19693764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-01T16:36:03.619Z","updated_at":"2026-01-26T04:30:20.252Z","avatar_url":"https://github.com/Sec-ant.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MASGInfoGenCFW\r\n\r\n部署在 [Cloudflare Workers](https://workers.cloudflare.com/) 上的 MASGInfoGen API，仍然在缓慢开发中……\r\n\r\n**MASG**: **M**ovie/**M**usic | **A**nime | **S**eries | **G**ame\r\n\r\n## 开发环境准备\r\n\r\n1. 注册 [Cloudflare 账户](https://dash.cloudflare.com/sign-up/workers)\r\n2. 安装 [Node.js](https://nodejs.org/en/)\r\n3. 安装用于打包 Cloudflare Workers 后端 js 代码并部署所需的 CLI 工具 [Wrangler](https://developers.cloudflare.com/workers/cli-wrangler/install-update)\r\n4. 克隆本仓库到本地：`git clone git@github.com:Sec-ant/MASGInfoGenCFW.git`\r\n5. 在项目文件夹下运行 `npm install` 安装依赖，依赖包括：\r\n   - [Babel](https://github.com/babel/babel): 用于支持 Javascript [Class 相关实验性功能](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Classes/Class_elements)\r\n      - [Babel Loader](https://github.com/babel/babel-loader)\r\n      - [babel-preset-minify](https://babeljs.io/docs/en/babel-preset-minify)\r\n      - [@babel/plugin-proposal-class-properties](https://babeljs.io/docs/en/babel-plugin-proposal-class-properties)\r\n      - [@babel/plugin-proposal-private-methods](https://babeljs.io/docs/en/babel-plugin-proposal-private-methods)\r\n   - [he](https://github.com/mathiasbynens/he): 用于对 [HTML Entities](https://html.spec.whatwg.org/multipage/named-characters.html#named-character-references) 进行解码\r\n6. 复制一份项目文件夹下的 `wrangler.toml.sample`，重命名为 `wrangler.toml`，将文件中的 `account_id` 改为你的 Cloudflare 账户 ID（通过[这个页面](https://dash.cloudflare.com/)登录进入 Workers 管理页面后，页面右侧会显示）\r\n7. 按照[说明文档](https://developers.cloudflare.com/workers/cli-wrangler/authentication)对 Wrangler 进行授权，以便于构建后直接部署到 Cloudflare 上\r\n\r\n## 开发\r\n\r\n1. API 业务逻辑开发请修改根目录的 `index.js` 文件\r\n2. 站点页面解析自定义类都在 `libs` 文件夹\r\n3. 通过 Wrangler 构建、预览和部署\r\n   ```\r\n   wrangler build\r\n   wrangler preview\r\n   wrangler publish\r\n   ```\r\n\r\n## 特点\r\n\r\n本项目采用 Cloudflare Workers 的原生 API [HTMLRewriter](https://developers.cloudflare.com/workers/runtime-apis/html-rewriter) 进行页面解析，这是一种流式 HTML 解析器，优点是不需要自己写正则表达式进行解析，且避免了引入第三方包导致脚本体积和 CPU 运算耗时增加的情况，缺点是流式解析和 jQuery, cheerio 等 API 有明显的区别，目前网络上 HTMLRewriter 相关文档很少，需要自己尝试，且迁移工作量较大。\r\n\r\n## 后面需要解决的问题\r\n\r\nrequest 和 subrequest 的缓存机制。\r\n\r\n## Demo\r\n\r\nhttps://info.secant.workers.dev/douban?id=26635374\r\n\r\n## 注意！！\r\n\r\n项目仍然在开发中，在本句话更新之前，恕不保证 API 的一致性和稳定性。\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsec-ant%2Fmasginfogencfw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsec-ant%2Fmasginfogencfw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsec-ant%2Fmasginfogencfw/lists"}