Open ruidpm opened 3 days ago
Thank you for your report, please try to find the URL of the video file (xxx.googlevideo.com) from the data retrieved from the getFullInfo function and open it locally. Note that we have not seen a 403 error occur with clients such as the IOS client, so we will need to investigate this in detail.
Some urls open fine when pasted locally while some error with 403. I'll try to find if there's any correlation.
Note that you need to check which client the format is being obtained from. Web clients return 403 for most formats; IOS clients, Tv clients, etc. are stable and we have not seen many 403s.
Did a few more tests:
Locally if works fine once again, in the server even though the request returns a 200 the same error still occurs.
Logs:
Checking format: 251 audio/webm; codecs="opus"
Response status: 200
Format is accessible: 251
Selected audio format: {
itag: 251,
url: 'https://rr5---sn-o097znsk.googlevideo.com/videoplayback?expire=1729195339&ei=6xgRZ5bPGteYsfIPwZ6agQI&ip=172.71.158.221&id=o-ANo86ymSYi2w-aCglxzZo1Wcw_OzjIw3u5EDyadPUJZ3&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1729173739%2C&mh=sm&mm=31%2C26&mn=sn-o097znsk%2Csn-bg0eznzr&ms=au%2Conr&mv=m&mvi=5&pl=24&rms=au%2Cau&initcwndbps=1997500&bui=AXLXGFT_S9lz7tfafFRTzOANj2wKix7x6dFMKcVLIcENmc_g6drdaRVbTwDBTaJoW-3h5N2dA4hD3Cma&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=TRv4T2ttVy3vshqHOe86bnEQ&rqh=1&gir=yes&clen=4299193&dur=271.781&lmt=1701386145493458&mt=1729173238&fvip=3&keepalive=yes&fexp=51300761%2C51312688&c=TVHTML5_SIMPLY_EMBEDDED_PLAYER&sefc=1&txp=6308224&n=XOV0LXy6BSuGbA&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIgDse-EtJ5lebKbaYZXyp0fArANvG425uPZ60W3C7Z0fUCIQDf15gUOcviRl6hubc73PwT1ofdUM5J3jv0dk7El7F82A%3D%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=ACJ0pHgwRQIhAMe0xhJGV4LCNW7c54_2NNrmJ1dFaNZbEQCgFL_8MJbNAiBiXTeEPc0QIoPY8rEh2fW73Ep1tw36gXu2kONKBh7iNQ%3D%3D',
mimeType: 'audio/webm; codecs="opus"',
codec: { text: 'opus', video: null, audio: 'opus' },
quality: { text: 'tiny', label: 'audio' },
bitrate: 150391,
audioBitrate: 160,
contentLength: '4299193',
container: 'webm',
hasVideo: false,
hasAudio: true,
isLive: false,
isHLS: false,
isDashMPD: false,
sourceClientName: 'tvEmbedded'
}
[ DEBUG ]: [ tvEmbedded ]: The URL for the video did not return a successful response. Got another format.
Reason: Status code: 403
[ DEBUG ]: [ android ]: The URL for the video did not return a successful response. Got another format.
Reason: Status code: 403
[ DEBUG ]: [ ios ]: The URL for the video did not return a successful response. Got another format.
Reason: Status code: 403
Error: No such format found: highest
at Function.chooseFormat (/app/node_modules/@ybd-project/ytdl-core/src/utils/Format.ts:220:19)
at /app/node_modules/@ybd-project/ytdl-core/src/core/Download/Download.ts:87:42
at processTicksAndRejections (node:internal/process/task_queues:95:5)
The url opens fine locally (which I found is not always the case even though the range request gets a 200) but it errors all the same.
For a bit more context Im running this behind Apache.
Are you saying that a request to googlelevideo.com using your own proxy will return 200? Then it is possible that the proxy is not correctly specified by ytdl-core when requesting the download.
Maybe, the thing that stumps me is that it all works when I run it locally. Thanks for looking into it
The next version, v6.0.5, will display the URL used for the download in the debug log. Anything further on this issue?
I still don't understand why it's not working as the whole point of the proxy is to bypass these restrictions, but I'll try with different packages/setups. Thanks
running into this issue on gcp as well, local run fine. NOTE: I do not use proxy
[ DEBUG ]: [ ios ]: The URL for the video did not return a successful response. Got another format.
Reason: Status code: 403
[ DEBUG ]: [ android ]: The URL for the video did not return a successful response. Got another format.
Reason: Status code: 403
/usr/src/app/backend/node_modules/.pnpm/@ybd-project+ytdl-core@6.0.4/node_modules/@ybd-project/ytdl-core/package/utils/Format.js:180 │
throw new Error(`No such format found: ${QUALITY}`);
Edit: This bug is beyond weird, cause I have the same setup for production and staging. Both stay under same IP but production work while staging does not. (Same IP , same poToken, same visitorData)
Upon further investigation, I do not know if this is the same issue. Some links work fine, some links do not work at all no matter what I try. For example, this will always fail for me: https://www.youtube.com/watch?v=CkK3W0lOKcc (getStream audioonly)
I understand. The cause remains unknown at this time, but we have determined that the IP is not banned, so we will rule this out as the cause.
Nope, blank page. From what I remember, the IP you get the URL have to be the same with the IP download the video
Nope, blank page. From what I remember, the IP you get the URL have to be the same with the IP download the video
I was able to play it in my environment, so the URL may have expired. (Mine is a blank page now too.)
running into this issue on gcp as well, local run fine. NOTE: I do not use proxy
[ DEBUG ]: [ ios ]: The URL for the video did not return a successful response. Got another format. Reason: Status code: 403 [ DEBUG ]: [ android ]: The URL for the video did not return a successful response. Got another format. Reason: Status code: 403 /usr/src/app/backend/node_modules/.pnpm/@ybd-project+ytdl-core@6.0.4/node_modules/@ybd-project/ytdl-core/package/utils/Format.js:180 │ throw new Error(`No such format found: ${QUALITY}`);
Edit: This bug is beyond weird, cause I have the same setup for production and staging. Both stay under same IP but production work while staging does not. (Same IP , same poToken, same visitorData)
Just a thought, what client are you using? Once you try to specify all clients as options.
clients: ['web', 'webCreator', 'webEmbedded', 'android', 'ios', 'tv', 'tvEmbedded', 'mweb']
Just a thought, what client are you using? Once you try to specify all clients as options.
clients: ['web', 'webCreator', 'webEmbedded', 'android', 'ios', 'tv', 'tvEmbedded', 'mweb']
Test with the above clients:
[ DEBUG ]: The specified OAuth2 token is valid.
[ DEBUG ]: [ FileCache ]: "html5Player" is cached.
[ DEBUG ]: [ web ]: Success
[ DEBUG ]: [ webCreator ]: Error
Reason: Please sign in
[ DEBUG ]: [ tvEmbedded ]: Success
[ DEBUG ]: [ ios ]: Success
[ DEBUG ]: [ android ]: Success
[ DEBUG ]: [ webEmbedded ]: Success
[ DEBUG ]: [ tv ]: Success
[ DEBUG ]: [ mweb ]: Success
[ DEBUG ]: [ web ]: Success
[ DEBUG ]: [ FileCache ]: "decipherFunction" is cached.
[ DEBUG ]: [ FileCache ]: "nTransformFunction" is cached.
[ DEBUG ]: [ web ]: The URL for the video did not return a successful response. Got another format.
Reason: Status code: 403
[ DEBUG ]: [ ios ]: The URL for the video did not return a successful response. Got another format.
Reason: Status code: 403
[ DEBUG ]: [ android ]: The URL for the video did not return a successful response. Got another format.
Reason: Status code: 403
/usr/src/app/backend/node_modules/.pnpm/@ybd-project+ytdl-core@6.0.4/node_modules/@ybd-project/ytdl-core/package/utils/Format.js:180
throw new Error(`No such format found: ${QUALITY}`);
^
Error: No such format found: highest
at FormatUtils.chooseFormat (/usr/src/app/backend/node_modules/.pnpm/@ybd-project+ytdl-core@6.0.4/node_modules/@ybd-project/ytdl-core/package/utils/Format.js:180:19)
at /usr/src/app/backend/node_modules/.pnpm/@ybd-project+ytdl-core@6.0.4/node_modules/@ybd-project/ytdl-core/package/core/Download/Download.js:73:51
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Test I did:
Same thing, some links worked, some links don't. Local run fine, only gcp servers do not. One more thing to note is running generate poToken from youtube-po-token-generator
hang forever on gcp server
nope, blank page (403)
nope, blank page (403)
The URL I am submitting uses Cloudflare Workers, so it should be viewable by any IP address that accesses it... This issue may require a very detailed investigation.
Update: This problem seems to have been a bug in ytdl-core and has been fixed. (Will be released in v6.0.5)
We release the beta version (v6.0.5-beta.1), please try using it. We still have no assurance that this problem has been completely cured...
npm i @ybd-project/ytdl-core@6.0.5-beta.1
Tried it with a couple of videos and it worked as expected, nice one
Tried it with a couple of videos and it worked as expected, nice one
Really!? I'm very happy!
Describe the bug
Tried OAuth, does not work on Hetzner servers (probably IP blocked). Tried to implement a proxy on CloudFlare worker, works fine locally but fails again on Hetzner server.
CloudFlare worker code:
Server code:
Tried with several different options, with and without filters, with and without PO token, always get the same error
Error Details (Log)
Environment