ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.28k stars 10.03k forks source link

--source-address IP is not working #5995

Open corneliousfazal opened 9 years ago

corneliousfazal commented 9 years ago

python youtube-dl -g -vC --source-address 192.168.1.3 Y0eErsVNK-I [debug] System config: [] [debug] User config: [] [debug] Command-line args: ['-g', '-vC', '--source-address', '192.168.1.3', 'Y0e ErsVNK-I'] [debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252 [debug] youtube-dl version 2015.06.15 [debug] Python version 3.4.3 - Windows-8-6.2.9200 [debug] exe versions: none [debug] Proxy map: {} Traceback (most recent call last): File "C:\Python34\lib\urllib\request.py", line 1182, in do_open h.request(req.get_method(), req.selector, req.data, headers) File "C:\Python34\lib\http\client.py", line 1088, in request self._send_request(method, url, body, headers) File "C:\Python34\lib\http\client.py", line 1126, in _send_request self.endheaders(body) File "C:\Python34\lib\http\client.py", line 1084, in endheaders self._send_output(message_body) File "C:\Python34\lib\http\client.py", line 922, in _send_output self.send(msg) File "C:\Python34\lib\http\client.py", line 857, in send self.connect() File "C:\Python34\lib\http\client.py", line 1223, in connect super().connect() File "C:\Python34\lib\http\client.py", line 834, in connect self.timeout, self.source_address) File "C:\Python34\lib\socket.py", line 512, in create_connection raise err File "C:\Python34\lib\socket.py", line 503, in create_connection sock.connect(sa) OSError: [WinError 10051] A socket operation was attempted to an unreachable net work

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main "main", mod_spec) File "C:\Python34\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "youtube-dlmain.py", line 19, in File "youtube-dl\youtube_dlinit.py", line 405, in main File "youtube-dl\youtube_dlinit.py", line 372, in _real_main File "youtube-dl\youtube_dl\YoutubeDL.py", line 333, in init File "youtube-dl\youtube_dl\YoutubeDL.py", line 1787, in print_debug_header File "youtube-dl\youtube_dl\YoutubeDL.py", line 1730, in urlopen File "C:\Python34\lib\urllib\request.py", line 463, in open response = self._open(req, data) File "C:\Python34\lib\urllib\request.py", line 481, in _open '_open', req) File "C:\Python34\lib\urllib\request.py", line 441, in _call_chain result = func(*args) File "youtube-dl\youtube_dl\utils.py", line 713, in https_open File "C:\Python34\lib\urllib\request.py", line 1184, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [WinError 10051] A socket operation was at tempted to an unreachable network>

yan12125 commented 9 years ago

I guess it's a routing problem. Can you watch https://www.youtube.com/watch?v=Y0eErsVNK-I in browsers if all network interfaces other than the one with IP 192.168.1.3 are disabled?

corneliousfazal commented 9 years ago

192.168.1.3 is dummy ip address i am running youtube-dl on a web server a want to change the ip address to client ip address using --source-address. But it giving me above error no issue with regular video but with dashed videos

yan12125 commented 9 years ago

Sorry I don't quite understand your network settings. Did you mean you're running youtube-dl on one computer (server) and 192.168.1.3 is an IP address of another device (client)?

no issue with regular video but with dashed videos

It's strange. From the error logs, the problem is from the 'call home' step, which occurs before any actual downloading.

shiyue66 commented 4 years ago

Hi @corneliousfazal , I had the exact same issue with you using youtube dl. I am running youtube-dl and extracting url in my django server, and try to open that url in my Android app. Did you solve this problem? Thanks!