1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-12-22 14:37:55 +01:00

Merge pull request #4831 from light94/master

Handling Connection Reset by Peer Error
This commit is contained in:
Philipp Hagemeister 2015-02-02 12:03:28 +01:00
commit 6789defea9

View File

@ -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: