From 9ac238faf78db02a3572fec5deb2218ce1490dd5 Mon Sep 17 00:00:00 2001 From: Rafael Moraes <50295204+glomatico@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:36:58 -0300 Subject: [PATCH] adjust `read_urls_as_txt` handler --- spotify_web_downloader/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spotify_web_downloader/cli.py b/spotify_web_downloader/cli.py index 820fff9..cbed099 100644 --- a/spotify_web_downloader/cli.py +++ b/spotify_web_downloader/cli.py @@ -402,7 +402,11 @@ def main( return error_count = 0 if read_urls_as_txt: - urls = [url.strip() for url in Path(urls[0]).read_text().splitlines()] + _urls = [] + for url in urls: + if Path(url).exists(): + _urls.extend(Path(url).read_text(encoding="utf-8").splitlines()) + urls = _urls for url_index, url in enumerate(urls, start=1): url_progress = f"URL {url_index}/{len(urls)}" logger.info(f'({url_progress}) Checking "{url}"')