aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/mtv.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-04-25 20:22:20 +0600
committerSergey M․ <dstftw@gmail.com>2015-04-25 20:22:20 +0600
commita542e372ab3dc36d2320ba588d5bfa8011e1df5a (patch)
treec68e9528453e524263f7c37039b1740ac819c3c7 /youtube_dl/extractor/mtv.py
parent92995e6265d2287ee67af869e36a56a05fb86a06 (diff)
[mtv] Stuff lang into info URL when available
Diffstat (limited to 'youtube_dl/extractor/mtv.py')
-rw-r--r--youtube_dl/extractor/mtv.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py
index 4430b3416..b48fac5e3 100644
--- a/youtube_dl/extractor/mtv.py
+++ b/youtube_dl/extractor/mtv.py
@@ -25,6 +25,7 @@ def _media_xml_tag(tag):
class MTVServicesInfoExtractor(InfoExtractor):
_MOBILE_TEMPLATE = None
+ _LANG = None
@staticmethod
def _id_from_uri(uri):
@@ -169,8 +170,12 @@ class MTVServicesInfoExtractor(InfoExtractor):
video_id = self._id_from_uri(uri)
feed_url = self._get_feed_url(uri)
data = compat_urllib_parse.urlencode({'uri': uri})
+ info_url = feed_url + '?'
+ if self._LANG:
+ info_url += 'lang=%s&' % self._LANG
+ info_url += data
idoc = self._download_xml(
- feed_url + '?' + data, video_id,
+ info_url, video_id,
'Downloading info', transform_source=fix_xml_ampersands)
return self.playlist_result(
[self._get_video_info(item) for item in idoc.findall('.//item')])