diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2014-03-07 16:41:42 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2014-03-07 16:41:42 +0100 |
commit | 22ff5d21056f5639eef06d30392f3b8750734c26 (patch) | |
tree | 9c866eed269557d42493a7376bb98400ea29365c /youtube_dl/downloader/http.py | |
parent | 136db7881b4ed820182697f0f5bd7c114aa70f46 (diff) |
[http] Use the `YoutubeDL.urlopen` method
Diffstat (limited to 'youtube_dl/downloader/http.py')
-rw-r--r-- | youtube_dl/downloader/http.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/downloader/http.py b/youtube_dl/downloader/http.py index 240ecb606..348097dab 100644 --- a/youtube_dl/downloader/http.py +++ b/youtube_dl/downloader/http.py @@ -49,7 +49,7 @@ class HttpFD(FileDownloader): while count <= retries: # Establish connection try: - data = compat_urllib_request.urlopen(request) + data = self.ydl.urlopen(request) break except (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: |