X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fdownloader%2Fhttp.py;h=49170cf9d47634602efe7832b235e4a751e25817;hb=12832049170e8b3bd457706f49e8e09de12a368c;hp=8a1d578d54c6422df3b5ea768bb5a7547d52d32d;hpb=d4f64cabf4ede444b390bb71b90ad4103ce572c0;p=youtube-dl diff --git a/youtube_dl/downloader/http.py b/youtube_dl/downloader/http.py index 8a1d578d5..49170cf9d 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: + # Connection reset is no problem, just retry + raise + # Retry count += 1 if count <= retries: