diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2016-06-08 20:47:39 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2016-06-08 20:47:39 +0800 |
commit | 22a0a95247c30b346592b6e3d464776bceb3b934 (patch) | |
tree | 1b317c9a33e1c2cc019b7e45bfcde318622a11ed /youtube_dl/extractor | |
parent | 50ce1c331c736d8219f3bf631ff069b9aecc48e3 (diff) |
[theplatform] Some NBC videos require an additional cookie
Related: #9578
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/theplatform.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/extractor/theplatform.py b/youtube_dl/extractor/theplatform.py index 02dbef913..5793ec6ef 100644 --- a/youtube_dl/extractor/theplatform.py +++ b/youtube_dl/extractor/theplatform.py @@ -14,11 +14,13 @@ from ..compat import ( compat_urllib_parse_urlparse, ) from ..utils import ( + determine_ext, ExtractorError, float_or_none, int_or_none, sanitized_Request, unsmuggle_url, + update_url_query, xpath_with_ns, mimetype2ext, find_xpath_attr, @@ -48,6 +50,12 @@ class ThePlatformBaseIE(OnceIE): if OnceIE.suitable(_format['url']): formats.extend(self._extract_once_formats(_format['url'])) else: + media_url = _format['url'] + if determine_ext(media_url) == 'm3u8': + hdnea2 = self._get_cookies(media_url).get('hdnea2') + if hdnea2: + _format['url'] = update_url_query(media_url, {'hdnea3': hdnea2.value}) + formats.append(_format) subtitles = self._parse_smil_subtitles(meta, default_ns) |