aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/downloader/http.py
diff options
context:
space:
mode:
authorTom-Oliver Heidel <github@tom-oliver.eu>2020-11-30 02:32:58 +0100
committerGitHub <noreply@github.com>2020-11-30 02:32:58 +0100
commit9693a3477377bedbdc9170575a36ca6b00167ee2 (patch)
tree6a0262bc708d0af0bf5c8f362f81e978f51a543e /youtube_dlc/downloader/http.py
parent711bd5d362a1a7bec312e23a0f39deff2b3bf8f1 (diff)
parent6a03f4f2a8c5c9274cce3d6168b501578d332bae (diff)
downloadhypervideo-pre-9693a3477377bedbdc9170575a36ca6b00167ee2.tar.lz
hypervideo-pre-9693a3477377bedbdc9170575a36ca6b00167ee2.tar.xz
hypervideo-pre-9693a3477377bedbdc9170575a36ca6b00167ee2.zip
Merge branch 'master' into master
Diffstat (limited to 'youtube_dlc/downloader/http.py')
-rw-r--r--youtube_dlc/downloader/http.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dlc/downloader/http.py b/youtube_dlc/downloader/http.py
index 96379caf1..d8ac41dcc 100644
--- a/youtube_dlc/downloader/http.py
+++ b/youtube_dlc/downloader/http.py
@@ -109,7 +109,9 @@ class HttpFD(FileDownloader):
try:
ctx.data = self.ydl.urlopen(request)
except (compat_urllib_error.URLError, ) as err:
- if isinstance(err.reason, socket.timeout):
+ # reason may not be available, e.g. for urllib2.HTTPError on python 2.6
+ reason = getattr(err, 'reason', None)
+ if isinstance(reason, socket.timeout):
raise RetryDownload(err)
raise err
# When trying to resume, Content-Range HTTP header of response has to be checked