Code Monkey home page Code Monkey logo

maxsubtitle-openapi-server's Introduction

maxsubtitle-openapi-server

一个简易的字幕接口服务端,主要利用爬虫进行结构化数据处理并暴露接口出来给各方平台接入使用。

注意:所有的 ass 字幕会统一做 srt 转换处理,理由是 ass 中存在字体设置会存在各平台环境适配要求

How to use

Installation

go mod download
go run cmd/server/main.go

Docker

docker run -d -p 3000:3000 caryyu/maxsubtitle-openapi-server:latest

API

查询

GET http://localhost:3000/subtitle/search/mulan

[
  {
    "id": "7474966f70dc5df50217aa73180f4a3a5f0aac1ea8d28a7bca740691e74d062c",
    "originalId": "122304",
    "desc": "花木兰 中文字幕 / 木兰传说 字幕下载 / 花木兰真人版 字幕 Mulan.2020.1080p.BluRay.x264.chs&eng.ass",
    "name": "default-122304.srt",
    "url": "https://www.a4k.net//system/files/subtitle/2020-12/a4k.net_1609230823.ass",
    "format": "srt"
  },
  {
    "id": "a82f6abd4c950a951de4d2f10560b5762a695acd5da168953cb842cafc1d77d9",
    "originalId": "119847",
    "desc": "花木兰 中文字幕 / Mulan 字幕下载 / 木兰传说 字幕 Mulan.2020.BluRay.chs.中影公映国配.srt",
    "name": "default-119847.srt",
    "url": "https://www.a4k.net//system/files/subtitle/2020-12/a4k.net_1607155518.srt",
    "format": "srt"
  }
]

下载

GET http://localhost:3000/subtitle/a82f6abd4c950a951de4d2f10560b5762a695acd5da168953cb842cafc1d77d9/download

...
Content-Disposition: attachment; filename=default-119847.srt
Content-Type: text/plain; charset=UTF-8
...
1
00:00:41,500 --> 00:00:45,150
有关花木兰的传说有很多
...

需要注意头信息 Content-Disposition ,该字段会告诉浏览器决定下载的文件名及后缀

License

GPL 3.0

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.