youtube-downloader
youtube-downloader copied to clipboard
How to specify the IP address to use
Is there an easy way to specifiy the IP address to use for requests?
My server has 8 IPs and it would be useful to be able to use all of them to avoid the 'Too many requests' problem.
If this functionality doesn't exist, perhaps it could be considered for inclusion in future versions (if it isn't already been!)
it's there already, and I use it myself all the time.
You might also want to use a separate cookies file and a different user-agent for each of those IPs, so as to appear entirely unique to YouTube
Is there a way for me to set the IP address with the CURLOPT_INTERFACE option?
Thanks for your advice about user-agents and cookie files.
Is there a way for me to set the IP address with the CURLOPT_INTERFACE option?
Thanks for your advice about user-agents and cookie files.
For that, you could just modify Browser.php
file:
https://github.com/Athlon1600/youtube-downloader/blob/master/src/Browser.php
and add something like:
public function usingCustomIP($ip)
{
$this->options[CURLOPT_INTERFACE] = $ip;
return $this;
}
and then use it:
$youtube = new YouTubeDownloader();
$youtube->getBrowser()->usingCustomIP("YOUR_IP_GOES_HERE");