A feature-rich command-line audio/video downloader
[downloader/http] Simplify
Sergey M․c3124c3085e6
diff --git a/youtube_dl/downloader/http.py b/youtube_dl/downloader/http.pyindex f796ee1135..0862e90bbb 100644--- a/youtube_dl/downloader/http.py+++ b/youtube_dl/downloader/http.py@@ -58,20 +58,16 @@ class HttpFD(FileDownloader):# Establish connectiontry:data = self.ydl.urlopen(request)-if resume_len > 0:content_range = data.headers.get('Content-Range')if content_range:content_range_m = re.search(r'bytes (\d+)-', content_range)- if content_range_m:- # Content-Range is correct - go on- if resume_len == int(content_range_m.group(1)):- break-+ # Content-Range is correct - go on+ if content_range_m and resume_len == int(content_range_m.group(1)):+ break# Content-Range is invalid - wipe the file and do entire redownloadresume_len = 0open_mode = 'wb'-breakexcept (compat_urllib_error.HTTPError, ) as err:if (err.code < 500 or err.code >= 600) and err.code != 416: