GithubHelp home page GithubHelp logo

rhilip / pt-gen-cfworker Goto Github PK

View Code? Open in Web Editor NEW
241.0 4.0 99.0 377 KB

Automatically generate description based on resource links from douban,imdb,et al.

Home Page: https://ptgen.rhilip.info/

License: MIT License

JavaScript 58.09% HTML 41.91%
pt-gen cloudflare-worker

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

pt-gen-cfworker's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar fossabot avatar mayli avatar rhilip avatar skymkmk avatar tongyifan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pt-gen-cfworker's Issues

希望增加豆瓣cookie获取

复现步骤

  1. 请指出是哪个域名能够复现该问题?
  1. 如果是非官方域名出现的问题,在上面的官方API Point中能否复现?(使用官方域名请跳过)
  1. 错误链接?
    https://ptgen.rhilip.info/?url=https://movie.douban.com/subject/4848114/

其他信息

是否能增加豆瓣cookie,来获取一些只能登录才能看到的页面的信息
例如缘之空,https://movie.douban.com/subject/4848114/

用python 获取豆瓣简介失败

复现步骤

  1. 请指出是哪个域名能够复现该问题?
  1. 错误描述:
    利用python requests模块抓取某个豆瓣链接对应的简介时,返回数据一直报错,报错信息见其他信息,程序中已经添加浏览器中看到的所有Header,包括 headers, authority, x-requested-with等,但仍然返回失败。
    不太理解,提示的“Miss key of site or sid”是什么意思,是不是与cloudflare有关系,还望答疑解惑,非常感谢!

  2. 错误链接?

https://movie.douban.com/subject/24733428/

其他信息

{
"success": false,
"error": "Miss key of site or sid , or input unsupported resource url.",
"format": "",
"copyright": "Powered by @Rhilip",
"version": "0.6.1",
"generate_at": 1609575424075
}

无法获取豆瓣电影的简介

复现步骤

  1. 请指出是哪个域名能够复现该问题?
  1. 如果是非官方域名出现的问题,在上面的官方API Point中能否复现?(使用官方域名请跳过)
  1. 错误链接?

https://movie.douban.com/subject/30211551/

其他信息

自建的cf上也无法获取。

◎简  介

  暂无相关剧情介绍

希望能增加bgm的cookie变量,以便获取登入可见词条的简介

复现步骤

  1. 请指出是哪个域名能够复现该问题?
  1. 如果是非官方域名出现的问题,在上面的官方API Point中能否复现?(使用官方域名请跳过)
  1. 错误链接?

https://bgm.tv/subject/7783
https://bgm.tv/subject/53803

其他信息

如果是需要登入才能观看的词条均不能获取到介绍,希望能增加bgm的cookie变量,以便获取登入可见词条的简介

直接复制 `script.js` 文件无法使用

最近pt-gen用不了了,想自建,貌似可以使用cloudflare.com搭建,只不过缺少小白教程,可否指教一下,目前已经复制build分支下的 script.js文件。到cloudflare脚本窗口下,运行但是搜索不出信息,不知道还有哪部没有做,可否教下呢
微信截图_20210816112523

Exception: Cannot read properties of null (reading 'replace')

复现步骤

  1. 请指出是哪个域名能够复现该问题?
  1. 如果是非官方域名出现的问题,在上面的官方API Point中能否复现?(使用官方域名请跳过)
  1. 错误链接?

其他信息

Internal Error, Please contact @Rhilip. Exception: Cannot read properties of null (reading 'replace')

Steam游戏信息获取失败

复现步骤

  1. 请指出是哪个域名能够复现该问题?
  1. 如果是非官方域名出现的问题,在上面的官方API Point中能否复现?(使用官方域名请跳过)
  1. 错误链接?
    https://store.steampowered.com/app/1062160

其他信息

{
"success": false,
"error": "Internal Error, Please contact @Rhilip. Exception: Cannot read property 'replace' of undefined",
"format": "",
"copyright": "Powered by @Rhilip",
"version": "0.6.1",
"generate_at": 1606125910585
}

豆瓣海报链接不可用

pt-gen-cfworker 生成的豆瓣海报链接被豆瓣设置了防盗链,pt-gen生成的链接是可用的。

[img]https://img1.doubanio.com/view/photo/l/public/p2546360443.jpg[/img]
[img]https://img1.doubanio.com/view/photo/l_ratio_poster/public/p2546360443.jpg[/img]

lwO3WQ.jpg
lwOlFS.jpg

无法获取豆瓣下的影视信息

复现步骤

直接请求https://ptgen.rhilip.info/?url=https://movie.douban.com/subject/24733428
或者进入ptgen输入豆瓣链接后请求都得到报错

  1. 请指出是哪个域名能够复现该问题?
  1. 如果是非官方域名出现的问题,在上面的官方API Point中能否复现?(使用官方域名请跳过)
  1. 错误链接?

https://ptgen.rhilip.info/?url=https://movie.douban.com/subject/24733428

其他信息

{
"success": false,
"error": "Internal Error, Please contact @Rhilip. Exception: Cannot read property 'replace' of null",
"format": "",
"copyright": "Powered by @Rhilip",
"version": "0.6.1",
"generate_at": 1609582015995
}

IMDB 简介的分数和人数写反了

复现步骤

  1. 请指出是哪个域名能够复现该问题?
  1. 如果是非官方域名出现的问题,在上面的官方API Point中能否复现?(使用官方域名请跳过)
  1. 错误链接?

填入任意一个imdb的影片链接,查询结果的分数和人数写反了。

其他信息

Need help api point please

Hello,

I'm sorry but I don't understand how to build my own api point.
Can you help me or explain me how it works please ?

Thank you.

增加多cookie

复现步骤

  1. 请指出是哪个域名能够复现该问题?
  1. 如果是非官方域名出现的问题,在上面的官方API Point中能否复现?(使用官方域名请跳过)
  1. 错误链接?

其他信息

发种时频繁使用,豆瓣会弹出检测界面,能否增加多个cookie变量,一个频繁了,更换另一个,当然,不清楚豆瓣是如何检测的,如果和cookie无关的话,那这样也没用了。

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.