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:
Rutger Rauws
2017-07-11 19:44:56 +02:00
committed by Ritiek Malhotra
parent 75be7285c0
commit d28ff08a69
3 changed files with 44 additions and 28 deletions

View File

@@ -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():