serenity-rs / songbird

An async Rust library for the Discord voice API
ISC License
381 stars 108 forks source link

Handle YouTube rate limitation #240

Open 0xFFFFFFFFFFFFFFFFFF opened 1 month ago

0xFFFFFFFFFFFFFFFFFF commented 1 month ago

I am wondering how to handle YouTubes rate limitation. Given I have an API key for YouTube, how can I authorize the yt-dlp requests? I couldn't find any documentation or example regarding that issue.

vicky5124 commented 1 month ago

While yt-dlp does have support to authorise requests with arguments such as --cookies, -u / --username, -p / --password, and others, songbird does not provide a way to use these arguments, as the ones used are hard coded.

For now, you can use an IPv6 block tunnel such as HE TunnelBroker with some clever routing and a proxy to send every YouTube request through that IPv6 block. The website explains how to set up the tunnel in many different systems; just make sure to use the /48 block rather than the /64 one.