mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Fix encoding errors
This commit is contained in:
@@ -16,7 +16,7 @@ def song(input_song, output_song, avconv=False, verbose=False):
|
||||
else:
|
||||
exit_code = convert_with_ffmpeg(input_song, output_song, verbose)
|
||||
return exit_code
|
||||
return None
|
||||
return 0
|
||||
|
||||
|
||||
def convert_with_avconv(input_song, output_song, verbose):
|
||||
|
||||
@@ -110,7 +110,7 @@ def generate_token():
|
||||
def generate_search_url(song):
|
||||
"""Generate YouTube search URL for the given song."""
|
||||
# urllib2.quote() encodes URL with special characters
|
||||
url = "https://www.youtube.com/results?sp=EgIQAQ%253D%253D&q={0}".format(
|
||||
url = u"https://www.youtube.com/results?sp=EgIQAQ%253D%253D&q={0}".format(
|
||||
quote(song))
|
||||
return url
|
||||
|
||||
@@ -135,7 +135,7 @@ def filter_path(path):
|
||||
os.makedirs(path)
|
||||
for temp in os.listdir(path):
|
||||
if temp.endswith('.temp'):
|
||||
os.remove('{0}/{1}'.format(path, temp))
|
||||
os.remove(u'{0}/{1}'.format(path, temp))
|
||||
|
||||
|
||||
def grace_quit():
|
||||
|
||||
Reference in New Issue
Block a user