X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fmtv.py;h=f6f31bfdc53c6cb0685cfb74e9cc59b56269d77f;hb=31ef0ff03832e642fad3a6b416abb4b1c668764c;hp=af889a8afeb9f50169ceb3f59d9dee83c27fee65;hpb=6562df768d6af708a5aab6ed4964b250925e42b4;p=youtube-dl diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py index af889a8af..f6f31bfdc 100644 --- a/youtube_dl/extractor/mtv.py +++ b/youtube_dl/extractor/mtv.py @@ -89,6 +89,7 @@ class MTVServicesInfoExtractor(InfoExtractor): title = title_el.text if title is None: raise ExtractorError('Could not find video title') + title = title.strip() return { 'title': title, @@ -111,9 +112,12 @@ class MTVServicesInfoExtractor(InfoExtractor): title = url_basename(url) webpage = self._download_webpage(url, title) try: - # the url is in the format http://media.mtvnservices.com/fb/{mgid}.swf - fb_url = self._og_search_video_url(webpage) - mgid = url_basename(fb_url).rpartition('.')[0] + # the url can be http://media.mtvnservices.com/fb/{mgid}.swf + # or http://media.mtvnservices.com/{mgid} + og_url = self._og_search_video_url(webpage) + mgid = url_basename(og_url) + if mgid.endswith('.swf'): + mgid = mgid[:-4] except RegexNotFoundError: mgid = self._search_regex(r'data-mgid="(.*?)"', webpage, u'mgid') return self._get_videos_info(mgid) @@ -180,7 +184,7 @@ class MTVIggyIE(MTVServicesInfoExtractor): 'info_dict': { 'id': '984696', 'ext': 'mp4', - 'title': 'Short', + 'title': 'Arcade Fire: Behind the Scenes at the Biggest Music Experiment Yet', } } _FEED_URL = 'http://all.mtvworldverticals.com/feed-xml/'