Explorar o código

[mtvservices] Fix mediagen URL generation

Sergey M․ %!s(int64=10) %!d(string=hai) anos
pai
achega
56f447be9f
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      youtube_dl/extractor/mtv.py

+ 2 - 1
youtube_dl/extractor/mtv.py

@@ -114,7 +114,8 @@ class MTVServicesInfoExtractor(InfoExtractor):
         # Remove the templates, like &device={device}
         mediagen_url = re.sub(r'&[^=]*?={.*?}(?=(&|$))', '', mediagen_url)
         if 'acceptMethods' not in mediagen_url:
-            mediagen_url += '&acceptMethods=fms'
+            mediagen_url += '&' if '?' in mediagen_url else '?'
+            mediagen_url += 'acceptMethods=fms'
 
         mediagen_doc = self._download_xml(mediagen_url, video_id,
                                           'Downloading video urls')