aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-07-14 14:02:04 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-07-14 14:02:04 +0200
commit300fcad8a663fc0bebde541c00535b931ad1af67 (patch)
tree09913d82222bb117056095abd9bcdc4766839da1
parentf7e025958a6b7315bd090e758037d6f19c82825e (diff)
MTVIE: fix xml tags in the media namespace (python2.6)
-rw-r--r--youtube_dl/extractor/mtv.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py
index 65c8c2d52..45dbc007d 100644
--- a/youtube_dl/extractor/mtv.py
+++ b/youtube_dl/extractor/mtv.py
@@ -7,6 +7,8 @@ from ..utils import (
ExtractorError,
)
+def _media_xml_tag(tag):
+ return '{http://search.yahoo.com/mrss/}%s' % tag
class MTVIE(InfoExtractor):
_VALID_URL = r'^https?://(?:www\.)?mtv\.com/videos/.+?/(?P<videoid>[0-9]+)/[^/]+$'
@@ -71,8 +73,7 @@ class MTVIE(InfoExtractor):
uri = itemdoc.find('guid').text
video_id = self._id_from_uri(uri)
self.report_extraction(video_id)
- media_namespace = {'media': 'http://search.yahoo.com/mrss/'}
- mediagen_url = itemdoc.find('media:group/media:content', media_namespace).attrib['url']
+ mediagen_url = itemdoc.find('%s/%s' % (_media_xml_tag('group'), _media_xml_tag('content'))).attrib['url']
if 'acceptMethods' not in mediagen_url:
mediagen_url += '&acceptMethods=fms'
mediagen_page = self._download_webpage(mediagen_url, video_id,