distubejs / ytdl-core

YouTube video downloader in javascript.
MIT License
289 stars 50 forks source link

[request for assistance with expert knowledge] browser build yields video URLs that return 403 status #113

Closed warren-bank closed 1 month ago

warren-bank commented 1 month ago

Presumably, the messy part is how to replace undici with a fetch wrapper. The agent class is no-longer used, and we're relying on the browser to manage cookies. As is, all fetch requests get a 200 response. And yet, no joy.. the videos return 403.

If anyone wants a working browser-build to use in userscripts (etc), then I need some help to figure out what request/cookie is missing.. so the request for the video URLs is allowed.

warren-bank commented 1 month ago

solved:

OK, so lets file this under serendipitous.. PR#111 was opened today, and it fixes the issue! Please merge.

bunglegrind commented 1 month ago

you can take inspiration from:

https://addons.mozilla.org/en-US/firefox/addon/youtube_downloader_webx/

where https://github.com/fent/node-ytdl-core is actually used.

However, I'm not sure this is the proper place for this discussion.

hassanzohdy commented 1 month ago

@warren-bank Thanks for the fix, works like a charm, I had to temporarily replace it hardcode until a new release to fix it but it did the trick.

hassanzohdy commented 1 month ago

@warren-bank I know it is not relevant to the issue, but do you have any solution for auto generating cookies as they seem to be expired after certain time?