mirror of
https://github.com/l1ving/youtube-dl
synced 2026-06-07 16:33:31 +08:00
Remove extra spaces & trim title
This removes extra spaces in title, also removes any leading and trailing whitespace, before title size check and after title is copied to 'fulltitle'. Repeated spaces can waste space in a filename, leading spaces can mess up sorting, and make file handling more difficult.
This commit is contained in:
@@ -1423,6 +1423,7 @@ class YoutubeDL(object):
|
||||
raise MaxDownloadsReached()
|
||||
|
||||
info_dict['fulltitle'] = info_dict['title']
|
||||
info_dict['title'] = " ".join(info_dict['title'].split())
|
||||
if len(info_dict['title']) > 200:
|
||||
info_dict['title'] = info_dict['title'][:197] + '...'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user