Parcourir la source

[downloader/dash] Improve 'combine_url' (fixes #6341)

In some videos the base_url already ends with '/'.
Jaime Marquínez Ferrándiz il y a 10 ans
Parent
commit
59db9f8018
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      youtube_dl/downloader/dash.py

+ 1 - 1
youtube_dl/downloader/dash.py

@@ -37,7 +37,7 @@ class DashSegmentsFD(FileDownloader):
         def combine_url(base_url, target_url):
             if re.match(r'^https?://', target_url):
                 return target_url
-            return '%s/%s' % (base_url, target_url)
+            return '%s%s%s' % (base_url, '' if base_url.endswith('/') else '/', target_url)
 
         with open(tmpfilename, 'wb') as outf:
             append_url_to_file(