diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2015-12-11 19:05:51 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2015-12-11 19:07:13 +0800 |
commit | ad30dc1e20979842b6b81ee3f6d2364c78acf5f1 (patch) | |
tree | 87b7fb8b18bec5ecca8ea29a9fdda56ecb4a6c05 | |
parent | ff51983e1563db08734e43a07d5671a517f99ef6 (diff) |
[vevo] Allow calling API without https
Not all proxies allow CONNECT
-rw-r--r-- | youtube_dl/extractor/vevo.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/youtube_dl/extractor/vevo.py b/youtube_dl/extractor/vevo.py index 38d382581..3e3b25da0 100644 --- a/youtube_dl/extractor/vevo.py +++ b/youtube_dl/extractor/vevo.py @@ -3,7 +3,10 @@ from __future__ import unicode_literals import re from .common import InfoExtractor -from ..compat import compat_etree_fromstring +from ..compat import ( + compat_etree_fromstring, + compat_urlparse, +) from ..utils import ( ExtractorError, int_or_none, @@ -162,14 +165,14 @@ class VevoIE(InfoExtractor): }) return formats - def _download_api_formats(self, video_id): + def _download_api_formats(self, video_id, video_url): if not self._oauth_token: self._downloader.report_warning( 'No oauth token available, skipping API HLS download') return [] - api_url = 'https://apiv2.vevo.com/video/%s/streams/hls?token=%s' % ( - video_id, self._oauth_token) + api_url = compat_urlparse.urljoin(video_url, '//apiv2.vevo.com/video/%s/streams/hls?token=%s' % ( + video_id, self._oauth_token)) api_data = self._download_json( api_url, video_id, note='Downloading HLS formats', @@ -214,7 +217,7 @@ class VevoIE(InfoExtractor): age_limit = None # Download via HLS API - formats.extend(self._download_api_formats(video_id)) + formats.extend(self._download_api_formats(video_id, url)) # Download SMIL smil_blocks = sorted(( |