def improve_name(song_name):
try:<EOL><INDENT>song_name = os.path.splitext(song_name)[<NUM_LIT:0>]<EOL><DEDENT>except IndexError:<EOL><INDENT>pass<EOL><DEDENT>song_name = song_name.partition('<STR_LIT>')[<NUM_LIT:0>]<EOL>song_name = '<STR_LIT>'.join(<EOL>map(lambda c: "<STR_LIT:U+0020>" if c in chars_filter else c, song_name))<EOL>song_name = re.sub('<STR_LIT:|>'.join(re.escape(key) for key in words_filter),<EOL>"<STR_LIT>", song_name, flags=re.IGNORECASE)<EOL>song_name = re.sub('<STR_LIT>', '<STR_LIT:U+0020>', song_name)<EOL>return song_name.strip()<EOL>
Improves file name by removing words such as HD, Official,etc
eg : Hey Jude (Official HD) lyrics -> Hey Jude
This helps in better searching of metadata since a spotify search of
'Hey Jude (Official HD) lyrics' fetches 0 results