Giter Site home page Giter Site logo

xizeyoupan / meting-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from metowolf/meting-api

143.0 2.0 132.0 835 KB

🐳 Meting API 的容器化与部署

Home Page: https://meting-dd.2333332.xyz

JavaScript 97.41% Dockerfile 1.04% Shell 1.54%
meting meting-api

meting-api's Introduction

Meting-API

https://meting-dd.2333332.xyz/test

写在前面

Meting后端的基础是一个接口,原作者在此基础上增加了php后端,又用node做了一层wrapper

同时可以发现原作者在docker hub上传了php后端的镜像,但没有node的镜像(仓库中仍有Dockerfile)。于是重写了一下。

Feature

  • 纯js实现,化简api结构
  • 适配多个PaaS平台,一键部署
  • 采用jsonp解决Tencent系地区限制
  • 插件系统,编写新接口及音源简单

进度

server参数名称 图片 歌词 url 单曲/song 歌单/playlist 歌手/artist 搜索/search
网易云 netease
qq音乐 tencent × ×
youtube music ytmusic √⁰ × ×
spotify spotify √⁰ √⁰ √⁰ √⁰ × ×
more..

地区限制

部署在国外

客户端/浏览器访问地区 国内 国外
网易云
qq音乐 √¹ ×
youtube music √²
spotify music √²

部署在国内

客户端/浏览器访问地区 国内 国外
网易云
qq音乐 ×
youtube music √²
spotify music √²

⁰youtube和spotify的歌词由 https://github.com/xizeyoupan/syncedlyrics_aio 检索而来,歌词匹配准确度不会特别高。spotify的音乐源由 https://github.com/spotDL/spotify-downloader 检索而来,歌曲匹配准确度不会很高,并且获取url的时间较长。

¹使用jsonp,需要替换前端插件https://cdn.jsdelivr.net/npm/[email protected]/dist/Meting.min.js => https://cdn.jsdelivr.net/npm/@xizeyoupan/meting@latest/dist/Meting.min.js , or https://unpkg.com/[email protected]/dist/Meting.min.js => https://unpkg.com/@xizeyoupan/meting@latest/dist/Meting.min.js

More info https://github.com/xizeyoupan/MetingJS

²见下方参数配置

参数配置

以下参数均由环境变量配置

  • YT_API 默认的youtube music和spotify的api地址。国内可用性取决于YT_API的连通性。你需要自己部署youtube music和spotify的api此仓库提供示例。
  • OVERSEAS 用于判断是否部署于国外。设为1会启用qq音乐的jsonp返回,同时需要替换前端插件,能实现国内访问国外api服务解析qq音乐。部署在国内不用设置这个选项。当部署到vercel上时,此选项自动设为1。
  • PORT api监听端口,也是docker需要映射的端口。默认3000
  • UID 用于docker,默认1010
  • GID 用于docker,默认1010

api网址

仅为示例,不保证稳定性

https://meting-dd.2333332.xyz/api => Deno Deploy

可自行测试,如 https://meting-dd.2333332.xyz/test

部署

部署 Meting-API 需要基本的计算机编程常识,如果您在部署过程中遇到无法解决的问题请到 issues 向我们提问,我们会尽快给您答复。

如果部署成功,在你的域名后拼接上/test,理论上出现类似下图数据:

手动部署

需要克隆项目到本地,node版本>=18。

npm i
npm run build:all

Node

node node.js

Deno

deno run --allow-net --allow-env dist/deno.js

或者直接下载action中的文件运行。

Docker部署

运行下面的命令下载 Meting-API 镜像

docker pull intemd/meting-api:latest

然后运行 Meting-API 即可

docker run -d --name meting -p 3000:3000 intemd/meting-api:latest

部署到vercel

比较出名,提供的域名被阻断,使用自有域名后速度尚可。冷启动速度一般。

一直下一步即可。

Deno Deploy

类似Cloudflare Workers,但提供的域名未被阻断,使用Deno为runtime。

fork本项目后新建一个project,首先在设置中加一个Environment Variable,名称是OVERSEAS,值为1。接着link到你自己的项目,部署方式选action,Deno Deploy 的 project 的 name 需要与你自己的yml中设置的吻合。

        uses: denoland/deployctl@v1
        with:
          project: meting #这里要改成你的Deno Deploy的project的name
          entrypoint: deno.js

接着在actions/publish/run workflow中勾选Deno即可。

杂项

反向代理

对于很多HTTP框架的代理来说,只需设置X-Forwarded请求头或transparent proxy。但由于本项目使用了轻量化框架Hono,目前官方似乎还不支持。所以实际有用的的请求头只有X-Forwarded-Host

比如我用nginx想让请求 http://localhost:8099/meting 的流量全部转发到 http://localhost:3000 ,直接这么写是不行的:

   server {
      listen       8099;
      server_name  localhost;

      location /meting/ {
         proxy_pass http://localhost:3000/;
      }
   }

正确写法:

  • nginx

    server {
       listen       8099;
       server_name  localhost;
    
       location /meting/ {
          proxy_pass http://localhost:3000/;
          proxy_set_header X-Forwarded-Host $scheme://$host:$server_port/meting;
       }
    }
    
  • caddy

     http://localhost:8099 {
           handle_path /meting* {
                    reverse_proxy http://localhost:3000 {
                          header_up X-Forwarded-Host {scheme}://{host}:{port}/meting
                    }
           }
     }
    

SSL证书

在上面基础上改动即可。

  • nginx

        server {
          listen       8099 ssl;
          server_name  localhost;
    
          ssl_certificate     ../server.crt;  # pem文件的路径
          ssl_certificate_key  ../server.key; # key文件的路径
          ssl_session_timeout 5m;
          ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
          ssl_protocols TLSv1.2 TLSv1.3;
          ssl_prefer_server_ciphers on;
    
          location /meting/ {
              proxy_pass http://localhost:3000/;
              proxy_set_header X-Forwarded-Host $scheme://$host:$server_port/meting;
          }
        }
    
  • caddy

     https://localhost:8099 {
        tls ./server.crt ./server.key
        handle_path /meting* {
           reverse_proxy http://localhost:3000 {
              header_up X-Forwarded-Host {scheme}://{host}:{port}/meting
           }
        }
     }
    

使用

在导入前端插件前,加入

<script>
var meting_api='http://example.com/api?server=:server&type=:type&id=:id&auth=:auth&r=:r';
</script>

比如

<script>
var meting_api='http://localhost:3000/api?server=:server&type=:type&id=:id&auth=:auth&r=:r';
</script>

即可。就这样吧,那我去看vtb了,88

相关项目

https://github.com/metowolf/MetingJS

https://github.com/metowolf/Meting-API

https://github.com/honojs/hono

https://github.com/honojs/node-server

https://github.com/camsong/fetch-jsonp

https://github.com/Binaryify/NeteaseCloudMusicApi

https://github.com/jsososo/QQMusicApi

meting-api's People

Contributors

xizeyoupan 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

meting-api's Issues

vercel 部署失败

          我是通过点击 README 文档中给出的 [Vercel 部署按钮](https://vercel.com/import/project?template=https://github.com/xizeyoupan/Meting-API),然后直接创建的。我刚才又尝试部署了一个,以下是访问 https://meting-api2.vercel.app/api 的报错信息:

image

Originally posted by @aoemon in #19 (comment)

网站备案

主站已经备案了,meting作为二级域名主站,需要在其底部放备案号吗,如何放呢。

1panel部署设置

大佬你好,我用1panel部署的项目。请问在哪能修改参数配置自己的qq音乐歌单,并且调用会员信息啊,感谢回复

docker部署之后无法访问音乐平台

使用/test访问,页面无法加载,下面是运行日志

Trace: TypeError: error sending request for url (http://c.y.qq.com/qzone/fcg-bin/fcg_ucc_getcdinfo_byids_cp.fcg?type=1&utf8=1&disstid=7326220405&loginUin=0&format=json): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async get_playlist (file:///app/dist/deno.js:2073:16)
at async Object.handle (file:///app/dist/deno.js:2142:16)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api 500 20s
Trace: TypeError: error sending request for url (https://yt-ra.2333332.xyz/api?server=ytmusic&type=song&id=G3s98l2-GXg): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async Object.handle3 [as handle] (file:///app/dist/deno.js:2503:14)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api 500 20s
Trace: TypeError: error sending request for url (http://u.y.qq.com/cgi-bin/musicu.fcg?data=%7B%22songinfo%22%3A%7B%22method%22%3A%22get_song_detail_yqq%22%2C%22module%22%3A%22music.pf_song_detail_svr%22%2C%22param%22%3A%7B%22song_mid%22%3A%22002Rnpvi058Qdm%22%7D%7D%7D): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async get_song_info (file:///app/dist/deno.js:2042:16)
at async Object.handle (file:///app/dist/deno.js:2139:16)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api 500 20s
Trace: TypeError: error sending request for url (https://yt-ra.2333332.xyz/api?server=ytmusic&type=playlist&id=RDCLAK5uy_l12ynH8dyLsBmE11ToAHLm9P04NS2i9ME): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async Object.handle3 [as handle] (file:///app/dist/deno.js:2503:14)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api 500 20s
Trace: TypeError: error sending request for url (https://music.163.com/api/v6/playlist/detail): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async request (file:///app/dist/deno.js:2353:11)
at async get_playlist2 (file:///app/dist/deno.js:2383:13)
at async Object.handle2 [as handle] (file:///app/dist/deno.js:2483:16)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api 500 20s
Trace: TypeError: error sending request for url (https://music.163.com/weapi/v3/song/detail): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async request (file:///app/dist/deno.js:2353:11)
at async get_song_info2 (file:///app/dist/deno.js:2429:13)
at async Object.handle2 [as handle] (file:///app/dist/deno.js:2480:16)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api 500 20s
Trace: TypeError: error sending request for url (http://c.y.qq.com/qzone/fcg-bin/fcg_ucc_getcdinfo_byids_cp.fcg?type=1&utf8=1&disstid=7326220405&loginUin=0&format=json): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async get_playlist (file:///app/dist/deno.js:2073:16)
at async Object.handle (file:///app/dist/deno.js:2142:16)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api 500 20s
Trace: TypeError: error sending request for url (https://yt-ra.2333332.xyz/api?server=ytmusic&type=song&id=G3s98l2-GXg): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async Object.handle3 [as handle] (file:///app/dist/deno.js:2503:14)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
Trace: TypeError: error sending request for url (http://u.y.qq.com/cgi-bin/musicu.fcg?data=%7B%22songinfo%22%3A%7B%22method%22%3A%22get_song_detail_yqq%22%2C%22module%22%3A%22music.pf_song_detail_svr%22%2C%22param%22%3A%7B%22song_mid%22%3A%22002Rnpvi058Qdm%22%7D%7D%7D): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async get_song_info (file:///app/dist/deno.js:2042:16)
at async Object.handle (file:///app/dist/deno.js:2139:16)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api 500 20s
--> GET /api 500 20s
Trace: TypeError: error sending request for url (https://yt-ra.2333332.xyz/api?server=ytmusic&type=playlist&id=RDCLAK5uy_l12ynH8dyLsBmE11ToAHLm9P04NS2i9ME): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async Object.handle3 [as handle] (file:///app/dist/deno.js:2503:14)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api 500 20s
Trace: TypeError: error sending request for url (https://music.163.com/weapi/v3/song/detail): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async request (file:///app/dist/deno.js:2353:11)
at async get_song_info2 (file:///app/dist/deno.js:2429:13)
at async Object.handle2 [as handle] (file:///app/dist/deno.js:2480:16)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api 500 20s
Trace: TypeError: error sending request for url (https://music.163.com/api/v6/playlist/detail): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
at async mainFetch (deno:ext/fetch/26_fetch.js:267:14)
at async fetch (deno:ext/fetch/26_fetch.js:491:9)
at async request (file:///app/dist/deno.js:2353:11)
at async get_playlist2 (file:///app/dist/deno.js:2383:13)
at async Object.handle2 [as handle] (file:///app/dist/deno.js:2483:16)
at async api_default (file:///app/dist/deno.js:2572:14)
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3754:15)
at file:///app/dist/deno.js:2930:27
at async file:///app/dist/deno.js:3942:5
at async file:///app/dist/deno.js:3986:7
at async file:///app/dist/deno.js:3888:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api 500 20s

docker部署后如何修改配置

1,使用docker部署后如何将配置改为qq音乐呢我用的宝塔进入容器后如何修改找那个文件
2,想要使用api就复制api地址吗
3,不绑定域名直接ip+端口可以吗
谢谢解答,万分感谢。谢谢

cookie修改

想问下大佬,网易的cookie怎么修改,是在/src/providers/netease/util.js这个路径吗,具体怎么修改阿,cookie粘在哪阿
屏幕截图 2023-07-26 123051
如果大佬有空回一下,谢谢啦!

部署问题

部署过程中执行如下单元测试时无法通过,返回500。
部署采用deno

commit:
https://github.com/1299172402/Meting-API/tree/328367e006d4b6f62c47a50536f3026dcff54511

workflow log:
https://github.com/1299172402/Meting-API/actions/runs/6026292626/job/16348884175

testing http://localhost:3000/api?server=ytmusic&type=playlist&id=RDCLAK5uy_l12ynH8dyLsBmE11ToAHLm9P04NS2i9ME
500
retrying 5

 ❯ test/providers.test.js  (3 tests | 1 failed) 14068ms
   ❯ test/providers.test.js > test api
     → expected 500 to be less than 400
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  test/providers.test.js > test api

AssertionError: expected 500 to be less than 400
 ❯ test/providers.test.js:49:32
     47|             expect(res).toBeDefined()
     48|             expect(res.status).toBeGreaterThanOrEqual(200)
     49|             expect(res.status).toBeLessThan(400)
       |                                ^
     50|         }
     51| 

  - Expected   "500"
  + Received   "400"

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

 Test Files  1 failed (1)
      Tests  1 failed | 2 passed (3)
   Start at  14:33:21
   Duration  14.86s (transform 245ms, setup 0ms, collect 377ms, tests 14.07s)

Error: Process completed with exit code 1.

搭建好后,访问了3000端口产生了如下的 ERR_INVALID_THIS 错误是什么原因呢?

root@miuzkle-nas-debian:/home/miuzkle/project/hexo_blog/source/self/meting-api# npm i
npm run build:all
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead

added 158 packages, and audited 159 packages in 18s

35 packages are looking for funding
run npm fund for details

5 vulnerabilities (2 moderate, 3 high)

To address all issues, run:
npm audit fix

Run npm audit for details.
npm notice
npm notice New minor version of npm available! 10.2.4 -> 10.5.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.5.0
npm notice Run npm install -g [email protected] to update!
npm notice

[email protected] build:all
node esbuild.config.js

root@miuzkle-nas-debian:/home/miuzkle/project/hexo_blog/source/self/meting-api# ls
Dockerfile api assets dist node.js package-lock.json scripts test
README.md app.js deno.js esbuild.config.js node_modules package.json src vercel.json
root@miuzkle-nas-debian:/home/miuzkle/project/hexo_blog/source/self/meting-api# node node.js
Trace: TypeError [ERR_INVALID_THIS]: Value of "this" must be of type URLSearchParams
at Proxy.getAll (node:internal/url:527:13)
at Proxy. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1034:44)
at Proxy.get (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1067:23)
at HonoRequest.header (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/request.js:50:31)
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/middleware/cors/index.js:26:47
at dispatch (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/compose.js:24:17)
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/compose.js:7:12
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:237:21
at Hono.dispatch (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:248:7)
at Hono.fetch (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:39:19) {
code: 'ERR_INVALID_THIS'
}
at errorHandler (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:19:11)
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/compose.js:58:33
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:238:62
at async Server. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@hono/node-server/dist/server.js:48:20)
Trace: TypeError [ERR_INVALID_THIS]: Value of "this" must be of type URLSearchParams
at Proxy.has (node:internal/url:546:13)
at Proxy. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1034:44)
at new Response (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1227:33)
at new NodeResponse (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@hono/node-server/dist/fetch.js:24:1)
at Context.newResponse (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/context.js:106:14)
at Context.text (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/context.js:124:45)
at errorHandler (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:21:12)
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/compose.js:58:33
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:238:62 {
code: 'ERR_INVALID_THIS'
}
at Hono.errorHandler (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:19:11)
at Hono.handleError (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:185:19)
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:246:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Server. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@hono/node-server/dist/server.js:48:20)
node:internal/url:527
throw new ERR_INVALID_THIS('URLSearchParams');
^

TypeError [ERR_INVALID_THIS]: Value of "this" must be of type URLSearchParams
at Proxy.getAll (node:internal/url:527:13)
at Proxy. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1034:44)
at Proxy.get (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1067:23)
at Server. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@hono/node-server/dist/server.js:53:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_THIS'
}

Node.js v20.11.1
root@miuzkle-nas-debian:/home/miuzkle/project/hexo_blog/source/self/meting-api# node node.js
Trace: TypeError [ERR_INVALID_THIS]: Value of "this" must be of type URLSearchParams
at Proxy.getAll (node:internal/url:527:13)
at Proxy. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1034:44)
at Proxy.get (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1067:23)
at HonoRequest.header (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/request.js:50:31)
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/middleware/cors/index.js:26:47
at dispatch (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/compose.js:24:17)
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/compose.js:7:12
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:237:21
at Hono.dispatch (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:248:7)
at Hono.fetch (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:39:19) {
code: 'ERR_INVALID_THIS'
}
at errorHandler (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:19:11)
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/compose.js:58:33
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:238:62
at async Server. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@hono/node-server/dist/server.js:48:20)
Trace: TypeError [ERR_INVALID_THIS]: Value of "this" must be of type URLSearchParams
at Proxy.has (node:internal/url:546:13)
at Proxy. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1034:44)
at new Response (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1227:33)
at new NodeResponse (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@hono/node-server/dist/fetch.js:24:1)
at Context.newResponse (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/context.js:106:14)
at Context.text (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/context.js:124:45)
at errorHandler (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:21:12)
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/compose.js:58:33
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:238:62 {
code: 'ERR_INVALID_THIS'
}
at Hono.errorHandler (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:19:11)
at Hono.handleError (file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:185:19)
at file:///home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/hono/dist/hono-base.js:246:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Server. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@hono/node-server/dist/server.js:48:20)
node:internal/url:527
throw new ERR_INVALID_THIS('URLSearchParams');
^

TypeError [ERR_INVALID_THIS]: Value of "this" must be of type URLSearchParams
at Proxy.getAll (node:internal/url:527:13)
at Proxy. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1034:44)
at Proxy.get (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1067:23)
at Server. (/home/miuzkle/project/hexo_blog/source/self/meting-api/node_modules/@hono/node-server/dist/server.js:53:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_THIS'
}

Node.js v20.11.1

使用 docker部署后出现问题

Trace: TypeError: Cannot read properties of undefined (reading 'trackIds')
at get_playlist2 (file:///app/dist/deno.js:2393:31)
at async Object.handle2 [as handle] (file:///app/dist/deno.js:2493:16)
at async api_default (file:///app/dist/deno.js:2581:14)
at async file:///app/dist/deno.js:3952:5
at async file:///app/dist/deno.js:3996:7
at async file:///app/dist/deno.js:3898:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
at Hono.errorHandler (file:///app/dist/deno.js:3764:15)
at file:///app/dist/deno.js:2940:27
at async file:///app/dist/deno.js:3952:5
at async file:///app/dist/deno.js:3996:7
at async file:///app/dist/deno.js:3898:50
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:299:18)
--> GET /api �[31m500�[0m 138ms

/test 是没问题的,不知道这是出了什么问题

打包运行表示该方法异常

[root@iZ2vcb2izu72doudn51a2vZ meeting-api]# deno run --allow-net --allow-env /www/server/meeting-api/deno.js
error: Uncaught (in promise) TypeError: that.write is not a function
var actual = that.write(string, encoding);
^
at fromString2 (file:///www/server/meeting-api/deno.js:2136:21)
at from2 (file:///www/server/meeting-api/deno.js:2096:12)
at Function.Buffer3.from (file:///www/server/meeting-api/deno.js:2768:14)
at file:///www/server/meeting-api/deno.js:35914:36
at Array.forEach ()
at node_modules/browserify-sign/browser/index.js (file:///www/server/meeting-api/deno.js:35913:29)
at __require (file:///www/server/meeting-api/deno.js:11:50)
at node_modules/crypto-browserify/index.js (file:///www/server/meeting-api/deno.js:42229:16)
at __require (file:///www/server/meeting-api/deno.js:11:50)
at file:///www/server/meeting-api/deno.js:44534:41

aplayer的参数失效了?

<meting-js server="netease" type="playlist" id="7041830767" fixed="true" autoplay="true" loop="all" order="list"
    preload="auto" list-folded="ture" list-max-height="500px" lrc-type="1">
</meting-js>

自动播放功能似乎失效了

netease 在获取歌单数据时存在一定概率意外获取到其他歌曲

https://meting-ve.2333332.xyz/api?server=netease&type=playlist&id=8712019924&r=0.004259443209829461

以上歌单只有一首歌曲,但存在一定概率意外获取到其他歌曲,返回的异常歌单数据大概在 10 首左右。

image
image

可以访问该链接,它会每隔 1 秒请求一次 https://meting-ve.2333332.xyz/api?server=netease&type=playlist&id=8712019924&r=0.004259443209829461 直到获取到的歌单歌曲数量大于 1 才会返回歌单数据,平均大概等待 10 秒左右会返回异常歌单数据。

经过多次尝试,我发现官方的服务似乎没有这个问题:https://api.i-meto.com/meting/api?server=netease&type=playlist&id=8712019924&r=0.004259443209829461

https

大佬,请问一下,这个https应该怎么部署呢?我迁移到我网站上面去,http的访问不了,唉

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.