https://github.com/honmaple/meting-api
MetingJS服务端的Golang实现
https://github.com/honmaple/meting-api
Last synced: 10 months ago
JSON representation
MetingJS服务端的Golang实现
- Host: GitHub
- URL: https://github.com/honmaple/meting-api
- Owner: honmaple
- License: mit
- Created: 2023-04-09T15:21:42.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-13T05:12:52.000Z (over 2 years ago)
- Last Synced: 2025-03-20T16:51:59.512Z (over 1 year ago)
- Language: Go
- Size: 35.2 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
** Meting-API
使用 *Go* 实现的 *meting-js* 接口,主要用于替换 [[https://github.com/metowolf/MetingJS][MetingJS]] 的默认API, 当前 *支持网易云音乐、网易云音乐API、QQ音乐*
** 使用
#+begin_example
└──╼ ./meting-api --help
NAME:
meting-api - meting api
USAGE:
meting-api [global options] command [command options] [arguments...]
VERSION:
0.1.0
COMMANDS:
cache-delete delete cache from key
config show all config
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--debug, -D debug mode (default: false)
--addr ADDR, -a ADDR listen ADDR
--list, -l list music servers (default: false)
--config FILE, -c FILE load config from FILE (default: "config.yaml")
--set-config value [ --set-config value ] set config from string
--help, -h show help
--version, -v print the version
#+end_example
*** 服务端
#+begin_example
└──╼ ./meting-api -D
[DEBUG] GET /meting --> meting-api/internal/app.(*App).aplayer-fm (4 handlers)
Listening and serving HTTP on :8000
#+end_example
默认将会使用缓存:
- 禁用缓存
#+begin_example
└──╼ ./meting-api -D --set-config cache.enabled=false
└──╼ METING_CACHE_ENABLED=false ./meting-api -D
#+end_example
- 修改缓存目录(默认为 =./cache=)
#+begin_example
└──╼ ./meting-api -D --set-config cache.path="/tmp/meting-cache"
└──╼ METING_CACHE_PATH="/tmp/meting-cache" ./meting-api -D
#+end_example
- 修改缓存过期时间(默认为 =3600= 秒)
#+begin_example
└──╼ ./meting-api -D --set-config cache.ttl=60
└──╼ METING_CACHE_TTL=60 ./meting-api -D
#+end_example
如果使用网易云音乐API,需要自行部署 [[https://github.com/Binaryify/NeteaseCloudMusicApi][NeteaseCloudMusicApi]],并设置
#+begin_example
└──╼ ./meting-api -D --set-config netease_api.host=https://netease_api.xxx.com
└──╼ METING_NETEASE_API_HOST=https://netease_api.xxx.com ./meting-api -D
#+end_example
*** 网页端
#+begin_src html
var meting_api='http://localhost:8000/?server=:server&type=:type&id=:id&auth=:auth&r=:r';
#+end_src
** 部署
#+begin_example
docker run --name meting-api --restart=always -d -p 8000:8000 -v /tmp/meting-cache:/opt/meting-api/cache honmaple/meting-api
#+end_example