Browse Source

Merge pull request #4831 from light94/master

Handling Connection Reset by Peer Error
totalwebcasting
Philipp Hagemeister 10 years ago
parent
commit
6789defea9
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      youtube_dl/downloader/http.py

+ 8
- 0
youtube_dl/downloader/http.py View File

@ -3,6 +3,9 @@ from __future__ import unicode_literals
import os import os
import time import time
from socket import error as SocketError
import errno
from .common import FileDownloader from .common import FileDownloader
from ..compat import ( from ..compat import (
compat_urllib_request, compat_urllib_request,
@ -99,6 +102,11 @@ class HttpFD(FileDownloader):
resume_len = 0 resume_len = 0
open_mode = 'wb' open_mode = 'wb'
break break
except SocketError as e:
if e.errno != errno.ECONNRESET:
raise # Not error we are looking for
pass
# Retry # Retry
count += 1 count += 1
if count <= retries: if count <= retries:


Loading…
Cancel
Save