1
0
mirror of https://github.com/l1ving/youtube-dl synced 2026-05-19 01:39:52 +08:00

[extractor/xtube] add upload_date extracted from thumbnail URL

This commit is contained in:
Todd Vierling
2020-05-25 21:44:14 -04:00
Unverified
parent 2791e80b60
commit 63f03a2290
+4
View File
@@ -99,6 +99,9 @@ class XTubeIE(InfoExtractor):
thumbnail = config.get('poster')
duration = int_or_none(config.get('duration'))
sources = config.get('sources') or config.get('format')
upload_date = self._search_regex(
r'videos/(\d{6}/\d\d)/',
thumbnail, 'upload_date', default='NA').replace('/', '')
if not isinstance(sources, dict):
sources = self._parse_json(self._search_regex(
@@ -152,6 +155,7 @@ class XTubeIE(InfoExtractor):
'comment_count': comment_count,
'age_limit': 18,
'formats': formats,
'upload_date': upload_date,
}