Fix encoding errors

This commit is contained in:
Ritiek
2017-06-29 12:34:27 +05:30
parent e20be5d97e
commit 3009fb8583
4 changed files with 18 additions and 18 deletions

View File

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

View File

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