UnblockNeteaseMusic / server

Revive unavailable songs for Netease Cloud Music (Refactored & Enhanced version)
GNU Lesser General Public License v3.0
6.46k stars 634 forks source link

yt-dlp源只能播放9秒 #775

Closed duhd1993 closed 2 months ago

duhd1993 commented 2 years ago

有两种情况

Jul 06 00:28:29 bwh unblockneteasemusic[12923]: INFO: (spawn) running yt-dlp -f 140 --dump-json ytsearch1:我的时代 (Live) - 派伟俊
Jul 06 00:28:30 bwh unblockneteasemusic[12923]: INFO: (provider/match) Replaced: [1400391917] 我的时代 (Live)
Jul 06 00:28:30 bwh unblockneteasemusic[12923]:     audioId: 1400391917
Jul 06 00:28:30 bwh unblockneteasemusic[12923]:     songName: "我的时代 (Live)"
Jul 06 00:28:30 bwh unblockneteasemusic[12923]:     url: "http://upos-sz-mirrorhw.bilivideo.com/ugaxcode/m210607a212m7ai7em2dkv10xnq7udv0-192k.m4a?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrN>
Jul 06 00:28:31 bwh unblockneteasemusic[12923]: ERROR: (provider/yt-dlp) Unexpected end of JSON input
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:     SyntaxError: Unexpected end of JSON input
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at JSON.parse (<anonymous>)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at getUrl (/usr/local/UnblockNeteaseMusic/precompiled/app.js:2893:31)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at runMicrotasks (<anonymous>)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at processTicksAndRejections (node:internal/process/task_queues:96:5)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at async search (/usr/local/UnblockNeteaseMusic/precompiled/app.js:2902:21)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at async CacheStorage.cache (/usr/local/UnblockNeteaseMusic/precompiled/app.js:129:32)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at async getAudioFromSource (/usr/local/UnblockNeteaseMusic/precompiled/app.js:2298:23)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at async Promise.any (index 4)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]: ERROR: (provider/match) Unexpected end of JSON input
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:     SyntaxError: Unexpected end of JSON input
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at JSON.parse (<anonymous>)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at getUrl (/usr/local/UnblockNeteaseMusic/precompiled/app.js:2893:31)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at runMicrotasks (<anonymous>)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at processTicksAndRejections (node:internal/process/task_queues:96:5)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at async search (/usr/local/UnblockNeteaseMusic/precompiled/app.js:2902:21)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at async CacheStorage.cache (/usr/local/UnblockNeteaseMusic/precompiled/app.js:129:32)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at async getAudioFromSource (/usr/local/UnblockNeteaseMusic/precompiled/app.js:2298:23)
Jul 06 00:28:31 bwh unblockneteasemusic[12923]:         at async Promise.any (index 4)

似乎就没获取到正确的json返回值,手动run没问题(关键词中间有空格需要加上引号,spawn应该不存在这个问题)

Jul 06 00:44:20 bwh unblockneteasemusic[12923]: INFO: (spawn) running yt-dlp -f 140 --dump-json ytsearch1:爱的飞行日记 (Live) - 杨瑞代
Jul 06 00:44:21 bwh unblockneteasemusic[12923]: INFO: (provider/match) Replaced: [1400391959] 爱的飞行日记 (Live)
Jul 06 00:44:21 bwh unblockneteasemusic[12923]:     audioId: 1400391959
Jul 06 00:44:21 bwh unblockneteasemusic[12923]:     songName: "爱的飞行日记 (Live)"
Jul 06 00:44:21 bwh unblockneteasemusic[12923]:     url: "http://upos-sz-mirrorhw.bilivideo.com/ugaxcode/m200827a21tk9tt5txmcwh13v7gmq7il-192k.m4a?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrN>
Jul 06 00:44:24 bwh unblockneteasemusic[12923]: INFO: (spawn) running yt-dlp -f 140 --dump-json https://www.youtube.com/watch?v=P7IvYsQuZCc

搜索出来的这个完全不对,也没被用到

duhd1993 commented 2 years ago

@pan93412 请问有时间看看吗?

duhd1993 commented 2 years ago

今天好像能搜到了,但是不能正常播放,拿到的url是完整的,但是播放的只有9s,这好像是个长期的known issue,mac版无法正常播放mp4

[INFO: (spawn) running yt-dlp -f 140 --dump-json ytsearch1:Mojito - 周杰伦
INFO: (spawn) running yt-dlp -f 140 --dump-json https://www.youtube.com/watch?v=-biOGdYiF-I
INFO: (provider/match) Replaced: [1454811222] Mojito
    audioId: 1454811222
    songName: "Mojito"
    url: "https://rr6---sn-a5mlrnez.googlevideo.com/videoplayback?expire=1657624408&ei=-ALNYtTDI8vCkgan3pH4Dg&ip=111.111.111.111&id=o-AMJcL0sU9LYnrT07TD7mEe-n37Gy6aFbRuF4MGBEXxZm&itag=140&source=youtube&requiressl=yes&mh=6F&mm=31%2C29&mn=sn-a5mlrnez%2Csn-a5mekn6k&ms=au%2Crdu&mv=m&mvi=6&pl=20&initcwndbps=1251250&vprv=1&mime=audio%2Fmp4&gir=yes&clen=3049455&dur=188.383&lmt=1653628543790854&mt=1657602541&fvip=4&keepalive=yes&fexp=24001373%2C24007246&c=ANDROID&txp=4532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAP5QZ_aGwXVnkOp5WNjV3SIxB-1eRsrzv4RXyrbHduPZAiAE8xyfs6nE_-4MGCahgRxyPUYVKLClTOd6m4kBhtiJ5g%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgL4VuKjoZvNX7G66PjXA2VLpRqzQdh3bkBqT2KY8NQ8kCIQCIUNo1WQF3_j5VGL0UdhkAY8ZxTPWs8pmPUWpynBdz6g%3D%3D"
overXsky commented 2 years ago

同遇到此问题,怎么解决?

pan93412 commented 2 years ago

最近很忙,沒空處理 UNM⋯⋯先把 yt-dlp 音源停用吧。

duhd1993 commented 2 years ago

我这里Kugou这个源也不能用,搜了下找到这个API https://github.com/LanccBy2016/KugouDownload/blob/68d3819782106fb2035716c266890e29e9824f9a/kugoudownload/Program.cs#L96 可以用。需要的话可以PR

pan93412 commented 2 years ago

@duhd1993 可以幫忙 PR 嗎,謝謝!❤️

可以的話也希望能幫忙也 PR 到 https://github.com/UnblockNeteaseMusic/server-rust

duhd1993 commented 2 years ago

好的,不过我好像没看到人反馈kugou不能用,不确定是不是我的问题。

catalpaaa commented 2 years ago

除了bilibili 和 ytdlp之外的音源我在墙外都用不了

ZhaofengWu commented 2 years ago

同样遇到 ytdlp 只能播放九秒的问题,请问目前有解决方式吗?

zzz6839 commented 2 years ago

IOS用ytdlp也会出现只能播放九秒的问题, latest version: b515963328a031151c3a7274ad4f5985bbd485f1。#803

ERROR: (hook) A error occurred in hook.request.before when hooking https://interface3.music.163.com/eapi/ios/upgrade/get. Error: aborted at connResetException (node:internal/errors:704:14) at abortIncoming (node:_http_server:625:17) at socketOnClose (node:_http_server:619:3) at TLSSocket.emit (node:events:525:35) at node:net:758:14 at Socket.done (node:_tls_wrap:584:7) at Object.onceWrapper (node:events:628:26) at Socket.emit (node:events:513:28) at TCP. (node:net:758:14) code: ECONNRESET

oishi81 commented 2 years ago

最近很忙,沒空處理 UNM⋯⋯先把 yt-dlp 音源停用吧。

请问如何停用yt-dlp音源? 我是用的node app.js

myahmao commented 2 years ago

yt-dlp命令可以把MP4在本地转成MP3,也就几秒钟的事。可以打开mp3文件播放吗,还是必须从json里面获得网页链接播放?

zzz6839 commented 1 year ago

新的ytdlp问题:

https://litter.catbox.moe/3siebk.txt https://transfer.sh/6IdIXg/unm-debugging-output.txt

pan93412 commented 1 year ago

新的ytdlp问题:

litter.catbox.moe/3siebk.txt transfer.sh/6IdIXg/unm-debugging-output.txt

都 Not Found 耶……

zzz6839 commented 1 year ago

新的ytdlp问题: litter.catbox.moe/3siebk.txt transfer.sh/6IdIXg/unm-debugging-output.txt

都 Not Found 耶……

旧的估计都过期了,这是最新的4/9/2023 10:51pm,你可以看下

https://litter.catbox.moe/nyw8ug.txt https://transfer.sh/eB96OX/unm-debugging-output.txt

pan93412 commented 1 year ago

新的ytdlp问题: litter.catbox.moe/3siebk.txt transfer.sh/6IdIXg/unm-debugging-output.txt

都 Not Found 耶……

旧的估计都过期了,这是最新的4/9/2023 10:51pm,你可以看下

litter.catbox.moe/nyw8ug.txt transfer.sh/eB96OX/unm-debugging-output.txt

我看了一下,應該是你 yt-dlp 裝得有點問題。試試看 pip install yt-dlp 重裝?

zzz6839 commented 1 year ago

新的ytdlp问题: litter.catbox.moe/3siebk.txt transfer.sh/6IdIXg/unm-debugging-output.txt

都 Not Found 耶……

旧的估计都过期了,这是最新的4/9/2023 10:51pm,你可以看下 litter.catbox.moe/nyw8ug.txt transfer.sh/eB96OX/unm-debugging-output.txt

我看了一下,應該是你 yt-dlp 裝得有點問題。試試看 pip install yt-dlp 重裝?

确实是,谢谢解答。 P.S. 准确来说应该是2023.03.04版本的上游ytdlp的openwrt的package出现了问题,卸载后使用pip版本安装得到解决

freeqimmy commented 1 year ago

尝试了下2023.02.17版本,binary、linux standalone以及pip版本的都试了,结果都是只能播放9秒,问题没有解决

EricYoung37 commented 1 year ago

我也遇到了,不使用严格模式$node app.js -p 8080:8081 -e https://music.163.com,iOS端只能播9秒 使用严格模式$node app.js -p 8080:8081 -s -e https://music.163.com,yt-dlp能搜索到链接并替换歌曲,但是会不断搜索,在81.70.126.110:80(酷我)与218.200.160.55:443(咪咕)间反复横跳超时,最终是iOS端无法播放

rcy17 commented 8 months ago

截止2024年2月更新的0.27.5版本,这一问题仍然存在,我观测到了在仅启用 ytdlp 源时在 windows 上可以正常工作,但是在 MacOS 上会得到只能播放9秒的版本。

forrany commented 8 months ago

同样遇到此问题,似乎使用海外服务器有点无解。。。

现在我这边用大陆的服务器了

uxfion commented 5 months ago

我也是只有9s,但是看后台获取到的直链是完整的全部歌曲,mac客户端

image
Kyle-Kyle commented 4 months ago

根据yt-dlp的log: WARNING: xxxxx: writing DASH m4a. Only some players support this container. Install ffmpeg to fix this automatically, 应该是youtube那边的问题。 把音乐用yt-dlp下载下来(diginal ocean上大概3秒)在服务器上架个RangeHTTPServer就完了

ZhaofengWu commented 2 months ago

@1715173329 请问 close 了是因为没办法 fix 吗?

1715173329 commented 2 months ago

这是 youtube 和 macos 设备之间的问题,不应由 unm 处理,也很难处理。