Test YouTube track title

This commit is contained in:
Ritiek
2017-06-25 00:31:57 +05:30
parent 10c3c66483
commit 0dfaf183b5
4 changed files with 24 additions and 18 deletions

View File

@@ -101,10 +101,10 @@ def generate_token():
token = creds.get_access_token()
return token
def generate_search_URL(song):
def generate_search_url(song):
# urllib2.quote() encodes URL with special characters
URL = "https://www.youtube.com/results?sp=EgIQAQ%253D%253D&q=" + quote(song)
return URL
url = "https://www.youtube.com/results?sp=EgIQAQ%253D%253D&q=" + quote(song)
return url
# fix encoding issues in python2
def fix_encoding(query):