Skip to content

Commit

Permalink
Bugfix: The Valid Length of TIDAL Album IDs Is between 5 and 9 (#31)
Browse files Browse the repository at this point in the history
* Update album URL matching to accept between 5, 9 digits

* Update README.md with new help output

* Format with Black

* Bump version to 2024.1.3
  • Loading branch information
ebb-earl-co authored Jan 4, 2024
1 parent a2b4d96 commit 7435ea2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ Run `python3 tidal-wave --help` to see the options available. Or, if you followe
Usage: tidal-wave [OPTIONS] TIDAL_URL [OUTPUT_DIRECTORY]

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
* tidal_url TEXT The Tidal album or mix or playlist or track or video to download [default: None] [required]
│ output_directory [OUTPUT_DIRECTORY] The parent directory under which files will be written [default: /home/${USER}/music/]
* tidal_url TEXT The Tidal album or artist or mix or playlist or track or video to download [default: None] [required] │
│ output_directory [OUTPUT_DIRECTORY] The parent directory under which directory(ies) of files will be written [default: /home/${USER}/music/] │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --audio-format [360|Atmos|HiRes|MQA|Lossless|High|Low] [default: Lossless] │
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ requires = ["setuptools", "wheel"]
universal = 0 # Make the generated wheels have "py3" tag
[project]
name = "tidal-wave"
version = "2024.1.2"
version = "2024.1.3"
description = "A tool to wave at the TIDAL music service."
authors = [
{name = "colinho", email = "pypi@colin.technology"}
Expand Down
8 changes: 5 additions & 3 deletions tidal_wave/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ def main(
tidal_url: Annotated[
str,
typer.Argument(
help="The Tidal album or mix or playlist or track or video to download"
help="The Tidal album or artist or mix or playlist or track or video to download"
),
],
audio_format: Annotated[
AudioFormat, typer.Option(case_sensitive=False)
] = AudioFormat.lossless.value,
output_directory: Annotated[
Path,
typer.Argument(help="The parent directory under which files will be written"),
typer.Argument(
help="The parent directory under which directory(ies) of files will be written"
),
] = user_music_path(),
loglevel: Annotated[
LogLevel, typer.Option(case_sensitive=False)
Expand All @@ -71,7 +73,7 @@ def main(

if tidal_resource is None:
logger.critical(
f"Cannot parse '{tidal_url}' as a TIDAL track, album, playlist, or video URL"
f"Cannot parse '{tidal_url}' as a TIDAL album, artist, mix, playlist, track, or video URL"
)
raise typer.Exit(code=1)

Expand Down
2 changes: 1 addition & 1 deletion tidal_wave/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class TidalAlbum(TidalResource):

def __post_init__(self):
self.pattern: str = (
r"http(?:s)?://(?:listen\.)?tidal\.com/(?:browse/)?album/(\d{7,9})(?:.*?)?"
r"http(?:s)?://(?:listen\.)?tidal\.com/(?:browse/)?album/(\d{5,9})(?:.*?)?"
)
_id = self.match_url()

Expand Down

0 comments on commit 7435ea2

Please sign in to comment.