From: Sergey M․ Date: Sun, 22 Nov 2015 00:29:39 +0000 (+0600) Subject: [utils] Improve determine_ext (Closes #7593) X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=3e12bc583af9d5abf5f144ed6e092c59f4b83fdf;p=youtube-dl [utils] Improve determine_ext (Closes #7593) --- diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index bff59eb73..7dab60bb8 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -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: