]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[utils] Improve determine_ext (Closes #7593)
authorSergey M․ <dstftw@gmail.com>
Sun, 22 Nov 2015 00:29:39 +0000 (06:29 +0600)
committerSergey M․ <dstftw@gmail.com>
Sun, 22 Nov 2015 00:29:39 +0000 (06:29 +0600)
youtube_dl/utils.py

index bff59eb73320ae611249efce55993873c8d8055a..7dab60bb859b3ad52ea3e52b079e7087d7165099 100644 (file)
@@ -922,7 +922,7 @@ def unified_strdate(date_str, day_first=True):
 def determine_ext(url, default_ext='unknown_video'):
     if url is None:
         return default_ext
-    guess = url.partition('?')[0].rpartition('.')[2]
+    guess = url.partition('?')[0].rpartition('.')[2].rstrip('/')
     if re.match(r'^[A-Za-z0-9]+$', guess):
         return guess
     else: