mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
@@ -66,7 +66,7 @@ def is_youtube(raw_song):
|
|||||||
return status
|
return status
|
||||||
|
|
||||||
|
|
||||||
def format_string(string_format, tags, slugification=False):
|
def format_string(string_format, tags, slugification=False, force_spaces=False):
|
||||||
""" Generate a string of the format '[artist] - [song]' for the given spotify song. """
|
""" Generate a string of the format '[artist] - [song]' for the given spotify song. """
|
||||||
format_tags = dict(formats)
|
format_tags = dict(formats)
|
||||||
format_tags[0] = tags['name']
|
format_tags[0] = tags['name']
|
||||||
@@ -94,7 +94,7 @@ def format_string(string_format, tags, slugification=False):
|
|||||||
string_format = string_format.replace(format_tag,
|
string_format = string_format.replace(format_tag,
|
||||||
format_tags[x])
|
format_tags[x])
|
||||||
|
|
||||||
if const.args.no_spaces:
|
if const.args.no_spaces and not force_spaces:
|
||||||
string_format = string_format.replace(' ', '_')
|
string_format = string_format.replace(' ', '_')
|
||||||
|
|
||||||
return string_format
|
return string_format
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class GenerateYouTubeURL:
|
|||||||
self.search_query = raw_song
|
self.search_query = raw_song
|
||||||
else:
|
else:
|
||||||
self.search_query = internals.format_string(const.args.search_format,
|
self.search_query = internals.format_string(const.args.search_format,
|
||||||
meta_tags)
|
meta_tags, force_spaces=True)
|
||||||
|
|
||||||
def _best_match(self, videos):
|
def _best_match(self, videos):
|
||||||
""" Select the best matching video from a list of videos. """
|
""" Select the best matching video from a list of videos. """
|
||||||
|
|||||||
Reference in New Issue
Block a user