mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-04 00:37:06 -05:00 
			
		
		
		
	Handling Connection Reset by Peer Error
This commit is contained in:
		@@ -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:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user