diff options
author | Random User <rndusr@posteo.de> | 2017-03-25 21:36:59 +0100 |
---|---|---|
committer | Random User <rndusr@posteo.de> | 2017-03-25 21:36:59 +0100 |
commit | 4f06c1c9fcbfbc74b81b5fa89a616914b5ce5aad (patch) | |
tree | a51b702e001d350b908780a119f76d8ea706d511 /youtube_dl/extractor/miomio.py | |
parent | c73e330e7adc9c0c15ac51aeea8fbb7dad95351a (diff) | |
parent | 942b44a0525f677924c660bcb00902d705d91fc2 (diff) |
Merge branch 'master' of github.com-rndusr:rg3/youtube-dl into fix/str-item-assignment
Diffstat (limited to 'youtube_dl/extractor/miomio.py')
-rw-r--r-- | youtube_dl/extractor/miomio.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/youtube_dl/extractor/miomio.py b/youtube_dl/extractor/miomio.py index ec1b4c4fe..40f72d66f 100644 --- a/youtube_dl/extractor/miomio.py +++ b/youtube_dl/extractor/miomio.py @@ -51,6 +51,7 @@ class MioMioIE(InfoExtractor): 'ext': 'mp4', 'title': 'マツコの知らない世界【劇的進化SP!ビニール傘&冷凍食品2016】 1_2 - 16 05 31', }, + 'skip': 'Unable to load videos', }] def _extract_mioplayer(self, webpage, video_id, title, http_headers): @@ -94,9 +95,18 @@ class MioMioIE(InfoExtractor): return entries + def _download_chinese_webpage(self, *args, **kwargs): + # Requests with English locales return garbage + headers = { + 'Accept-Language': 'zh-TW,en-US;q=0.7,en;q=0.3', + } + kwargs.setdefault('headers', {}).update(headers) + return self._download_webpage(*args, **kwargs) + def _real_extract(self, url): video_id = self._match_id(url) - webpage = self._download_webpage(url, video_id) + webpage = self._download_chinese_webpage( + url, video_id) title = self._html_search_meta( 'description', webpage, 'title', fatal=True) @@ -106,7 +116,7 @@ class MioMioIE(InfoExtractor): if '_h5' in mioplayer_path: player_url = compat_urlparse.urljoin(url, mioplayer_path) - player_webpage = self._download_webpage( + player_webpage = self._download_chinese_webpage( player_url, video_id, note='Downloading player webpage', headers={'Referer': url}) entries = self._parse_html5_media_entries(player_url, player_webpage, video_id) |