diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index e61ca0e..d4d7115 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -18,7 +18,7 @@ jobs: - name: Install dependencies run: python -m pip install -U setuptools wheel build - name: Build a binary wheel and a source tarball - run: python setup.py sdist bdist_wheel + run: python -m build . - name: Publish distribution to TestPyPI uses: pypa/gh-action-pypi-publish@master with: diff --git a/bandcamp_dl/__main__.py b/bandcamp_dl/__main__.py index bae9c81..31dbf5b 100644 --- a/bandcamp_dl/__main__.py +++ b/bandcamp_dl/__main__.py @@ -94,12 +94,16 @@ def main(): urls = arguments['URL'] album_list = [] - for url in urls: - logging.debug("\n\tURL: {}".format(url)) - album_list.append( - bandcamp.parse(url, not arguments['--no-art'], arguments['--embed-lyrics'], arguments['--debug'])) - # url is now a list of URLs. So lets make an album_list and append each parsed album to it. - + + if type(urls) is str: + album_list.append(bandcamp.parse(urls, not arguments['--no-art'], arguments['--embed-lyrics'], + arguments['--debug'])) + else: + for url in urls: + logging.debug(f"\n\tURL: {url}") + album_list.append(bandcamp.parse(url, not arguments['--no-art'], arguments['--embed-lyrics'], + arguments['--debug'])) + for album in album_list: logging.debug(" Album data:\n\t{}".format(album))