Skip to content

Proxying Requests

techy edited this page Apr 8, 2023 · 1 revision

If you're experiencing 429 errors whilst attempting to play music from YouTube, your IP address may be blocked by YouTube for sending too many requests. This is common on shared hosting like Heroku, where many services share the same IP address. To bypass this, you can utilise a HTTP proxy to forward your requests through a different IP address. Melody allows this through a config option.

This guide assumes you already have a proxy from a proxy provider, and is simply here to show you how to set it up with Melody.

To setup a proxy, get your proxy IP address, port number, username, and password ready. Next, open Melody's configuration file and scroll down to the proxy section. Set enable: true and set your connection URL. The connection URL must be formed in the following way: http://username:password@ipAddress:port. For example, http://username:[email protected]:8080. Set this as your connectionUrl in Melody's configuration file, then save your changes and restart the bot. Melody should now utilise your proxy assuming there is no more setup required on the proxy side, such as approving IP addresses.

It is worth noting that if you have experienced 429 errors in the past, it's not unlikely that you will experience them again. To minimise the chance of this happening, you should set a custom YouTube cookie in Melody's configuration file. Click here for more information about setting YouTube cookies.

Clone this wiki locally