1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-14 09:47:15 +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:
dyn888 2016-01-29 13:44:21 +01:00
parent 055f417278
commit f9e04e932f

View File

@ -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] + '...'