X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/beb6d38e0a0a4091007847a27022bf08c59f971c..eeb287ed58128659e5de200bba1e0762fb972560:/youtube_dl/extractor/mtv.py?ds=inline diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py index af9490c..bc7f49e 100644 --- a/youtube_dl/extractor/mtv.py +++ b/youtube_dl/extractor/mtv.py @@ -2,10 +2,13 @@ from __future__ import unicode_literals import re -from .common import InfoExtractor -from ..utils import ( +from .subtitles import SubtitlesInfoExtractor +from ..compat import ( compat_urllib_parse, compat_urllib_request, + compat_str, +) +from ..utils import ( ExtractorError, find_xpath_attr, fix_xml_ampersands, @@ -20,7 +23,7 @@ def _media_xml_tag(tag): return '{http://search.yahoo.com/mrss/}%s' % tag -class MTVServicesInfoExtractor(InfoExtractor): +class MTVServicesInfoExtractor(SubtitlesInfoExtractor): _MOBILE_TEMPLATE = None @staticmethod @@ -33,7 +36,7 @@ class MTVServicesInfoExtractor(InfoExtractor): m = re.match(r'^rtmpe?://.*?/(?Pgsp\..+?/.*)$', rtmp_video_url) if not m: return rtmp_video_url - base = 'http://mtvnmobile.vo.llnwd.net/kip0/_pxn=1+_pxI0=Ripod-h264+_pxL0=undefined+_pxM0=+_pxK=18639+_pxE=mp4/44620/mtvnorigin/' + base = 'http://viacommtvstrmfs.fplive.net/' return base + m.group('finalid') def _get_feed_url(self, uri): @@ -51,42 +54,67 @@ class MTVServicesInfoExtractor(InfoExtractor): webpage_url = self._MOBILE_TEMPLATE % mtvn_id req = compat_urllib_request.Request(webpage_url) # Otherwise we get a webpage that would execute some javascript - req.add_header('Youtubedl-user-agent', 'curl/7') + req.add_header('User-Agent', 'curl/7') webpage = self._download_webpage(req, mtvn_id, - 'Downloading mobile page') + 'Downloading mobile page') metrics_url = unescapeHTML(self._search_regex(r'