mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Use a Spotify song's title instead of a YouTube video's title (#99)
* Use a Spotify song's title instead of a YouTube video's title * Added fallback to YouTube title if song's metadata cannot be fetched from Spotify * Removed duplicate generation of metadata * Fix test cases that use download_song(..) and generate_filename(..) * Fix conflicting function * Fix conflict in check_exists() * Fix filenames for non spotify songs * Fix some bugs * Some documentation changes * Remove unnecessary determine_filename()
This commit is contained in:
committed by
Ritiek Malhotra
parent
75be7285c0
commit
d28ff08a69
@@ -77,13 +77,13 @@ def is_spotify(raw_song):
|
||||
return False
|
||||
|
||||
|
||||
def generate_filename(title):
|
||||
def sanitize_title(title):
|
||||
"""Generate filename of the song to be downloaded."""
|
||||
title = title.replace(' ', '_')
|
||||
|
||||
# slugify removes any special characters
|
||||
filename = slugify(title, ok='-_()[]{}', lower=False)
|
||||
return filename
|
||||
title = slugify(title, ok='-_()[]{}', lower=False)
|
||||
return title
|
||||
|
||||
|
||||
def generate_token():
|
||||
|
||||
Reference in New Issue
Block a user