X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fmtv.py;h=bc7f49ebbac86cda7aa1bb711076b783e24bfea8;hb=0d93378887bd527b1df04e6138b4bc41382dd48f;hp=f0e28e66ace8a5f59093eb2c9857968bcabf2dd7;hpb=0b201a3134e9b343e2791f2686f1a34f737007a4;p=youtube-dl diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py index f0e28e66a..bc7f49ebb 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 @@ -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'