diff options
Diffstat (limited to 'youtube_dlc')
-rw-r--r-- | youtube_dlc/extractor/mtv.py | 6 | ||||
-rw-r--r-- | youtube_dlc/extractor/nick.py | 20 | ||||
-rw-r--r-- | youtube_dlc/extractor/youtube.py | 2 |
3 files changed, 12 insertions, 16 deletions
diff --git a/youtube_dlc/extractor/mtv.py b/youtube_dlc/extractor/mtv.py index cc4b0114a..6b3658397 100644 --- a/youtube_dlc/extractor/mtv.py +++ b/youtube_dlc/extractor/mtv.py @@ -306,7 +306,11 @@ class MTVServicesInfoExtractor(InfoExtractor): window_data = self._parse_json(self._search_regex( r'(?s)window.__DATA__ = (?P<json>{.+});', webpage, 'JSON Window Data', default=None, fatal=False, group='json'), title, fatal=False) - mgid = window_data['children'][4]['children'][0]['props']['media']['video']['config']['uri'] + main_container = None + for i in range(len(window_data['children'])): + if window_data['children'][i]['type'] == 'MainContainer': + main_container = window_data['children'][i] + mgid = main_container['children'][0]['props']['media']['video']['config']['uri'] except (KeyError, IndexError, TypeError): pass diff --git a/youtube_dlc/extractor/nick.py b/youtube_dlc/extractor/nick.py index 04b98f7bd..7e981b8c1 100644 --- a/youtube_dlc/extractor/nick.py +++ b/youtube_dlc/extractor/nick.py @@ -176,21 +176,11 @@ class NickDeIE(MTVServicesInfoExtractor): 'only_matching': True, }] - def _extract_mrss_url(self, webpage, host): - return update_url_query(self._search_regex( - r'data-mrss=(["\'])(?P<url>http.+?)\1', webpage, 'mrss url', group='url'), - {'siteKey': host}) - - def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') - host = mobj.group('host') - - webpage = self._download_webpage(url, video_id) - - mrss_url = self._extract_mrss_url(webpage, host) - - return self._get_videos_info_from_url(mrss_url, video_id) + def _get_feed_url(self, uri, url=None): + video_id = self._id_from_uri(uri) + config = self._download_json( + 'http://media.mtvnservices.com/pmt/e1/access/index.html?uri=%s&configtype=edge&ref=%s' % (uri, url), video_id) + return self._remove_template_parameter(config['feedWithQueryParams']) class NickNightIE(NickDeIE): diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py index fbfc11563..bfc79e07b 100644 --- a/youtube_dlc/extractor/youtube.py +++ b/youtube_dlc/extractor/youtube.py @@ -100,6 +100,8 @@ class YoutubeBaseInfoExtractor(InfoExtractor): if username is None: if self._LOGIN_REQUIRED and self._downloader.params.get('cookiefile') is None: raise ExtractorError('No login info available, needed for using %s.' % self.IE_NAME, expected=True) + if self._downloader.params.get('cookiefile') and False: # TODO remove 'and False' later - too many people using outdated cookies and open issues, remind them. + self.to_screen('[Cookies] Reminder - Make sure to always use up to date cookies!') return True login_page = self._download_webpage( |