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

Regarding use of specific source address IP #32728

Closed
6 tasks done
nikunjmishra1998 opened this issue Feb 22, 2024 · 4 comments
Closed
6 tasks done

Regarding use of specific source address IP #32728

nikunjmishra1998 opened this issue Feb 22, 2024 · 4 comments

Comments

@nikunjmishra1998
Copy link

nikunjmishra1998 commented Feb 22, 2024

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2021.12.17
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

sudo youtube-dl -v --source-address 45.77.52.190 https://www.youtube.com/watch?v=T2hoQ9Hf8ws
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--source-address', '45.77.52.190', 'https://www.youtube.com/watch?v=T2hoQ9Hf8ws']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.10.12 (CPython) - Linux-5.15.0-94-generic-x86_64-with-glibc2.35
[debug] exe versions: ffmpeg 6.1-static, ffprobe 6.1-static
[debug] Proxy map: {}
[youtube] T2hoQ9Hf8ws: Downloading webpage
WARNING: Unable to download webpage: <urlopen error [Errno 99] Cannot assign requested address>
[youtube] T2hoQ9Hf8ws: Downloading API JSON
ERROR: Unable to download API page: <urlopen error [Errno 99] Cannot assign requested address> (caused by URLError(OSError(99, 'Cannot assign requested address')))
File "/usr/local/lib/python3.10/dist-packages/youtube_dl/extractor/common.py", line 634, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/lib/python3.10/dist-packages/youtube_dl/YoutubeDL.py", line 2288, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python3.10/urllib/request.py", line 519, in open
response = self._open(req, data)
File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.10/dist-packages/youtube_dl/utils.py", line 2735, in https_open
return self.do_open(functools.partial(
File "/usr/lib/python3.10/urllib/request.py", line 1351, in do_open
raise URLError(err)

Description

I have tried to install latest version of youtube-dl and want to use specific IPV4 with the command. I hit the above command mentioned in verbose log but then also received error.

@nikunjmishra1998
Copy link
Author

FYI 45.77.52.190 is my static IP address.

@dirkf
Copy link
Contributor

dirkf commented Feb 22, 2024

The specified address has to be one that's actually defined in your system, not just a random a.b.c.d (apart from anything else, responses wouldn't be able to reach you if that weren't so). Additional considerations apply if the program is running in a container (eg, Docker network_mode: host, as I read).

You say that 45.77.52.190 is the static address of your system, so there must be some reason why you'd need to specify it in --source-address ....

  • If it's the WAN IP of your NAT-ed system, you would need port forwarding instead.

  • Review this SO question.

  • Try a wget command on some external Web page with --bind address 45.77.52.190 to check that there isn't a Python issue.

@dirkf
Copy link
Contributor

dirkf commented Feb 22, 2024

Also, use the nightly build (#30839).

@dirkf
Copy link
Contributor

dirkf commented Mar 4, 2024

@nikunjmishra1998

@dirkf dirkf closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants