From 9e6d7cdc990b03da2767aa2812ddd6fb468a487a Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Mon, 3 Dec 2018 21:47:57 +0530 Subject: [PATCH 1/2] Pass multiple tracks at once in --song argument --- spotdl/handle.py | 5 ++++- spotdl/spotdl.py | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/spotdl/handle.py b/spotdl/handle.py index 9d3cd6a..041f912 100644 --- a/spotdl/handle.py +++ b/spotdl/handle.py @@ -99,7 +99,10 @@ def get_arguments(raw_args=None, to_group=True, to_merge=True): group = parser.add_mutually_exclusive_group(required=True) group.add_argument( - "-s", "--song", help="download track by spotify link or name" + "-s", + "--song", + nargs='+', + help="download track by spotify link or name" ) group.add_argument("-l", "--list", help="download tracks from a file") group.add_argument( diff --git a/spotdl/spotdl.py b/spotdl/spotdl.py index 95987e4..e8aca5d 100644 --- a/spotdl/spotdl.py +++ b/spotdl/spotdl.py @@ -22,8 +22,9 @@ def debug_sys_info(): def match_args(): if const.args.song: - track_dl = downloader.Downloader(raw_song=const.args.song) - track_dl.download_single() + for track in const.args.song: + track_dl = downloader.Downloader(raw_song=track) + track_dl.download_single() elif const.args.list: if const.args.write_m3u: youtube_tools.generate_m3u(track_file=const.args.list) From 8d7dc762de890c77e9de1a45ae2bd63c068bc413 Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Tue, 4 Dec 2018 20:38:30 +0530 Subject: [PATCH 2/2] Add a changelog entry --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index e711ac5..e340b4a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added +- Ability to pass multiple tracks with `-s` option ([@ritiek](https://github.com/ritiek)) (#442) + ### Changed - Refactored core downloading module ([@ritiek](https://github.com/ritiek)) (#410)