diff options
author | Tom-Oliver Heidel <github@tom-oliver.eu> | 2020-11-30 02:20:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-30 02:20:18 +0100 |
commit | ef5a4db06cb7667dc555f0dc1982de2c5258eb37 (patch) | |
tree | c947a547303ccf19483e83ea9d3ea77c74b5b7a8 /youtube_dlc/downloader/http.py | |
parent | 93201d50aa5e0bce0ecf6941cd6f9ea6c9ef86a5 (diff) | |
parent | c78b936af4366259605e3e706bdeb5e173bf3d9b (diff) | |
download | hypervideo-pre-ef5a4db06cb7667dc555f0dc1982de2c5258eb37.tar.lz hypervideo-pre-ef5a4db06cb7667dc555f0dc1982de2c5258eb37.tar.xz hypervideo-pre-ef5a4db06cb7667dc555f0dc1982de2c5258eb37.zip |
Merge pull request #245 from pukkandan/merge-main
Merge youtube-dl and fix Youtube Feeds
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 |