mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-12-29 05:11:21 +00:00
Use urllib2.quote() to fix encoding errors
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user