mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
Handling Connection Reset by Peer Error
This commit is contained in:
parent
e41b1f7385
commit
e77d2975af
1 changed files with 8 additions and 0 deletions
|
@ -3,6 +3,9 @@
|
||||||
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 @@ def real_download(self, filename, info_dict):
|
||||||
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…
Reference in a new issue