diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2015-02-02 12:03:28 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2015-02-02 12:03:28 +0100 |
commit | 6789defea9b1fc7ff631e9da8a281504167ced10 (patch) | |
tree | a52b52326108384630e87be240460d7a3dd9b7b0 /youtube_dl | |
parent | acf2a6e97b53b191edf3f92af1eae300633ea2d9 (diff) | |
parent | e77d2975afda3750104c90b7c0012c02a2a00b10 (diff) |
Merge pull request #4831 from light94/master
Handling Connection Reset by Peer Error
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/downloader/http.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/downloader/http.py b/youtube_dl/downloader/http.py index 8a1d578d5..9b023c5c1 100644 --- a/youtube_dl/downloader/http.py +++ b/youtube_dl/downloader/http.py @@ -3,6 +3,9 @@ from __future__ import unicode_literals import os import time +from socket import error as SocketError +import errno + from .common import FileDownloader from ..compat import ( compat_urllib_request, @@ -99,6 +102,11 @@ class HttpFD(FileDownloader): resume_len = 0 open_mode = 'wb' break + + except SocketError as e: + if e.errno != errno.ECONNRESET: + raise # Not error we are looking for + pass # Retry count += 1 if count <= retries: |