From 42b0ca233da69291f63006b4f8be3abb94a73aca Mon Sep 17 00:00:00 2001 From: Ehtisham Sabir Date: Fri, 1 Apr 2022 05:30:38 +0500 Subject: [PATCH] cleaned html tags inside description. --- youtube_dl/extractor/wikimedia.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/wikimedia.py b/youtube_dl/extractor/wikimedia.py index ef2536d0d..8478dbbc4 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 +from ..utils import get_element_by_class, compat_urlparse, clean_html class WikimediaIE(InfoExtractor): @@ -21,9 +21,12 @@ class WikimediaIE(InfoExtractor): '2050 mit spekulativem Verlauf in der Prognose (ausgeprÀgtes Global-warming-Szenario ist ' 'dargestellt).English: Climate change, Temperature in history of Earth, Video of Terra X.', 'ext': 'webm', 'id': 'Die_Temperaturkurve_der_Erde_(ZDF,_Terra_X)_720p_HD_50FPS.webm', - 'title': 'File:Die Temperaturkurve der Erde (ZDF, Terra X) 720p HD 50FPS.webm - Wikimedia Commons', + 'title': 'Die Temperaturkurve der Erde (ZDF, Terra X) 720p HD 50FPS.webm - Wikimedia Commons', 'license': 'This file is licensed under the Creative Commons Attribution 4.0 International license.', - 'author': 'ZDF/Terra X/Gruppe 5/Luise Wagner, Jonas Sichert, Andreas Hougardy'} + 'author': 'ZDF/Terra X/Gruppe 5/Luise Wagner, Jonas Sichert, Andreas Hougardy', 'subtitles': {'nl': [ + {'ext': 'srt', + 'url': 'https://commons.wikimedia.org/w/api.php?action=timedtext&lang=nl&title=File' + '%3ADie_Temperaturkurve_der_Erde_%28ZDF%2C_Terra_X%29_720p_HD_50FPS.webm&trackformat=srt'}]}} def _real_extract(self, url): video_id = self._match_id(url) @@ -44,7 +47,7 @@ class WikimediaIE(InfoExtractor): subtitles = 'https://commons.wikimedia.org/w/api.php?action=timedtext&lang=nl&title=File%3A{}' \ '&trackformat=srt'.format(compat_urlparse.quote_plus(video_id)) info['url'] = video_url - info['description'] = description + info['description'] = clean_html(description) info['ext'] = 'webm' info['id'] = video_id info['title'] = self._og_search_title(webpage).replace("File:", "")