Skip to content

Commit

Permalink
[youtube] Use localized title
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsir911 committed Mar 25, 2021
1 parent 8562218 commit 5adf366
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions youtube_dl/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,23 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
'url': 'https://www.youtube.com/watch?v=nGC3D_FkCmg',
'only_matching': True,
},
{
# Translated title
'url': 'UnIhRpIT7nc',
'info_dict': {
'id': 'UnIhRpIT7nc',
'ext': 'mp4',
'title': 'inabakumori - Lagtrain (Vo. Kaai Yuki) / 稲葉曇『ラグトレイン』Vo. 歌愛ユキ',
'description': 'md5:6effb0a4b19129bb07f404e0faf4caa4',
'upload_date': '20200716',
'uploader': '稲葉曇',
'uploader_id': 'UCNElM45JypxqAR73RoUQ10g',
'uploader_url': r're:https?://(?:www\.)?youtube\.com/channel/UCNElM45JypxqAR73RoUQ10g',
},
'params': {
'skip_download': True,
},
},
]
_formats = {
'5': {'ext': 'flv', 'width': 400, 'height': 240, 'acodec': 'mp3', 'abr': 64, 'vcodec': 'h263'},
Expand Down Expand Up @@ -1479,8 +1496,8 @@ def get_text(x):
player_response,
lambda x: x['microformat']['playerMicroformatRenderer'],
dict) or {}
video_title = video_details.get('title') \
or get_text(microformat.get('title')) \
video_title = get_text(microformat.get('title')) \
or video_details.get('title') \
or search_meta(['og:title', 'twitter:title', 'title'])
video_description = video_details.get('shortDescription')

Expand Down

0 comments on commit 5adf366

Please sign in to comment.