Skip to content

Commit

Permalink
[youtube] Use localized title & description
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsir911 committed Jan 29, 2022
1 parent 706dfe4 commit 59b1f83
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions yt_dlp/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -2078,6 +2078,25 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
'age_limit': 0,
'channel_follower_count': int
}, 'params': {'format': 'mhtml', 'skip_download': True}
},
{
# Translated title
'url': 'UnIhRpIT7nc',
'info_dict': {
'id': 'UnIhRpIT7nc',
'ext': 'mp4',
'title': 'inabakumori - Lagtrain (Vo. Kaai Yuki) / 稲葉曇『ラグトレイン』Vo. 歌愛ユキ',
# Translated description
'description': 'md5:d0865e57701acd99b4d89679a66e9632',
'upload_date': '20200716',
'uploader': '稲葉曇',
'channel': 'inabakumori',
'uploader_id': 'UCNElM45JypxqAR73RoUQ10g',
'uploader_url': r're:https?://(?:www\.)?youtube\.com/channel/UCNElM45JypxqAR73RoUQ10g',
},
'params': {
'skip_download': True,
},
}
]

Expand Down Expand Up @@ -3170,10 +3189,12 @@ def _real_extract(self, url):
player_responses, (..., 'microformat', 'playerMicroformatRenderer'),
expected_type=dict, default=[])
video_title = (
get_first(video_details, 'title')
or self._get_text(microformats, (..., 'title'))
self._get_text(microformats, (..., 'title'))
or get_first(video_details, 'title')
or search_meta(['og:title', 'twitter:title', 'title']))
video_description = get_first(video_details, 'shortDescription')
video_description = (
self._get_text(microformats, (..., 'description'))
or get_first(video_details, 'shortDescription'))

multifeed_metadata_list = get_first(
player_responses,
Expand Down

0 comments on commit 59b1f83

Please sign in to comment.