Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomly select an available IP address for --source-address (was: ipv6 selection) #9601

Open
Bryannn opened this issue May 25, 2016 · 20 comments
Open
Labels

Comments

@Bryannn
Copy link

@Bryannn Bryannn commented May 25, 2016

I see there is an option --force-ipv6 to use ipv6, does it choose a random ipv6 ip from my range ?

Thanks!

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 25, 2016

It chooses "the best match" IPv6 address on your device, which depends on your routing table.

@yan12125 yan12125 closed this May 25, 2016
@Bryannn
Copy link
Author

@Bryannn Bryannn commented May 25, 2016

I asked this because my ipv4 got blocked by YouTube for sending too many requests. So now I don't want it to use just 1 IP for downloading. If it chose a random IP out of the 256 IP's, would have been great. what do you exactly mean by best match. Could the best match keep changing each time it downloads? Thanks!

@Bryannn
Copy link
Author

@Bryannn Bryannn commented May 25, 2016

is there a way to know which ip is using ? cant see the used ip in the verbose mode

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 25, 2016

what do you exactly mean by best match.

See https://en.wikipedia.org/wiki/Routing_table.

Could the best match keep changing each time it downloads?

In general no.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 25, 2016

is there a way to know which ip is using ?

Add --call-home

And by the way, there are several "too many requests" reports and others' solution may help: #5138 and this FAQ entry

@Bryannn
Copy link
Author

@Bryannn Bryannn commented May 25, 2016

I really appreciate all your help. I've already read that post. I just have one last small question. So what if the best match IP gets blocked by YouTube for sending too many requests. Will it move to another IP from the range or just stop there? Thanks :)

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 25, 2016

It will just get blocked. youtube-dl is not intelligent enough to know the next unblocked IP :)

@Bryannn
Copy link
Author

@Bryannn Bryannn commented May 25, 2016

Can someone here help me change the code of youtube-dl so that it chooses a random IP each time from my ipv6 range instead of just using the best one. I could pay for it.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 25, 2016

FYI: you can use --source-address to force the IP to use. You may need to write a script to choose from available IPs and assign it to youtube-dl.

@Bryannn
Copy link
Author

@Bryannn Bryannn commented May 25, 2016

Yes that's what i'm talking about. If some here could help me do that.

@yan12125 yan12125 reopened this May 25, 2016
@yan12125 yan12125 changed the title ipv6 selection Randomly select an available IP address for --source-address (was: ipv6 selection) May 25, 2016
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 25, 2016

Here's an issue: usually YouTube blocks a subnet (an IP range) rather than a single IP, so random selection may not be useful.

@siddht4
Copy link

@siddht4 siddht4 commented May 25, 2016

what i suggest you guys is to rather connect it to a vpn or proxy to download the same, whatever you do your actual ip broadcasted will be that of the ISP which will not change. You might even get a warning to use your bandwidth fairly. Just report youtube that someone else on your network misused it and you are not involved . selecting random ipv6 will also be a security issue and misuse of the entire network.

My suggestion wait as youtube will white list you soon (unless it thinks it to be a ddos attack) , and use any proxy or vpn for a while

@Bryannn
Copy link
Author

@Bryannn Bryannn commented May 25, 2016

What I was thinking was. Let's say I'm sending 10K requests a day. If it chose the best IP then that IP is sending 10K requests and will get blocked super quick. But if it chose a random IP, then 10K requests get divided by 256 that is 39 request per IP. Hence it might not get blocked. So that is why I think this random selection will be a good feature.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 25, 2016

I guess YouTube (and possible many other websites) counts requests by subnets rather than individual IPs, as changing IP is so easy. The hypothesis is easy to test: once an IP is blocked, change to another IP with --source-address.

@Bryannn
Copy link
Author

@Bryannn Bryannn commented May 25, 2016

--source-address will work for ipv6?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 25, 2016

Yes. In fact --force-ipv6 is a shortcut to --source-address ::

@Bryannn
Copy link
Author

@Bryannn Bryannn commented May 25, 2016

Alright then. Thanks a lot for your help. Highly Appreciated!

@Bryannn
Copy link
Author

@Bryannn Bryannn commented May 25, 2016

Yan can we talk privately?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 26, 2016

You can drop me an email.

@Bryannn
Copy link
Author

@Bryannn Bryannn commented May 27, 2016

Hi Yan, I just sent you an email with this subject: Randomly select an available IP address for --source-address

Please check.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.