xizeyoupan / Meting-API

🐳 Meting API 的容器化与部署
https://meting-dd.2333332.xyz
209 stars 208 forks source link

部署问题 #16

Closed 1299172402 closed 1 year ago

1299172402 commented 1 year ago

部署过程中执行如下单元测试时无法通过,返回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.
1299172402 commented 1 year ago

我从HK地区看了一下周杰伦的专辑还在的,不知道是YTmusic的某些地区block了还是我个人哪里的部署问题

https://music.youtube.com/playlist?list=RDCLAK5uy_l12ynH8dyLsBmE11ToAHLm9P04NS2i9ME

1299172402 commented 1 year ago

似乎 src\example.js 中目前的 ytmusicspotify 都收到此影响

    "ytmusic": {
        "playlist": { "show": true, "value": "RDCLAK5uy_l12ynH8dyLsBmE11ToAHLm9P04NS2i9ME" },
        "song": { "show": true, "value": "G3s98l2-GXg" }
    },
    "spotify": {
        "playlist": { "show": true, "value": "4D7JFKXy4daI9tUVJfGVFF" },
        "song": { "show": true, "value": "5HU2Ddr33JPv7ZVI77M7D5" }
    }

临时解决办法 修改 src\example.js 的内容如下

export default {
    "tencent": {
        "playlist": { "show": true, "value": "7326220405" },
        "song": { "show": true, "value": "002Rnpvi058Qdm" },
        "lrc": { "show": false, "value": "000i26Sh1ZyiNU" },
        "pic": { "show": false, "value": "002Rnpvi058Qdm" },
        "url": { "show": false, "value": "002Rnpvi058Qdm" },
    },
    "netease": {
        "playlist": { "show": true, "value": "6907557348" },
        "song": { "show": true, "value": "473403185" },
        "artist": { "show": true, "value": "12441107" },
        "lrc": { "show": false, "value": "2015217630" },
        "url": { "show": false, "value": "473403185" },
    },
    "ytmusic": {
    },
    "spotify": {
    }
}

后续可能要作者修复了。如果只是地区限制住的话替换为其他可用的播放地址就行;如果是本身解析出现问题,那感觉修复起来很麻烦 😢

xizeyoupan commented 1 year ago

由于不支持纯的js,ytmusic 需要外部api。本来内置了一个,但近期服务不免费了,因此需要自己部署。现在如果你没有在环境变量中设置api,这两个的测试会被跳过。