[brightcove] Add the extraction of the url from generic
[youtube-dl] / youtube_dl / extractor / mtv.py
index 001a576a8710fb45a7c3e4d4dfc9f634af39dc87..24a79ae130e7ca52983ae9846532f643eda60085 100644 (file)
@@ -26,6 +26,7 @@ class MTVIE(InfoExtractor):
             },
         },
         {
+            u'add_ie': ['Vevo'],
             u'url': u'http://www.mtv.com/videos/taylor-swift/916187/everything-has-changed-ft-ed-sheeran.jhtml',
             u'file': u'USCJY1331283.mp4',
             u'md5': u'73b4e7fcadd88929292fe52c3ced8caf',
@@ -80,6 +81,8 @@ class MTVIE(InfoExtractor):
         video_id = self._id_from_uri(uri)
         self.report_extraction(video_id)
         mediagen_url = itemdoc.find('%s/%s' % (_media_xml_tag('group'), _media_xml_tag('content'))).attrib['url']
+        # Remove the templates, like &device={device}
+        mediagen_url = re.sub(r'&[^=]*?={.*?}(?=(&|$))', u'', mediagen_url)
         if 'acceptMethods' not in mediagen_url:
             mediagen_url += '&acceptMethods=fms'
         mediagen_page = self._download_webpage(mediagen_url, video_id,
@@ -87,7 +90,7 @@ class MTVIE(InfoExtractor):
 
         description_node = itemdoc.find('description')
         if description_node is not None:
-            description = description_node.text
+            description = description_node.text.strip()
         else:
             description = None