mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-27 00:43:06 +00:00
[youtube] Video categories added to metadata
This commit is contained in:
parent
a2d5a4ee64
commit
ec8deefc27
1 changed files with 9 additions and 0 deletions
|
@ -1141,6 +1141,14 @@ def _real_extract(self, url):
|
||||||
upload_date = ' '.join(re.sub(r'[/,-]', r' ', mobj.group(1)).split())
|
upload_date = ' '.join(re.sub(r'[/,-]', r' ', mobj.group(1)).split())
|
||||||
upload_date = unified_strdate(upload_date)
|
upload_date = unified_strdate(upload_date)
|
||||||
|
|
||||||
|
|
||||||
|
video_categories = []
|
||||||
|
# categories
|
||||||
|
m_cat_container = get_element_by_id("eow-category", video_webpage)
|
||||||
|
if m_cat_container:
|
||||||
|
video_categories = re.findall(r'<a[^<]+>(.*?)</a>',
|
||||||
|
m_cat_container, re.DOTALL)
|
||||||
|
|
||||||
# description
|
# description
|
||||||
video_description = get_element_by_id("eow-description", video_webpage)
|
video_description = get_element_by_id("eow-description", video_webpage)
|
||||||
if video_description:
|
if video_description:
|
||||||
|
@ -1347,6 +1355,7 @@ def decrypt_sig(mobj):
|
||||||
'title': video_title,
|
'title': video_title,
|
||||||
'thumbnail': video_thumbnail,
|
'thumbnail': video_thumbnail,
|
||||||
'description': video_description,
|
'description': video_description,
|
||||||
|
'categories': video_categories,
|
||||||
'subtitles': video_subtitles,
|
'subtitles': video_subtitles,
|
||||||
'duration': video_duration,
|
'duration': video_duration,
|
||||||
'age_limit': 18 if age_gate else 0,
|
'age_limit': 18 if age_gate else 0,
|
||||||
|
|
Loading…
Reference in a new issue