X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fdownloader%2Fhttp.py;h=25032ad4edcd5c8be6553a4c3778ea8c3c293682;hb=16e7711e22648027739096560914a976b8eea786;hp=8a1d578d54c6422df3b5ea768bb5a7547d52d32d;hpb=881e6a1f5c47a65348879f817ad833081e8c5ada;p=youtube-dl diff --git a/youtube_dl/downloader/http.py b/youtube_dl/downloader/http.py index 8a1d578d5..25032ad4e 100644 --- a/youtube_dl/downloader/http.py +++ b/youtube_dl/downloader/http.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals +import errno import os +import socket import time from .common import FileDownloader @@ -99,6 +101,11 @@ class HttpFD(FileDownloader): resume_len = 0 open_mode = 'wb' break + except socket.error as e: + if e.errno != errno.ECONNRESET: + # Connection reset is no problem, just retry + raise + # Retry count += 1 if count <= retries: