Skip to content

Commit

Permalink
Format and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
7x11x13 committed Aug 14, 2024
1 parent 93f0320 commit d25c57d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions scdl/scdl.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""scdl allows you to download music from Soundcloud
Usage:
scdl (-l <track_url> | -s <search_query> | me) [-a | -f | -C | -t | -p | -r][-c | --force-metadata]
[-n <maxtracks>][-o <offset>][--hidewarnings][--debug | --error][--path <path>]
[--addtofile][--addtimestamp][--onlymp3][--hide-progress][--min-size <size>]
scdl (-l <track_url> | -s <search_query> | me) [-a | -f | -C | -t | -p | -r]
[-c | --force-metadata][-n <maxtracks>][-o <offset>][--hidewarnings][--debug | --error]
[--path <path>][--addtofile][--addtimestamp][--onlymp3][--hide-progress][--min-size <size>]
[--max-size <size>][--remove][--no-album-tag][--no-playlist-folder]
[--download-archive <file>][--sync <file>][--extract-artist][--flac][--original-art]
[--original-name][--original-metadata][--no-original][--only-original]
Expand Down Expand Up @@ -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:
Expand All @@ -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()
Expand Down
6 changes: 5 additions & 1 deletion tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

0 comments on commit d25c57d

Please sign in to comment.