弹弹play 资源搜索节点 API 实现,基于 Cloudflare Workers 或 Golang 的两种实现。 || API implementations for "dandanplay" resource search service.

Overview

dandanplay-resource-service

GitHub release GitHub All Releases

API implementations for "dandanplay" resource search service.
弹弹play 资源搜索节点的 API 实现。

提供基于 Cloudflare WorkersGolang 的两种实现。

Cloudflare Workers

注册一个 Cloudflare 免费账户即可部署,无需 远程服务器 或 常驻任何本地程序

部署

复制 worker.js 内容到 workers.dev 脚本编辑页面 中,部署即可。

  • 可在搜索引擎中搜索 "Cloudflare Workers部署教程" ,参照进行。
  • 由于暂未实现 缓存机制 ,且 Cloudflare Workers 免费版账户有每日 100,000 的请求次数限制,目前暂不提供演示站点。可以自行部署体验。

开发

若需修改源码,可以依照以下步骤自行生成 worker.js :

  1. 安装 wrangler

    若为 Windows 系统,建议选择 二进制文件安装

  2. 修改源码并重新构建:

    $ git clone https://github.com/LussacZheng/dandanplay-resource-service.git
    $ cd dandanplay-resource-service/cf-worker
    
    # 按需修改源码
    
    $ wrangler build
    # or
    $ npm run build
  3. 输出文件位于 cf-worker/dist/worker.js

Golang

部署

Releases 页面 下载预编译的可执行文件到 本地 或 服务器 ,运行即可。

或直接部署到 Heroku :
Deploy to Heroku

运行

$ dandanplay-resource-service -h
API implementations for "dandanplay" resource search service, in Golang.

Usage:
  dandanplay-resource-service [flags]

Flags:
  -h, --help           help for dandanplay-resource-service
  -H, --host string    IP address the API listens on, such as "0.0.0.0", "127.0.0.1", or "192.168.0.100" (default "localhost")
  -P, --port string    Listen port of the API (default "8080")
  -x, --proxy string   Proxy address for web scraper, "http" and "socks5" are supported
  -V, --version        Print the version number of dandanplay-resource-service

例如:

# 无参数,默认运行在 localhost:8080
$ dandanplay-resource-service

# 自定义端口 和 代理地址(可省略 "http://")
$ dandanplay-resource-service -P 9000 -x 127.0.0.1:10809

# 运行在 34543 端口并暴露服务到公网
$ dandanplay-resource-service -H 0.0.0.0 -P 34543

访问根路径可以看到简易的测试页面。

开发

若需修改源码或自行编译,则需要 Go 语言 开发环境。

$ git clone https://github.com/LussacZheng/dandanplay-resource-service.git
$ cd dandanplay-resource-service/golang

# go env -w GO111MODULE=on
# go env -w GOPROXY=https://goproxy.cn,direct

# 直接编译
$ go build

# 优化可执行文件大小
$ go build -ldflags="-s -w"
$ upx --lzma --best dandanplay-resource-service*

相关项目

Python

个人推荐使用 poetry 进行依赖管理。
$ cd python

# 安装依赖
$ poetry install
#
$ poetry install --no-dev

# 运行脚本,如
$ poetry run python dandanplay-resource-service.py proxy=http://127.0.0.1:10809
#
$ poetry run python dandanplay-resource-service.py host=0.0.0.0 port=34543 proxy=""

# 打包
$ poetry run poe build

PHP

参考资料

  1. API Specification - 弹弹play资源搜索节点API规范
  2. 关于“资源搜索”功能即将下线的通知
  3. 资源搜索相关问题的解答

Contributing

Issues, pull requests, and discussions are always welcome.

License

This project is licensed under the Apache-2.0 License.

You might also like...
Tigo is an HTTP web framework written in Go (Golang).It features a Tornado-like API with better performance.  Tigo是一款用Go语言开发的web应用框架,API特性类似于Tornado并且拥有比Tornado更好的性能。
Tigo is an HTTP web framework written in Go (Golang).It features a Tornado-like API with better performance. Tigo是一款用Go语言开发的web应用框架,API特性类似于Tornado并且拥有比Tornado更好的性能。

Tigo(For English Documentation Click Here) 一个使用Go语言开发的web框架。 相关工具及插件 tiger tiger是一个专门为Tigo框架量身定做的脚手架工具,可以使用tiger新建Tigo项目或者执行其他操作。

REST Layer, Go (golang) REST API framework
REST Layer, Go (golang) REST API framework

REST Layer REST APIs made easy. REST Layer is an API framework heavily inspired by the excellent Python Eve. It helps you create a comprehensive, cust

🍐 Elegant Golang REST API Framework
🍐 Elegant Golang REST API Framework

An Elegant Golang Web Framework Goyave is a progressive and accessible web application framework focused on REST APIs, aimed at making backend develop

A rest api with the crud methods made it in golang
A rest api with the crud methods made it in golang

go-API-REST A rest api made it in golang that connects to a mongodb database This API is compatible with the Angular frontend from https://github.com/

A Simple REST API Build Using Golang

gorestapi A Simple REST API Build Using Golang About gorestapi: a simple music restapi that retrives info about the author, album name, price of it ge

API in Golang with CRUD to manipulate GeoJson

Golang API with Hexagonal Architecture API to manage point of navigation Object Point: - Name - Latitude - Longiture TODO ❏ Create point in Mongodb [X

API REST with Golang. Not directly mine.

REST API: API REST with HTTP Methods like: GET & GET ONE PUT POST DELETE To build a compiled server: CompiledDaemon To develop on a compiled server:

Opinionated boilerplate Golang HTTP server with CORS, OPA, Prometheus, rate-limiter for API and static website.
Opinionated boilerplate Golang HTTP server with CORS, OPA, Prometheus, rate-limiter for API and static website.

Teal.Finance/Garcon Opinionated boilerplate HTTP server with CORS, OPA, Prometheus, rate-limiter… for API and static website. Origin This library was

Example Golang API backend rest implementation mini project Point Of Sale using Gin Framework and Gorm ORM Database.

Example Golang API backend rest implementation mini project Point Of Sale using Gin Framework and Gorm ORM Database.

Releases(0.0.4-beta)
Owner
Lussac
Lussac
A powerful go web framework for highly scalable and resource efficient web application

webfr A powerful go web framework for highly scalable and resource efficient web application Installation: go get -u github.com/krishpranav/webfr Exa

Krisna Pranav 13 Nov 28, 2021
A powerful go web framework for highly scalable and resource efficient web application

A powerful go web framework for highly scalable and resource efficient web application

null 22 Oct 3, 2022
🥒 Simple REST-API product service (download products in .csv file)

?? Simple REST-API product service (download products in .csv file)

Pavel V 2 Nov 28, 2021
A REST web-service sample project written in Golang using go-fiber, GORM and PostgreSQL

backend A REST web-service sample project written in Golang using go-fiber, GORM and PostgreSQL How to run Make sure you have Go installed (download).

Omid Hojabri 27 Nov 9, 2022
A very basic REST service for JSON data - enough for prototyping and MVPs!

caffeine - minimum viable backend A very basic REST service for JSON data - enough for prototyping and MVPs! Features: no need to set up a database, a

aw4y 1.2k Nov 25, 2022
REST API made using native Golang libraries. This API resembles the basic working of Instagram.

Golang RESTful API for Instagram A Go based REST API built using native libraries. The API has been thoroughly worked through with Postman. Routes inc

Bhavya Goel 1 Mar 16, 2022
henrylee2cn 1.6k Nov 18, 2022
Couper is a lightweight API gateway designed to support developers in building and operating API-driven Web projects

Couper Couper is a lightweight API gateway designed to support developers in building and operating API-driven Web projects. Getting started The quick

Avenga 73 Nov 18, 2022
Boilerplate API template includes all the common packages and setup used for API development in this Company

Boilerplate API Boilerplate API template includes all the common packages and setup used for API development in this Company. Development Copy .env.ex

null 11 Feb 19, 2022
golang crud restful api with gorm , gin and mysql DB

crud restful api with golang , gorm , gin and mysql this api does a simple CRUD operations on a single table mysql Database . this is build on top off

Brahim Bessrour 14 Feb 26, 2022