{"id":26489710,"url":"https://github.com/xizeyoupan/Meting-API","last_synced_at":"2025-03-20T07:48:32.331Z","repository":{"id":65538836,"uuid":"592292816","full_name":"xizeyoupan/Meting-API","owner":"xizeyoupan","description":"🐳 Meting API 的容器化与部署","archived":false,"fork":true,"pushed_at":"2024-03-24T12:40:34.000Z","size":835,"stargazers_count":119,"open_issues_count":0,"forks_count":102,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-24T13:43:20.505Z","etag":null,"topics":["meting","meting-api"],"latest_commit_sha":null,"homepage":"https://meting-dd.2333332.xyz","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"metowolf/Meting-API","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xizeyoupan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-01-23T12:18:33.000Z","updated_at":"2024-03-23T13:48:10.000Z","dependencies_parsed_at":"2023-02-16T21:30:33.270Z","dependency_job_id":"acef0c44-07ee-436c-95ec-b480da30ab75","html_url":"https://github.com/xizeyoupan/Meting-API","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xizeyoupan%2FMeting-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xizeyoupan%2FMeting-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xizeyoupan%2FMeting-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xizeyoupan%2FMeting-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xizeyoupan","download_url":"https://codeload.github.com/xizeyoupan/Meting-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244574780,"owners_count":20474818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["meting","meting-api"],"created_at":"2025-03-20T07:48:30.111Z","updated_at":"2025-03-20T07:48:32.317Z","avatar_url":"https://github.com/xizeyoupan.png","language":"JavaScript","funding_links":[],"categories":["🧙🏻 快速上手"],"sub_categories":["🔮 音乐播放器"],"readme":"# Meting-API\n\nhttps://meting-dd.2333332.xyz/test\n\n## 写在前面\n\nMeting后端的基础是一个[接口](https://github.com/metowolf/Meting/blob/master/src/Meting.php)，原作者在此基础上增加了[php后端](https://github.com/metowolf/Meting-API/blob/master/api/root/var/www/meting/public/index.php)，又用node做了一层[wrapper](https://github.com/metowolf/Meting-API/tree/master/server)。\n\n同时可以发现原作者在docker hub上传了php后端的[镜像](https://hub.docker.com/r/metowolf/meting)，但没有node的镜像（仓库中仍有Dockerfile）。于是重写了一下。\n\n## Feature\n\n- 纯js实现，化简api结构\n- 适配多个PaaS平台，一键部署\n- 采用jsonp解决Tencent系地区限制\n- 插件系统，编写新接口及音源简单\n\n## 进度\n\n|               | server参数名称 | 图片 | 歌词 | url | 单曲/song | 歌单/playlist | 歌手/artist | 搜索/search |\n| ------------- | -------------- | ---- | ---- | --- | --------- | ------------- | ----------- |--------- |\n| 网易云        | netease        | √    | √    | √   | √         | √             | √           |√         |\n| qq音乐        | tencent        | √    | √    | √   | √         | √             | ×           |×         |\n| youtube music | ytmusic        | √    | √⁰   | √   | √         | √             | ×           |×         |\n| spotify       | spotify        | √    | √⁰   | √⁰  | √⁰        | √⁰            | ×           |×         |\n| more..        |                |      |      |     |           |               |             |         |\n\n## 地区限制\n\n### 部署在国外\n\n| 客户端/浏览器访问地区 | 国内 | 国外 |\n| --------------------- | ---- | ---- |\n| 网易云                | √    | √    |\n| qq音乐                | √¹   | ×    |\n| youtube music         | √²   | √    |\n| spotify music         | √²   | √    |\n\n### 部署在国内\n\n| 客户端/浏览器访问地区 | 国内 | 国外 |\n| --------------------- | ---- | ---- |\n| 网易云                | √    | √    |\n| qq音乐                | √    | ×    |\n| youtube music         | √²   | √    |\n| spotify music         | √²   | √    |\n\n⁰youtube和spotify的歌词由 https://github.com/xizeyoupan/syncedlyrics_aio 检索而来，歌词匹配准确度不会特别高。spotify的音乐源由 https://github.com/spotDL/spotify-downloader 检索而来，歌曲匹配准确度不会很高，并且获取url的时间较长。\n\n¹使用jsonp，**需要替换前端插件**， https://cdn.jsdelivr.net/npm/meting@2.0.1/dist/Meting.min.js =\u003e https://cdn.jsdelivr.net/npm/@xizeyoupan/meting@latest/dist/Meting.min.js , or \nhttps://unpkg.com/meting@2.0.1/dist/Meting.min.js =\u003e https://unpkg.com/@xizeyoupan/meting@latest/dist/Meting.min.js\n\nMore info https://github.com/xizeyoupan/MetingJS\n\n²见下方参数配置\n\n## 参数配置\n以下参数均由环境变量配置\n\n- YT_API\n  默认的youtube music和spotify的api地址。国内可用性取决于YT_API的连通性。**你需要自己部署youtube music和spotify的api**。[此仓库](https://github.com/xizeyoupan/ytmusic-api-server)提供示例。\n- OVERSEAS\n  用于判断是否部署于国外。设为1会启用qq音乐的jsonp返回，同时需要替换[前端插件](https://github.com/xizeyoupan/MetingJS)，能实现国内访问国外api服务解析qq音乐。部署在国内不用设置这个选项。当部署到vercel上时，此选项自动设为1。\n- PORT\n  api监听端口，也是docker需要映射的端口。默认3000\n- UID\n  用于docker，默认1010\n- GID\n  用于docker，默认1010\n\n## api网址\n仅为示例，不保证稳定性\n\nhttps://meting-dd.2333332.xyz/api =\u003e Deno Deploy\n\n可自行测试，如 https://meting-dd.2333332.xyz/test\n\n## 部署\n\n部署 Meting-API 需要基本的计算机编程常识，如果您在部署过程中遇到无法解决的问题请到 issues 向我们提问，我们会尽快给您答复。\n\n如果部署成功，在你的域名后拼接上`/test`，理论上出现类似下图数据：\n\n![](assets/test.png)\n\n### 手动部署\n\n需要克隆项目到本地，node版本\u003e=18。\n\n```\nnpm i\nnpm run build:all\n```\n\n#### Node\n\n`node node.js`\n\n#### Deno\n\n`deno run --allow-net --allow-env dist/deno.js`\n\n或者直接下载action中的文件运行。\n\n### Docker部署\n\n运行下面的命令下载 Meting-API 镜像\n\n```\ndocker pull intemd/meting-api:latest\n```\n\n然后运行 Meting-API 即可\n\n```\ndocker run -d --name meting -p 3000:3000 intemd/meting-api:latest\n```\n\n### 部署到vercel\n\n比较出名，提供的域名被阻断，使用自有域名后速度尚可。冷启动速度一般。\n\n\u003ca href=\"https://vercel.com/import/project?template=https://github.com/xizeyoupan/Meting-API\"\u003e\u003cimg src=\"https://vercel.com/button\" height=\"36\"\u003e\u003c/a\u003e\n\n一直下一步即可。\n\n### Deno Deploy\n\n类似Cloudflare Workers，但提供的域名未被阻断，使用Deno为runtime。\n\nfork本项目后新建一个[project](https://dash.deno.com/projects)，首先在设置中加一个Environment Variable，名称是OVERSEAS，值为1。接着link到你自己的项目，部署方式选action，Deno Deploy 的 project 的 name 需要与你自己的yml中设置的吻合。\n\n```yml\n        uses: denoland/deployctl@v1\n        with:\n          project: meting #这里要改成你的Deno Deploy的project的name\n          entrypoint: deno.js\n```\n\n接着在actions/publish/run workflow中勾选Deno即可。\n\n## 杂项\n\n### 反向代理\n\n对于很多HTTP框架的代理来说，只需设置X-Forwarded请求头或transparent proxy。但由于本项目使用了轻量化框架Hono，目前官方似乎还不支持。所以实际有用的的请求头只有`X-Forwarded-Host`。\n\n比如我用nginx想让请求 `http://localhost:8099/meting` 的流量全部转发到 `http://localhost:3000` ，直接这么写是不行的：\n\n```\n   server {\n      listen       8099;\n      server_name  localhost;\n\n      location /meting/ {\n         proxy_pass http://localhost:3000/;\n      }\n   }\n```\n\n正确写法：\n\n- nginx\n\n   ```\n   server {\n      listen       8099;\n      server_name  localhost;\n\n      location /meting/ {\n         proxy_pass http://localhost:3000/;\n         proxy_set_header X-Forwarded-Host $scheme://$host:$server_port/meting;\n      }\n   }\n   ```\n\n- caddy\n  \n  ```\n   http://localhost:8099 {\n         handle_path /meting* {\n                  reverse_proxy http://localhost:3000 {\n                        header_up X-Forwarded-Host {scheme}://{host}:{port}/meting\n                  }\n         }\n   }\n  ```\n\n### SSL证书\n\n在上面基础上改动即可。\n\n- nginx\n  ```\n      server {\n        listen       8099 ssl;\n        server_name  localhost;\n\n        ssl_certificate     ../server.crt;  # pem文件的路径\n        ssl_certificate_key  ../server.key; # key文件的路径\n        ssl_session_timeout 5m;\n        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;\n        ssl_protocols TLSv1.2 TLSv1.3;\n        ssl_prefer_server_ciphers on;\n\n        location /meting/ {\n            proxy_pass http://localhost:3000/;\n            proxy_set_header X-Forwarded-Host $scheme://$host:$server_port/meting;\n        }\n      }\n  ```\n\n- caddy\n  ```\n   https://localhost:8099 {\n      tls ./server.crt ./server.key\n      handle_path /meting* {\n         reverse_proxy http://localhost:3000 {\n            header_up X-Forwarded-Host {scheme}://{host}:{port}/meting\n         }\n      }\n   }\n  ```\n\n## 使用\n\n在导入[前端插件](https://github.com/xizeyoupan/MetingJS)前，加入\n\n```\n\u003cscript\u003e\nvar meting_api='http://example.com/api?server=:server\u0026type=:type\u0026id=:id\u0026auth=:auth\u0026r=:r';\n\u003c/script\u003e\n```\n\n比如\n\n```\n\u003cscript\u003e\nvar meting_api='http://localhost:3000/api?server=:server\u0026type=:type\u0026id=:id\u0026auth=:auth\u0026r=:r';\n\u003c/script\u003e\n```\n\n即可。就这样吧，那我去看vtb了，88\n\n### 相关项目\n\nhttps://github.com/metowolf/MetingJS\n\nhttps://github.com/metowolf/Meting-API\n\nhttps://github.com/honojs/hono\n\nhttps://github.com/honojs/node-server\n\nhttps://github.com/camsong/fetch-jsonp\n\nhttps://github.com/Binaryify/NeteaseCloudMusicApi\n\nhttps://github.com/jsososo/QQMusicApi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxizeyoupan%2FMeting-API","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxizeyoupan%2FMeting-API","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxizeyoupan%2FMeting-API/lists"}