mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2026-01-09 19:05:56 +00:00
Sort search results by viewcount
This commit is contained in:
@@ -101,7 +101,7 @@ def generate_token():
|
|||||||
def generate_search_url(song):
|
def generate_search_url(song):
|
||||||
"""Generate YouTube search URL for the given song."""
|
"""Generate YouTube search URL for the given song."""
|
||||||
# urllib.request.quote() encodes URL with special characters
|
# urllib.request.quote() encodes URL with special characters
|
||||||
url = u"https://www.youtube.com/results?sp=EgIQAQ%253D%253D&q={0}".format(
|
url = u"https://www.youtube.com/results?q={0}&sp=CAMSAhABUBQ%253D".format(
|
||||||
quote(song))
|
quote(song))
|
||||||
return url
|
return url
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ def filter_path(path):
|
|||||||
def grace_quit():
|
def grace_quit():
|
||||||
print('\n\nExiting.')
|
print('\n\nExiting.')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
def get_sec(time_str):
|
def get_sec(time_str):
|
||||||
v = time_str.split(':', 3)
|
v = time_str.split(':', 3)
|
||||||
v.reverse()
|
v.reverse()
|
||||||
|
|||||||
Reference in New Issue
Block a user