mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-12-08 20:39:08 +00:00
Implement --manual
This commit is contained in:
@@ -4,8 +4,8 @@ from spotdl import command_line
|
||||
import sys
|
||||
|
||||
def match_arguments(arguments):
|
||||
if arguments.tracks:
|
||||
for track in arguments.tracks:
|
||||
if arguments["song"]:
|
||||
for track in arguments["song"]:
|
||||
if track == "-":
|
||||
for line in sys.stdin:
|
||||
command_line.helpers.download_track(
|
||||
@@ -14,36 +14,36 @@ def match_arguments(arguments):
|
||||
)
|
||||
else:
|
||||
command_line.helpers.download_track(track, arguments)
|
||||
elif arguments.list:
|
||||
if arguments.write_m3u:
|
||||
elif arguments["list"]:
|
||||
if arguments["write_m3u"]:
|
||||
youtube_tools.generate_m3u(
|
||||
track_file=arguments.list
|
||||
track_file=arguments["list"]
|
||||
)
|
||||
else:
|
||||
list_download = {
|
||||
"sequential": command_line.helpers.download_tracks_from_file,
|
||||
"threaded" : command_line.helpers.download_tracks_from_file_threaded,
|
||||
}[arguments.processor]
|
||||
}[arguments["processor"]]
|
||||
|
||||
list_download(
|
||||
arguments.list,
|
||||
arguments["list"],
|
||||
arguments,
|
||||
)
|
||||
elif arguments.playlist:
|
||||
elif arguments["playlist"]:
|
||||
spotify_tools.write_playlist(
|
||||
playlist_url=arguments.playlist, text_file=arguments.write_to
|
||||
playlist_url=arguments["playlist"], text_file=arguments["write_to"]
|
||||
)
|
||||
elif arguments.album:
|
||||
elif arguments["album"]:
|
||||
spotify_tools.write_album(
|
||||
album_url=arguments.album, text_file=arguments.write_to
|
||||
album_url=arguments["album"], text_file=arguments["write_to"]
|
||||
)
|
||||
elif arguments.all_albums:
|
||||
spotify_tools.write_all_albums_from_artist(
|
||||
artist_url=arguments.all_albums, text_file=arguments.write_to
|
||||
artist_url=arguments["all_albums"], text_file=arguments["write_to"]
|
||||
)
|
||||
elif arguments.username:
|
||||
spotify_tools.write_user_playlist(
|
||||
username=arguments.username, text_file=arguments.write_to
|
||||
username=arguments["username"], text_file=arguments["write_to"]
|
||||
)
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ def main():
|
||||
# logzero.setup_default_logger(formatter=const._formatter, level=const.args.log_level)
|
||||
|
||||
try:
|
||||
match_arguments(arguments)
|
||||
match_arguments(arguments.__dict__)
|
||||
except KeyboardInterrupt as e:
|
||||
# log.exception(e)
|
||||
sys.exit(2)
|
||||
|
||||
Reference in New Issue
Block a user