diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-09-20 11:45:19 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-09-20 11:45:19 +0600 |
commit | 393ca8c94d1adb1490b23265370ce69043b92546 (patch) | |
tree | f847157c4af9c47467969e43f001d48dd53ef353 /youtube_dl/extractor | |
parent | f817adc4689a2064fcab733d6aebf83fd0e2cff7 (diff) |
[arte:+7] Look for json vp url in iframe (Closes #6895)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/arte.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/youtube_dl/extractor/arte.py b/youtube_dl/extractor/arte.py index 76de24477..9ecb6786c 100644 --- a/youtube_dl/extractor/arte.py +++ b/youtube_dl/extractor/arte.py @@ -4,6 +4,10 @@ from __future__ import unicode_literals import re from .common import InfoExtractor +from ..compat import ( + compat_parse_qs, + compat_urllib_parse_urlparse, +) from ..utils import ( find_xpath_attr, unified_strdate, @@ -77,7 +81,13 @@ class ArteTVPlus7IE(InfoExtractor): def _extract_from_webpage(self, webpage, video_id, lang): json_url = self._html_search_regex( [r'arte_vp_url=["\'](.*?)["\']', r'data-url=["\']([^"]+)["\']'], - webpage, 'json vp url') + webpage, 'json vp url', default=None) + if not json_url: + iframe_url = self._html_search_regex( + r'<iframe[^>]+src=(["\'])(?P<url>.+\bjson_url=.+?)\1', + webpage, 'iframe url', group='iframe url') + json_url = compat_parse_qs( + compat_urllib_parse_urlparse(iframe_url).query)['json_url'][0] return self._extract_from_json_url(json_url, video_id, lang) def _extract_from_json_url(self, json_url, video_id, lang): |