aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoru-spec-png <54671367+u-spec-png@users.noreply.github.com>2021-11-10 15:28:38 +0000
committerGitHub <noreply@github.com>2021-11-10 20:58:38 +0530
commitb47d236d724f7a129c7ed0792fb847eb12e6f8a5 (patch)
treec2abb8f73c49689a9d9dc3e5271541da94937719
parent9ebf3c6ab97c29b2d5872122e532bc98b93ad8b3 (diff)
downloadhypervideo-pre-b47d236d724f7a129c7ed0792fb847eb12e6f8a5.tar.lz
hypervideo-pre-b47d236d724f7a129c7ed0792fb847eb12e6f8a5.tar.xz
hypervideo-pre-b47d236d724f7a129c7ed0792fb847eb12e6f8a5.zip
[Tokentube] Fix description (#1578)
Authored by: u-spec-png
-rw-r--r--yt_dlp/extractor/tokentube.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/yt_dlp/extractor/tokentube.py b/yt_dlp/extractor/tokentube.py
index d6362117f..579623fed 100644
--- a/yt_dlp/extractor/tokentube.py
+++ b/yt_dlp/extractor/tokentube.py
@@ -6,7 +6,10 @@ import re
from .common import InfoExtractor
from ..utils import (
+ clean_html,
+ get_element_by_class,
parse_count,
+ remove_end,
unified_strdate,
js_to_json,
OnDemandPagedList,
@@ -35,7 +38,7 @@ class TokentubeIE(InfoExtractor):
'id': '3950239124',
'ext': 'mp4',
'title': 'Linux Ubuntu Studio perus käyttö',
- 'description': 'md5:854ff1dc732ff708976de2880ea32050',
+ 'description': 'md5:46077d0daaba1974f2dc381257f9d64c',
'uploader': 'jyrilehtonen',
'upload_date': '20210825',
},
@@ -45,7 +48,7 @@ class TokentubeIE(InfoExtractor):
'id': '3582463289',
'ext': 'mp4',
'title': 'Police for Freedom - toiminta aloitetaan Suomessa ❤️??',
- 'description': 'md5:cd92e620d7f5fa162e8410d0fc9a08be',
+ 'description': 'md5:37ebf1cb44264e0bf23ed98b337ee63e',
'uploader': 'Voitontie',
'upload_date': '20210428',
}
@@ -90,7 +93,10 @@ class TokentubeIE(InfoExtractor):
r'<a\s*class="place-left"[^>]+>(.+?)</a>',
webpage, 'uploader', fatal=False)
- description = self._html_search_meta('description', webpage)
+ description = (clean_html(get_element_by_class('p-d-txt', webpage))
+ or self._html_search_meta(('og:description', 'description', 'twitter:description'), webpage))
+
+ description = remove_end(description, 'Category')
self._sort_formats(formats)