mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-01-25 04:40:09 +09:00
fixed added support for multiple video format.
This commit is contained in:
parent
a10f613d62
commit
961a3f3d8b
@ -1,5 +1,5 @@
|
|||||||
from .common import InfoExtractor
|
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
|
import re
|
||||||
|
|
||||||
|
|
||||||
@ -33,8 +33,8 @@ class WikimediaIE(InfoExtractor):
|
|||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
ext = determine_ext(url)
|
||||||
if not video_id.endswith('.webm'):
|
if not ext.lower() in KNOWN_EXTENSIONS:
|
||||||
raise Exception("invalid video url")
|
raise Exception("invalid video url")
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
@ -50,8 +50,8 @@ class WikimediaIE(InfoExtractor):
|
|||||||
|
|
||||||
info['url'] = video_url
|
info['url'] = video_url
|
||||||
info['description'] = clean_html(description)
|
info['description'] = clean_html(description)
|
||||||
info['ext'] = 'webm'
|
info['ext'] = ext
|
||||||
info['id'] = video_id[:-5]
|
info['id'] = video_id.replace('.' + ext, "")
|
||||||
info['title'] = self._og_search_title(webpage).replace("File:", "")
|
info['title'] = self._og_search_title(webpage).replace("File:", "")
|
||||||
info['license'] = licenze
|
info['license'] = licenze
|
||||||
info['author'] = author
|
info['author'] = author
|
||||||
|
Loading…
Reference in New Issue
Block a user