A feature-rich command-line audio/video downloader
[http] Use the `YoutubeDL.urlopen` method
Jaime Marquínez Ferrándiz22ff5d21056f
diff --git a/youtube_dl/downloader/http.py b/youtube_dl/downloader/http.pyindex 240ecb606e..348097dab0 100644--- a/youtube_dl/downloader/http.py+++ b/youtube_dl/downloader/http.py@@ -49,7 +49,7 @@ class HttpFD(FileDownloader):while count <= retries:# Establish connectiontry:- data = compat_urllib_request.urlopen(request)+ data = self.ydl.urlopen(request)breakexcept (compat_urllib_error.HTTPError, ) as err:if (err.code < 500 or err.code >= 600) and err.code != 416:@@ -59,7 +59,7 @@ class HttpFD(FileDownloader):# Unable to resume (requested range not satisfiable)try:# Open the connection again without the range header- data = compat_urllib_request.urlopen(basic_request)+ data = self.ydl.urlopen(basic_request)content_length = data.info()['Content-Length']except (compat_urllib_error.HTTPError, ) as err:if err.code < 500 or err.code >= 600: