diff options
author | Tom-Oliver Heidel <github@tom-oliver.eu> | 2020-11-30 02:51:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-30 02:51:41 +0100 |
commit | b662fc8d2033c615ffbdd3b51123b446c03255e8 (patch) | |
tree | 3d32dc25a663f4e61fc28860acda67c7a425cb7a /youtube_dlc/downloader/http.py | |
parent | 8924ddc3eec4c03c6776673d0d5e823dc5445549 (diff) | |
parent | 929576bb9e4aa31f0516f1437d2ae762afdd9f2c (diff) | |
download | hypervideo-pre-b662fc8d2033c615ffbdd3b51123b446c03255e8.tar.lz hypervideo-pre-b662fc8d2033c615ffbdd3b51123b446c03255e8.tar.xz hypervideo-pre-b662fc8d2033c615ffbdd3b51123b446c03255e8.zip |
Merge branch 'master' into gedi
Diffstat (limited to 'youtube_dlc/downloader/http.py')
-rw-r--r-- | youtube_dlc/downloader/http.py | 4 |
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 |