{"id":13569566,"url":"https://github.com/Rhilip/pt-gen-cfworker","last_synced_at":"2025-04-04T05:33:07.741Z","repository":{"id":37847514,"uuid":"193865290","full_name":"Rhilip/pt-gen-cfworker","owner":"Rhilip","description":"Automatically generate description based on resource links from douban,imdb,et al.","archived":false,"fork":false,"pushed_at":"2024-11-17T14:08:53.000Z","size":380,"stargazers_count":263,"open_issues_count":5,"forks_count":108,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T12:52:38.856Z","etag":null,"topics":["cloudflare-worker","pt-gen"],"latest_commit_sha":null,"homepage":"https://ptgen.rhilip.info/","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/Rhilip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-06-26T08:42:01.000Z","updated_at":"2025-03-23T02:42:55.000Z","dependencies_parsed_at":"2024-03-17T03:21:43.011Z","dependency_job_id":null,"html_url":"https://github.com/Rhilip/pt-gen-cfworker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rhilip%2Fpt-gen-cfworker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rhilip%2Fpt-gen-cfworker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rhilip%2Fpt-gen-cfworker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rhilip%2Fpt-gen-cfworker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rhilip","download_url":"https://codeload.github.com/Rhilip/pt-gen-cfworker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128702,"owners_count":20888232,"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":["cloudflare-worker","pt-gen"],"created_at":"2024-08-01T14:00:41.452Z","updated_at":"2025-04-04T05:33:07.732Z","avatar_url":"https://github.com/Rhilip.png","language":"JavaScript","funding_links":[],"categories":["Upload"],"sub_categories":["Upload Assistant"],"readme":"# PT-Gen on Cloudflare Worker\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FRhilip%2Fpt-gen-cfworker.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FRhilip%2Fpt-gen-cfworker?ref=badge_shield)\n[![Build Status](https://github.com/Rhilip/pt-gen-cfworker/actions/workflows/build.yml/badge.svg)](https://github.com/Rhilip/pt-gen-cfworker/actions/workflows/build.yml)\n\n基于 [BFDZ/Pt-Gen v0.4.7](https://github.com/BFDZ/PT-Gen/commit/950b85de16d9532e847a0756f165d1b29f09dd31) 改写，\n使之可以直接在Cloudflare Worker上使用。\n\n如果你没有构造环境，请直接复制使用 [build分支](https://github.com/Rhilip/pt-gen-cfworker/tree/build) 下的\n[script.js](https://github.com/Rhilip/pt-gen-cfworker/blob/build/script.js) 文件。\n\n否则请参照 `.Travis.yml` 文件构造方法，直接使用`wrangler`搭建Cloudflare-Worker。\n\n## 本项目请求方法\n\nAPI Point：\n - https://ptgen.rhilip.info/\n - **！！！大批量请求时，请勿使用测试DEMO站点，请自己搭建cf-worker！！！**\n\n`资源搜索` 请求字段：\n  - search: 搜索字符串\n  - source: 见下表 `资源来源站点`，不填时默认为 `douban`\n\n`简介生成` 请求字段（方法1，推荐）：\n  - url：见下表 `链接格式（Regexp）`\n\n`简介生成` 请求字段（方法2）：\n  - site: 见下表 `资源来源站点`\n  - sid: 资源在对应站点的唯一id\n\n## 支持资源链接\n\n| 资源来源站点 | 搜索支持 | 链接格式（Regexp） |\n| :---: | :---: | :------|\n| douban | √ | `/(?:https?:\\/\\/)?(?:(?:movie\\|www)\\.)?douban\\.com\\/(?:subject\\|movie)\\/(\\d+)\\/?/` |\n| imdb | √ | `/(?:https?:\\/\\/)?(?:www\\.)?imdb\\.com\\/title\\/(tt\\d+)\\/?/` |\n| bangumi | √ | `/(?:https?:\\/\\/)?(?:bgm\\.tv\\|bangumi\\.tv\\|chii\\.in)\\/subject\\/(\\d+)\\/?/` |\n| steam | × | `/(?:https?:\\/\\/)?(?:store\\.)?steam(?:powered\\|community)\\.com\\/app\\/(\\d+)\\/?/` |\n| indienova | × | `/(?:https?:\\/\\/)?indienova\\.com\\/game\\/(\\S+)/` | \n| epic | × | `/(?:https?:\\/\\/)?www\\.epicgames\\.com\\/store\\/[a-zA-Z-]+\\/product\\/(\\S+)\\/\\S?/` |\n\n\u003e update 2020.11.23 : 由于 steam 服务器对于 cf-worker 访问进行限制 （ 见[#10](https://github.com/Rhilip/pt-gen-cfworker/issues/10) ）， 目前服务的 steam 相关资源生成均无法使用。\n\n## 环境变量及 KV 命名空间\n\n通过设置环境变量可以使得 pt-gen-cfworker 能够实现一些额外的功能，当前有以下 环境变量：\n\n| 变量 | 说明 |\n|:---:|:--|\n| `AUTHOR` | 用于重写api返回的作者信息 |\n| `APIKEY` | 只允许带有 `\u0026apikey={APIKEY}` 的请求访问资源 |\n| `DISABLE_SEARCH` | 存在该值且非空时，禁止使用搜索功能 |\n| `PT_GEN_STORE` | *KV Storage*，请在 `KV 命名空间绑定` 面板而不是环境变量面板设置！！！ |\n| `DOUBAN_COOKIE` | 豆瓣Cookie，使得能访问部分登录可见的资源 |\n| `INDIENOVA_COOKIE` | indienova 的 Cookie，见 [#15](https://github.com/Rhilip/pt-gen-cfworker/issues/15) |\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FRhilip%2Fpt-gen-cfworker.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FRhilip%2Fpt-gen-cfworker?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRhilip%2Fpt-gen-cfworker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRhilip%2Fpt-gen-cfworker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRhilip%2Fpt-gen-cfworker/lists"}