From b5e11ba0a516fd7c7268d92183dce678291ba4cf Mon Sep 17 00:00:00 2001 From: slocum Date: Wed, 19 Apr 2017 22:42:08 +0200 Subject: [PATCH] fix determine_ext helper to check in KNOWN_EXTENSION --- youtube_dl/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 2340bc306..4ec786fcc 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1209,7 +1209,7 @@ def determine_ext(url, default_ext='unknown_video'): if url is None: return default_ext guess = url.partition('?')[0].rpartition('.')[2] - if re.match(r'^[A-Za-z0-9]+$', guess): + if re.match(r'^[A-Za-z0-9]+$', guess) and guess in KNOWN_EXTENSIONS: return guess # Try extract ext from URLs like http://example.com/foo/bar.mp4/?download elif guess.rstrip('/') in KNOWN_EXTENSIONS: