X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fmtv.py;h=5447b6c0cab098b895eda0e9f2b3b266fb65a7b0;hb=a4ff6c4762fd01b606d54a2962530c753d4c52ec;hp=af889a8afeb9f50169ceb3f59d9dee83c27fee65;hpb=6562df768d6af708a5aab6ed4964b250925e42b4;p=youtube-dl.git diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py index af889a8af..5447b6c0c 100644 --- a/youtube_dl/extractor/mtv.py +++ b/youtube_dl/extractor/mtv.py @@ -86,9 +86,13 @@ class MTVServicesInfoExtractor(InfoExtractor): title_el = itemdoc.find('.//{http://search.yahoo.com/mrss/}title') if title_el is None: title_el = itemdoc.find('.//title') + if title_el.text is None: + title_el = None + title = title_el.text if title is None: raise ExtractorError('Could not find video title') + title = title.strip() return { 'title': title, @@ -111,11 +115,16 @@ 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') + mgid = self._search_regex( + [r'data-mgid="(.*?)"', r'swfobject.embedSWF\(".*?(mgid:.*?)"'], + webpage, u'mgid') return self._get_videos_info(mgid) @@ -180,7 +189,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/'