projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86b7c00
)
[downloader/http] Improve timeout detection when reading block of data (refs #10935)
author
Sergey M․
<dstftw@gmail.com>
Thu, 17 Sep 2020 20:32:54 +0000
(
03:32
+0700)
committer
Sergey M․
<dstftw@gmail.com>
Thu, 17 Sep 2020 20:32:54 +0000
(
03:32
+0700)
youtube_dl/downloader/http.py
patch
|
blob
|
history
diff --git
a/youtube_dl/downloader/http.py
b/youtube_dl/downloader/http.py
index e14ddce58d54db143770aba5147d7da2e6ef4733..6ef26548d23e2e04d8cec0cbbce733e330eee38d 100644
(file)
--- a/
youtube_dl/downloader/http.py
+++ b/
youtube_dl/downloader/http.py
@@
-238,9
+238,11
@@
class HttpFD(FileDownloader):
except socket.timeout as e:
retry(e)
except socket.error as e:
- if e.errno not in (errno.ECONNRESET, errno.ETIMEDOUT):
- raise
- retry(e)
+ # SSLError on python 2 (inherits socket.error) may have
+ # no errno set but this error message
+ if e.errno in (errno.ECONNRESET, errno.ETIMEDOUT) or getattr(e, 'message') == 'The read operation timed out':
+ retry(e)
+ raise
byte_counter += len(data_block)