1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-05-15 16:55:43 -05:00

Apply suggestions from code review

Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
4ft35t 2025-02-23 20:17:59 +08:00 committed by GitHub
parent 6475dc5407
commit 4f1e049644
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -106,7 +106,9 @@ def _parse_video_info(self, video_info, video_id=None):
**traverse_obj(video_info, {
'id': (('id', 'id_str', 'mid'), {str_or_none}),
'display_id': ('mblogid', {str_or_none}),
'title': ('page_info', 'media_info', ('video_title', 'kol_title', 'name'), {lambda x: x.replace('\n', ' ')}, {truncate_string(left=50)}, {str}, filter),
'title': ('page_info', 'media_info', ('video_title', 'kol_title', 'name'),
{lambda x: x.replace('\n', ' ')}, {truncate_string(left=50)}, filter),
'alt_title': ('page_info', 'media_info', ('video_title', 'kol_title', 'name'), {str}, filter),
'description': ('text_raw', {str}),
'duration': ('page_info', 'media_info', 'duration', {int_or_none}),
'timestamp': ('page_info', 'media_info', 'video_publish_time', {int_or_none}),