Errno 101 network is unreachable python

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

[Youtube] urlopen error [Errno 101] Network is unreachable #22812

[Youtube] urlopen error [Errno 101] Network is unreachable #22812

Comments

Checklist

  • I’m reporting a broken site support
  • I’ve verified that I’m running youtube-dl version 2019.10.22
  • 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 issues including closed ones

Verbose log

[debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['-x', '-k', '-v', 'tahOuqFS8kM'] [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2019.10.22 [debug] Python version 3.6.8 (CPython) - Linux-4.15.0-65-generic-x86_64-with-Ubuntu-18.04-bionic [debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6 [debug] Proxy map: <> [youtube] tahOuqFS8kM: Downloading webpage [youtube] tahOuqFS8kM: Downloading video info webpage [youtube] signature length 106, html5 player vflYUXieR [youtube] signature length 102, html5 player vflYUXieR [youtube] signature length 106, html5 player vflYUXieR [youtube] signature length 102, html5 player vflYUXieR [youtube] signature length 106, html5 player vflYUXieR [youtube] signature length 102, html5 player vflYUXieR [youtube] signature length 102, html5 player vflYUXieR [youtube] signature length 106, html5 player vflYUXieR [youtube] tahOuqFS8kM: Downloading MPD manifest [debug] Default format spec: bestvideo+bestaudio/best [debug] Invoking downloader on 'https://manifest.googlevideo.com/api/manifest/dash/expire/1571823669/ei/1cuvXeXuLsCz3LUP4tCHgAg/ip/122.167.86.184/id/b5a84ebaa152f243/source/youtube/requiressl/yes/playback_host/r2---sn-ci5gup-cags.googlevideo.com/mm/31%2C29/mn/sn-ci5gup-cags%2Csn-ci5gup-h55l/ms/au%2Crdu/mv/m/mvi/1/pl/19/tx/23756554/txs/23756553%2C23756554/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/995000/mt/1571801986/fvip/14/fexp/23842630/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Ctx%2Ctxs%2Chfr%2Cas%2Citag/sig/ALgxI2wwRQIhAOsLhBh_IAFP9xv2UB7hiUe3bAPeePD9jQeIiR6MkigJAiBpy56-MaNEuiadv31XpF81yD03P9psSKJfJtPwTWxZrQ%3D%3D/lsparams/playback_host%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/AHylml4wRQIgaX4UwjRWAX0IGhcJVF9VesqXqWxA1OmfAHGPJYvh6ZQCIQCkddu5W_Rq8Qr9ppZ_0yZ0zSAehZUiGaibTuEYkIzL_Q%3D%3D' [dashsegments] Total fragments: 1057 [download] Destination: Marshall Rosenberg The Dynamics Of Empathy-tahOuqFS8kM.f242.webm [download] 2.6% of ~16.14MiB at 5.91MiB/s ETA 27:21ERROR: unable to download video data: Traceback (most recent call last): File "/usr/lib/python3.6/urllib/request.py", line 1318, in do_open encode_chunked=req.has_header('Transfer-encoding')) File "/usr/lib/python3.6/http/client.py", line 1254, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.6/http/client.py", line 1300, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.6/http/client.py", line 1249, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.6/http/client.py", line 1036, in _send_output self.send(msg) File "/usr/lib/python3.6/http/client.py", line 974, in send self.connect() File "/usr/lib/python3.6/http/client.py", line 1407, in connect super().connect() File "/usr/lib/python3.6/http/client.py", line 946, in connect (self.host,self.port), self.timeout, self.source_address) File "/usr/lib/python3.6/socket.py", line 724, in create_connection raise err File "/usr/lib/python3.6/socket.py", line 713, in create_connection sock.connect(sa) OSError: [Errno 101] Network is unreachable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/satishb/.local/share/virtualenvs/NVC_Workshop-wqQhCiFs/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 1919, in process_info partial_success = dl(fname, new_info) File "/home/satishb/.local/share/virtualenvs/NVC_Workshop-wqQhCiFs/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 1864, in dl return fd.download(name, info) File "/home/satishb/.local/share/virtualenvs/NVC_Workshop-wqQhCiFs/lib/python3.6/site-packages/youtube_dl/downloader/common.py", line 366, in download return self.real_download(filename, info_dict) File "/home/satishb/.local/share/virtualenvs/NVC_Workshop-wqQhCiFs/lib/python3.6/site-packages/youtube_dl/downloader/dash.py", line 48, in real_download success, frag_content = self._download_fragment(ctx, fragment_url, info_dict) File "/home/satishb/.local/share/virtualenvs/NVC_Workshop-wqQhCiFs/lib/python3.6/site-packages/youtube_dl/downloader/fragment.py", line 102, in _download_fragment 'http_headers': headers or info_dict.get('http_headers'), File "/home/satishb/.local/share/virtualenvs/NVC_Workshop-wqQhCiFs/lib/python3.6/site-packages/youtube_dl/downloader/common.py", line 366, in download return self.real_download(filename, info_dict) File "/home/satishb/.local/share/virtualenvs/NVC_Workshop-wqQhCiFs/lib/python3.6/site-packages/youtube_dl/downloader/http.py", line 341, in real_download establish_connection() File "/home/satishb/.local/share/virtualenvs/NVC_Workshop-wqQhCiFs/lib/python3.6/site-packages/youtube_dl/downloader/http.py", line 109, in establish_connection ctx.data = self.ydl.urlopen(request) File "/home/satishb/.local/share/virtualenvs/NVC_Workshop-wqQhCiFs/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 2237, in urlopen return self._opener.open(req, timeout=self._socket_timeout) File "/usr/lib/python3.6/urllib/request.py", line 532, in open response = meth(req, response) File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python3.6/urllib/request.py", line 564, in error result = self._call_chain(*args) File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain result = func(*args) File "/usr/lib/python3.6/urllib/request.py", line 756, in http_error_302 return self.parent.open(new, timeout=req.timeout) File "/usr/lib/python3.6/urllib/request.py", line 526, in open response = self._open(req, data) File "/usr/lib/python3.6/urllib/request.py", line 544, in _open '_open', req) File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain result = func(*args) File "/home/satishb/.local/share/virtualenvs/NVC_Workshop-wqQhCiFs/lib/python3.6/site-packages/youtube_dl/utils.py", line 2724, in https_open req, **kwargs) File "/usr/lib/python3.6/urllib/request.py", line 1320, in do_open raise URLError(err) urllib.error.URLError:

Description

I am able to download most files from youtube but it consistently fails for certain files with the error

Читайте также:  Размер ссылки в php

The file is generally partially downloaded and if I try downloading them in a while loop it continues to download but consistently fails after maybe 1-2% progress irrespective of the file size.
Or it can get stuck at the initial stage say
Resuming download at byte 40814096

The failure consistently happens only with certain files. I have seen this occurring from past 1 month or so. It was present even when I tried with 2019.08.02 and continues with the present version too.

E.gs of failing files are:
tahOuqFS8kM
l7TONauJGfc

My current work around is to download it with the following script

while true; do youtube-dl -x -k tahOuqFS8kM && break echo "Retrying" done 

The text was updated successfully, but these errors were encountered:

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

OSError: [Errno 101] Network is unreachable #37

OSError: [Errno 101] Network is unreachable #37

Comments

Hello I’m getting error OSError: [Errno 101] Network is unreachable when I run below code

from wsdiscovery.discovery import ThreadedWSDiscovery as WSDiscovery wsd = WSDiscovery() wsd.start() services = wsd.searchServices() Exception in thread Thread-1: Traceback (most recent call last): File "/home/ashish/anaconda3/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/home/ashish/.local/lib/python3.6/site-packages/wsdiscovery/threaded.py", line 150, in run self._sendPendingMessages() File "/home/ashish/.local/lib/python3.6/site-packages/wsdiscovery/threaded.py", line 226, in _sendPendingMessages self._sendMsg(msg) File "/home/ashish/.local/lib/python3.6/site-packages/wsdiscovery/threaded.py", line 213, in _sendMsg sock.sendto(data, (msg.getAddr(), msg.getPort())) OSError: [Errno 101] Network is unreachable

but if I try to search directly like below, I’m able to get response

import socket import struct import sys message = '\nurn:uuid:5eb52dba-1787-49f8-ab8b-4567327b23c6http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousurn:schemas-xmlsoap-org:ws:2005:04:discoveryhttp://schemas.xmlsoap.org/ws/2005/04/discovery/Probedn:NetworkVideoTransmitter' multicast_group = ('239.255.255.250', 3702) # Create the datagram socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Set a timeout so the socket does not block indefinitely when trying # to receive data. sock.settimeout(5) # Set the time-to-live for messages to 1 so they do not go past the # local network segment. #ttl = struct.pack('b', 1) #sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, ttl) try: # Send data to the multicast group print(multicast_group) sent = sock.sendto(message.encode("UTF-8"), multicast_group) # Look for responses from all recipients while True: print ('waiting to receive',file=sys.stderr) try: data, server = sock.recvfrom(2048) except socket.timeout: print ('timed out, no more responses',file=sys.stderr) break else: print ('received "%s" from %s' % (data, server),file=sys.stderr) finally: print ('closing socket',file=sys.stderr) sock.close()
waiting to receive received "b'uuid:31d79a54-e297-2d18-6a57-f259d96f9b2furn:uuid:5eb52dba-1787-49f8-ab8b-4567327b23c6http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymoushttp://schemas.xmlsoap.org/ws/2005/04/discovery/ProbeMatchesurn:uuid:ddaf00c9-33a2-63e9-e4ae-3ac651e662c5dn:NetworkVideoTransmitter tds:Deviceonvif://www.onvif.org/Profile/Streaming onvif://www.onvif.org/location/country/china onvif://www.onvif.org/type/video_encoder onvif://www.onvif.org/name/IP-Camera onvif://www.onvif.org/hardware/HI3518C onvif://www.onvif.org/Profile/T onvif://www.onvif.org/Profile/G onvif://www.onvif.org/Profile/C onvif://www.onvif.org/Profile/Ahttp://172.20.10.4:10001/onvif/device_service1'" from ('192.168.1.106', 3702) waiting to receive timed out, no more responses closing socket

The text was updated successfully, but these errors were encountered:

Источник

Оцените статью