Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shawn Webb
youtube-dl
Commits
86b7c00a
Unverified
Commit
86b7c00a
authored
Sep 17, 2020
by
Ori Avtalion
Committed by
GitHub
Sep 18, 2020
Browse files
[downloader/http] Retry download when urlopen times out (#26603) (refs #10935)
parent
e8c5d40b
Changes
1
Hide whitespace changes
Inline
Side-by-side
youtube_dl/downloader/http.py
View file @
86b7c00a
...
...
@@ -106,7 +106,12 @@ class HttpFD(FileDownloader):
set_range
(
request
,
range_start
,
range_end
)
# Establish connection
try
:
ctx
.
data
=
self
.
ydl
.
urlopen
(
request
)
try
:
ctx
.
data
=
self
.
ydl
.
urlopen
(
request
)
except
(
compat_urllib_error
.
URLError
,
)
as
err
:
if
isinstance
(
err
.
reason
,
socket
.
timeout
):
raise
RetryDownload
(
err
)
raise
err
# When trying to resume, Content-Range HTTP header of response has to be checked
# to match the value of requested Range HTTP header. This is due to a webservers
# that don't support resuming and serve a whole file with no Content-Range
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment