diff --git a/core/__pycache__/__init__.cpython-35.pyc b/core/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000..9bb4315 Binary files /dev/null and b/core/__pycache__/__init__.cpython-35.pyc differ diff --git a/core/__pycache__/metadata.cpython-35.pyc b/core/__pycache__/metadata.cpython-35.pyc new file mode 100644 index 0000000..e519fef Binary files /dev/null and b/core/__pycache__/metadata.cpython-35.pyc differ diff --git a/core/__pycache__/misc.cpython-35.pyc b/core/__pycache__/misc.cpython-35.pyc new file mode 100644 index 0000000..7ee8d8c Binary files /dev/null and b/core/__pycache__/misc.cpython-35.pyc differ diff --git a/core/misc.py b/core/misc.py index e698d0e..29e5aba 100644 --- a/core/misc.py +++ b/core/misc.py @@ -4,6 +4,11 @@ import os from slugify import slugify import spotipy.oauth2 as oauth2 +try: + from urllib2 import quote +except: + from urllib.request import quote + def input_link(links): while True: try: @@ -71,8 +76,7 @@ def generate_token(): return token def generate_search_URL(song): - URL = "https://www.youtube.com/results?sp=EgIQAQ%253D%253D&q=" + \ - song.replace(" ", "%20") + URL = "https://www.youtube.com/results?sp=EgIQAQ%253D%253D&q=" + quote(song) return URL def fix_encoding(query): diff --git a/spotdl.py b/spotdl.py index f37c13e..1ffe103 100644 --- a/spotdl.py +++ b/spotdl.py @@ -22,7 +22,7 @@ def generate_songname(raw_song): if misc.is_spotify(raw_song): tags = generate_metadata(raw_song) raw_song = tags['artists'][0]['name'] + ' - ' + tags['name'] - return raw_song + return misc.fix_encoding(raw_song) def generate_metadata(raw_song): if misc.is_spotify(raw_song):