From d25c57da22b53a58dc19b43064bb79b6860ce6d7 Mon Sep 17 00:00:00 2001 From: 7x11x13 Date: Wed, 14 Aug 2024 12:38:20 -0400 Subject: [PATCH] Format and lint --- scdl/scdl.py | 8 +++++--- tests/test_search.py | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scdl/scdl.py b/scdl/scdl.py index da3f75f..05d178c 100644 --- a/scdl/scdl.py +++ b/scdl/scdl.py @@ -1,9 +1,9 @@ """scdl allows you to download music from Soundcloud Usage: - scdl (-l | -s | me) [-a | -f | -C | -t | -p | -r][-c | --force-metadata] - [-n ][-o ][--hidewarnings][--debug | --error][--path ] - [--addtofile][--addtimestamp][--onlymp3][--hide-progress][--min-size ] + scdl (-l | -s | me) [-a | -f | -C | -t | -p | -r] + [-c | --force-metadata][-n ][-o ][--hidewarnings][--debug | --error] + [--path ][--addtofile][--addtimestamp][--onlymp3][--hide-progress][--min-size ] [--max-size ][--remove][--no-album-tag][--no-playlist-folder] [--download-archive ][--sync ][--extract-artist][--flac][--original-art] [--original-name][--original-metadata][--no-original][--only-original] @@ -448,6 +448,7 @@ def validate_url(client: SoundCloud, url: str) -> str: logger.error("URL is not valid") sys.exit(1) + def search_soundcloud(client: SoundCloud, query: str) -> Optional[str]: """Search SoundCloud and return the URL of the first result.""" try: @@ -464,6 +465,7 @@ def search_soundcloud(client: SoundCloud, query: str) -> Optional[str]: logger.error(f"Error searching SoundCloud: {e}") return None + def get_config(config_file: pathlib.Path) -> configparser.ConfigParser: """Gets config from scdl.cfg""" config = configparser.ConfigParser() diff --git a/tests/test_search.py b/tests/test_search.py index 457bf65..e917e15 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -41,4 +41,8 @@ def test_search_playlist(tmp_path: Path) -> None: ) assert r.returncode == 0 assert_track(tmp_path / "playlist1", "1_OK Bye.mp3", check_metadata=False) - assert_track(tmp_path / "playlist1", "2_Wan Bushi - Eurodance Vibes (part 1+2+3).mp3", check_metadata=False) + assert_track( + tmp_path / "playlist1", + "2_Wan Bushi - Eurodance Vibes (part 1+2+3).mp3", + check_metadata=False, + )