mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-17 13:52:36 +00:00
Merge pull request #4831 from light94/master
Handling Connection Reset by Peer Error
This commit is contained in:
commit
6789defea9
|
@ -3,6 +3,9 @@
|
|||
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 @@ def real_download(self, filename, info_dict):
|
|||
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:
|
||||
|
|
Loading…
Reference in a new issue