Giter Club home page Giter Club logo

pt-gen-cfworker's Introduction

PT-Gen on Cloudflare Worker

FOSSA Status Build Status

基于 BFDZ/Pt-Gen v0.4.7 改写, 使之可以直接在Cloudflare Worker上使用。

如果你没有构造环境,请直接复制使用 build分支 下的 script.js 文件。

否则请参照 .Travis.yml 文件构造方法,直接使用wrangler搭建Cloudflare-Worker。

本项目请求方法

API Point:

资源搜索 请求字段:

  • search: 搜索字符串
  • source: 见下表 资源来源站点,不填时默认为 douban

简介生成 请求字段(方法1,推荐):

  • url:见下表 链接格式(Regexp)

简介生成 请求字段(方法2):

  • site: 见下表 资源来源站点
  • sid: 资源在对应站点的唯一id

支持资源链接

资源来源站点 搜索支持 链接格式(Regexp)
douban /(?:https?:\/\/)?(?:(?:movie|www)\.)?douban\.com\/(?:subject|movie)\/(\d+)\/?/
imdb /(?:https?:\/\/)?(?:www\.)?imdb\.com\/title\/(tt\d+)\/?/
bangumi /(?:https?:\/\/)?(?:bgm\.tv|bangumi\.tv|chii\.in)\/subject\/(\d+)\/?/
steam × /(?:https?:\/\/)?(?:store\.)?steam(?:powered|community)\.com\/app\/(\d+)\/?/
indienova × /(?:https?:\/\/)?indienova\.com\/game\/(\S+)/
epic × /(?:https?:\/\/)?www\.epicgames\.com\/store\/[a-zA-Z-]+\/product\/(\S+)\/\S?/

update 2020.11.23 : 由于 steam 服务器对于 cf-worker 访问进行限制 ( 见#10 ), 目前服务的 steam 相关资源生成均无法使用。

环境变量及 KV 命名空间

通过设置环境变量可以使得 pt-gen-cfworker 能够实现一些额外的功能,当前有以下 环境变量:

变量 说明
AUTHOR 用于重写api返回的作者信息
APIKEY 只允许带有 &apikey={APIKEY} 的请求访问资源
DISABLE_SEARCH 存在该值且非空时,禁止使用搜索功能
PT_GEN_STORE KV Storage,请在 KV 命名空间绑定 面板而不是环境变量面板设置!!!
DOUBAN_COOKIE 豆瓣Cookie,使得能访问部分登录可见的资源
INDIENOVA_COOKIE indienova 的 Cookie,见 #15

License

FOSSA Status

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.