From 961a3f3d8b2d88954ac3b63c0c36c4bf2d78533f Mon Sep 17 00:00:00 2001 From: Ehtisham Sabir Date: Tue, 5 Apr 2022 05:30:07 +0500 Subject: [PATCH] fixed added support for multiple video format. --- youtube_dl/extractor/wikimedia.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/wikimedia.py b/youtube_dl/extractor/wikimedia.py index b24410de2..e5b6c3273 100644 --- a/youtube_dl/extractor/wikimedia.py +++ b/youtube_dl/extractor/wikimedia.py @@ -1,5 +1,5 @@ from .common import InfoExtractor -from ..utils import get_element_by_class, compat_urlparse, clean_html +from ..utils import get_element_by_class, determine_ext, clean_html, KNOWN_EXTENSIONS import re @@ -33,8 +33,8 @@ class WikimediaIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) - - if not video_id.endswith('.webm'): + ext = determine_ext(url) + if not ext.lower() in KNOWN_EXTENSIONS: raise Exception("invalid video url") webpage = self._download_webpage(url, video_id) @@ -50,8 +50,8 @@ class WikimediaIE(InfoExtractor): info['url'] = video_url info['description'] = clean_html(description) - info['ext'] = 'webm' - info['id'] = video_id[:-5] + info['ext'] = ext + info['id'] = video_id.replace('.' + ext, "") info['title'] = self._og_search_title(webpage).replace("File:", "") info['license'] = licenze info['author'] = author