Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to retrieve HiRes version of album #235

Open
eevan78 opened this issue Mar 5, 2025 · 10 comments
Open

Unable to retrieve HiRes version of album #235

eevan78 opened this issue Mar 5, 2025 · 10 comments

Comments

@eevan78
Copy link

eevan78 commented Mar 5, 2025

Hello,
I have tried to get the following album: 340908520
In Chrome, the playback is 24bit/96KHz:

Image

But if I try to get it with the token retrived from my android device, I get the following:

PS D:\Software\Tidal-dl> .\tidal-wave_windows.exe --audio-format HiRes https://listen.tidal.com/album/340908520
2025-03-05:14:48:06,882 INFO     [models.py:666] TIDAL album ID parsed from input: 340908520
2025-03-05:14:48:07,133 INFO     [login.py:173] Loading TIDAL access token from 'C:\Users\705631\AppData\Local\tidal-wave\android-tidal.token'
2025-03-05:14:48:07,424 INFO     [login.py:198] Access token is valid: saving to 'C:\Users\705631\AppData\Local\tidal-wave\android-tidal.token'
2025-03-05:14:48:07,425 INFO     [requesting.py:101] Requesting from TIDAL API: albums/340908520
2025-03-05:14:48:08,057 INFO     [requesting.py:101] Requesting from TIDAL API: albums/340908520/items
2025-03-05:14:48:08,905 INFO     [requesting.py:101] Requesting from TIDAL API: tracks/340908521/credits
2025-03-05:14:48:09,523 INFO     [requesting.py:101] Requesting from TIDAL API: tracks/340908521/playbackinfopostpaywall
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ in main:166                                                                                                          │
│                                                                                                                      │
│ in get:308                                                                                                           │
│                                                                                                                      │
│ in get_tracks:247                                                                                                    │
│                                                                                                                      │
│ in get:822                                                                                                           │
│                                                                                                                      │
│ in set_filename:227                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'Track' object has no attribute 'codec'
[25896] Failed to execute script 'pyinstaller' due to unhandled exception!

Is this a bug, or Tidal changed something?.. The same album can be retrived in Atmos format.

@ebb-earl-co
Copy link
Owner

@eevan78 thank you for having raised this. I'm afraid it might be a bug, but let me look into it shortly!

@ebb-earl-co
Copy link
Owner

@eevan78 I see that you're using the Windows executable made with PyInstaller... What version is it, do you know?

I have just successfully downloaded that album using Ubuntu 24.04 so I know that the source is good, which leads me to it being a Windows/PyInstaller issue which is good initial information gathering!

@eevan78
Copy link
Author

eevan78 commented Mar 5, 2025

Yes, I forgot to mention those quite important details... It is the very latest Windows binary released, 2025.2.1
Running on Windows 11 24H2

@eevan78
Copy link
Author

eevan78 commented Mar 6, 2025

I have tried to retrieve the album under WSL (Ubuntu 22.04.5) with appropriate latest binary for Ubuntu 22.04, and got the same problem. It is the same as with Windows, I can get the Atmos files. Maybe this info can give some more help in finding the problem...

Did you managed to get the high resolution FLAC files in Ubuntu 24.04?

~  ./tidal-wave --audio-format HiRes https://listen.tidal.com/album/340908520
2025-03-06:14:22:09,351 INFO     [models.py:666] TIDAL album ID parsed from input: 340908520
2025-03-06:14:22:09,739 INFO     [login.py:173] Loading TIDAL access token from '/home/eevan/.config/tidal-wave/android-tidal.token'
2025-03-06:14:22:10,488 INFO     [login.py:198] Access token is valid: saving to '/home/eevan/.config/tidal-wave/android-tidal.token'
2025-03-06:14:22:10,488 INFO     [requesting.py:101] Requesting from TIDAL API: albums/340908520
2025-03-06:14:22:11,141 INFO     [requesting.py:101] Requesting from TIDAL API: albums/340908520/items
2025-03-06:14:22:11,592 INFO     [requesting.py:101] Requesting from TIDAL API: tracks/340908521/credits
2025-03-06:14:22:12,200 INFO     [requesting.py:101] Requesting from TIDAL API: tracks/340908521/playbackinfopostpaywall
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ in main:166                                                                                                          │
│                                                                                                                      │
│ in get:308                                                                                                           │
│                                                                                                                      │
│ in get_tracks:247                                                                                                    │
│                                                                                                                      │
│ in get:822                                                                                                           │
│                                                                                                                      │
│ in set_filename:227                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'Track' object has no attribute 'codec'
[594] Failed to execute script 'pyinstaller' due to unhandled exception!
~  ./tidal-wave --version
tidal-wave 2025.2.1
~ 

@ebb-earl-co
Copy link
Owner

@eevan78 it looks to be a PyInstaller issue… Because I was indeed able to use python3 -m tidal-wave … and did indeed retrieve the HiRes version.

@eevan78
Copy link
Author

eevan78 commented Mar 7, 2025

@ebb-earl-co But I'm struggling to get it even from the cloned git repository. I'm not sure what is wrong in my setup. This is what I get in WSL (Ubuntu 22.04.5):

~/git-checkouts/tidal-wave 󰘬trunk  python3 -m tidal_wave --version
tidal-wave 2025.2.1
~/git-checkouts/tidal-wave 󰘬trunk  python3 -m tidal_wave --audio-format HiRes https://listen.tidal.com/album/340908520
2025-03-07:10:19:35,614 INFO     [models.py:666] TIDAL album ID parsed from input: 340908520
2025-03-07:10:19:36,018 INFO     [login.py:173] Loading TIDAL access token from '/home/eevan/.config/tidal-wave/android-tidal.token'
2025-03-07:10:19:36,392 INFO     [login.py:198] Access token is valid: saving to '/home/eevan/.config/tidal-wave/android-tidal.token'
2025-03-07:10:19:36,393 INFO     [requesting.py:101] Requesting from TIDAL API: albums/340908520
2025-03-07:10:19:37,059 INFO     [requesting.py:101] Requesting from TIDAL API: albums/340908520/items
2025-03-07:10:19:37,951 INFO     [requesting.py:101] Requesting from TIDAL API: tracks/340908521/credits
2025-03-07:10:19:38,554 INFO     [requesting.py:101] Requesting from TIDAL API: tracks/340908521/playbackinfopostpaywall
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ /home/eevan/git-checkouts/tidal-wave/tidal_wave/main.py:158 in main                                                  │
│                                                                                                                      │
│   155 │   │   │   raise typer.Exit(code=0)                                                                           │
│   156 │   │   if isinstance(tidal_resource, TidalAlbum):                                                             │
│   157 │   │   │   album = Album(album_id=tidal_resource.tidal_id, transparent=transparent)                           │
│ ❱ 158 │   │   │   album.get(                                                                                         │
│   159 │   │   │   │   session=session,                                                                               │
│   160 │   │   │   │   audio_format=audio_format,                                                                     │
│   161 │   │   │   │   out_dir=output_directory,                                                                      │
│                                                                                                                      │
│ ╭───────────────────────────────────── locals ─────────────────────────────────────╮                                 │
│ │               album = Album(album_id=340908520, transparent=False)               │                                 │
│ │        audio_format = <AudioFormat.hi_res: 'HiRes'>                              │                                 │
│ │ include_eps_singles = False                                                      │                                 │
│ │              logger = <Logger tidal_wave.main (INFO)>                            │                                 │
│ │            loglevel = <LogLevel.info: 'INFO'>                                    │                                 │
│ │      no_extra_files = False                                                      │                                 │
│ │          no_flatten = False                                                      │                                 │
│ │    output_directory = PosixPath('/home/eevan/Music')                             │                                 │
│ │                   s = <requests.sessions.Session object at 0x7f7f3d9aac00>       │                                 │
│ │             session = <requests.sessions.Session object at 0x7f7f3d9aac00>       │                                 │
│ │      tidal_resource = TidalAlbum(url='https://listen.tidal.com/album/340908520') │                                 │
│ │           tidal_url = 'https://listen.tidal.com/album/340908520'                 │                                 │
│ │         transparent = False                                                      │                                 │
│ │             version = None                                                       │                                 │
│ ╰──────────────────────────────────────────────────────────────────────────────────╯                                 │
│                                                                                                                      │
│ /home/eevan/git-checkouts/tidal-wave/tidal_wave/album.py:308 in get                                                  │
│                                                                                                                      │
│   305 │   │   │   )                                                                                                  │
│   306 │   │   │   logger.warning(_msg)                                                                               │
│   307 │   │                                                                                                          │
│ ❱ 308 │   │   self.get_tracks(session, audio_format, out_dir, no_extra_files=no_extra_files)                         │
│   309 │   │                                                                                                          │
│   310 │   │   if not no_extra_files:                                                                                 │
│   311 │   │   │   self.set_album_review(session)                                                                     │
│                                                                                                                      │
│ ╭─────────────────────────────── locals ────────────────────────────────╮                                            │
│ │   audio_format = <AudioFormat.hi_res: 'HiRes'>                        │                                            │
│ │       metadata = None                                                 │                                            │
│ │ no_extra_files = False                                                │                                            │
│ │        out_dir = PosixPath('/home/eevan/Music')                       │                                            │
│ │           self = Album(album_id=340908520, transparent=False)         │                                            │
│ │        session = <requests.sessions.Session object at 0x7f7f3d9aac00> │                                            │
│ ╰───────────────────────────────────────────────────────────────────────╯                                            │
│                                                                                                                      │
│ /home/eevan/git-checkouts/tidal-wave/tidal_wave/album.py:247 in get_tracks                                           │
│                                                                                                                      │
│   244 │   │   for i, t in enumerate(self.tracks):  # type(t) is TracksEndpointResponseJSON                           │
│   245 │   │   │   track: Track = Track(track_id=t.id, transparent=self.transparent)                                  │
│   246 │   │   │                                                                                                      │
│ ❱ 247 │   │   │   track_files_value: str | None = track.get(                                                         │
│   248 │   │   │   │   session=session,                                                                               │
│   249 │   │   │   │   audio_format=audio_format,                                                                     │
│   250 │   │   │   │   out_dir=out_dir,                                                                               │
│                                                                                                                      │
│ ╭──────────────────────────────────────────────── locals ────────────────────────────────────────────────╮           │
│ │   audio_format = <AudioFormat.hi_res: 'HiRes'>                                                         │           │
│ │              i = 0                                                                                     │           │
│ │ no_extra_files = False                                                                                 │           │
│ │        out_dir = PosixPath('/home/eevan/Music')                                                        │           │
│ │           self = Album(album_id=340908520, transparent=False)                                          │           │
│ │        session = <requests.sessions.Session object at 0x7f7f3d9aac00>                                  │           │
│ │              t = TracksEndpointResponseJSON(                                                           │           │
│ │                  │   title='Prelude and Fugue in D major, BWV 532: I. Prelude',                        │           │
│ │                  │   duration=273,                                                                     │           │
│ │                  │   track_number=1,                                                                   │           │
│ │                  │   volume_number=1,                                                                  │           │
│ │                  │   version=None,                                                                     │           │
│ │                  │   url='http://www.tidal.com/track/340908521',                                       │           │
│ │                  │   explicit=False,                                                                   │           │
│ │                  │   media_metadata=MediaMetadata(                                                     │           │
│ │                  │   │   tags=['LOSSLESS', 'HIRES_LOSSLESS', 'DOLBY_ATMOS']                            │           │
│ │                  │   ),                                                                                │           │
│ │                  │   artist=Artist(id=3851847, name='Masaaki Suzuki', type='MAIN'),                    │           │
│ │                  │   artists=[Artist(id=3851847, name='Masaaki Suzuki', type='MAIN')],                 │           │
│ │                  │   album=TrackAlbum(id=340908520, title='J.S. Bach: Organ Works, Vol. 5')            │           │
│ │                  )                                                                                     │           │
│ │          track = Track(track_id=340908521, transparent=False)                                          │           │
│ │    track_files = [None, None, None, None, None, None, None, None, None, None, ... +16]                 │           │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯           │
│                                                                                                                      │
│ /home/eevan/git-checkouts/tidal-wave/tidal_wave/track.py:822 in get                                                  │
│                                                                                                                      │
│   819 │   │   │   self.outfile = None                                                                                │
│   820 │   │   │   return None                                                                                        │
│   821 │   │                                                                                                          │
│ ❱ 822 │   │   self.set_filename(audio_format)                                                                        │
│   823 │   │   if self.filename is None:                                                                              │
│   824 │   │   │   self.outfile = None                                                                                │
│   825 │   │   │   return None                                                                                        │
│                                                                                                                      │
│ ╭──────────────────────────────────────────────── locals ────────────────────────────────────────────────╮           │
│ │          album = AlbumsEndpointResponseJSON(                                                           │           │
│ │                  │   title='J.S. Bach: Organ Works, Vol. 5',                                           │           │
│ │                  │   duration=3917,                                                                    │           │
│ │                  │   number_of_tracks=26,                                                              │           │
│ │                  │   release_date=datetime.date(2024, 3, 15),                                          │           │
│ │                  │   type='ALBUM',                                                                     │           │
│ │                  │   version=None,                                                                     │           │
│ │                  │   url='http://www.tidal.com/album/340908520',                                       │           │
│ │                  │   explicit=False,                                                                   │           │
│ │                  │   upc='7318599926612',                                                              │           │
│ │                  │   audio_quality='LOSSLESS',                                                         │           │
│ │                  │   audio_modes=['DOLBY_ATMOS', 'STEREO'],                                            │           │
│ │                  │   artists=[Artist(id=3851847, name='Masaaki Suzuki', type='MAIN')]                  │           │
│ │                  )                                                                                     │           │
│ │   audio_format = <AudioFormat.hi_res: 'HiRes'>                                                         │           │
│ │       metadata = TracksEndpointResponseJSON(                                                           │           │
│ │                  │   title='Prelude and Fugue in D major, BWV 532: I. Prelude',                        │           │
│ │                  │   duration=273,                                                                     │           │
│ │                  │   track_number=1,                                                                   │           │
│ │                  │   volume_number=1,                                                                  │           │
│ │                  │   version=None,                                                                     │           │
│ │                  │   url='http://www.tidal.com/track/340908521',                                       │           │
│ │                  │   explicit=False,                                                                   │           │
│ │                  │   media_metadata=MediaMetadata(                                                     │           │
│ │                  │   │   tags=['LOSSLESS', 'HIRES_LOSSLESS', 'DOLBY_ATMOS']                            │           │
│ │                  │   ),                                                                                │           │
│ │                  │   artist=Artist(id=3851847, name='Masaaki Suzuki', type='MAIN'),                    │           │
│ │                  │   artists=[Artist(id=3851847, name='Masaaki Suzuki', type='MAIN')],                 │           │
│ │                  │   album=TrackAlbum(id=340908520, title='J.S. Bach: Organ Works, Vol. 5')            │           │
│ │                  )                                                                                     │           │
│ │ no_extra_files = False                                                                                 │           │
│ │     origin_jpg = False                                                                                 │           │
│ │        out_dir = PosixPath('/home/eevan/Music')                                                        │           │
│ │           self = Track(track_id=340908521, transparent=False)                                          │           │
│ │        session = <requests.sessions.Session object at 0x7f7f3d9aac00>                                  │           │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯           │
│                                                                                                                      │
│ /home/eevan/git-checkouts/tidal-wave/tidal_wave/track.py:227 in set_filename                                         │
│                                                                                                                      │
│   224 │   │   │   │   )                                                                                              │
│   225 │   │   │   │   self.filename: str | None = f"{_track_part} [CD].{self.codec}"                                 │
│   226 │   │   │   else:                                                                                              │
│ ❱ 227 │   │   │   │   self.filename: str | None = f"{track_substring}.{self.codec}"                                  │
│   228 │   │   else:                                                                                                  │
│   229 │   │   │   self.filename: str | None = f"{track_substring}.{self.codec}"                                      │
│   230                                                                                                                │
│                                                                                                                      │
│ ╭────────────────────────────────────── locals ───────────────────────────────────────╮                              │
│ │     _track_part = '01 - Prelude and Fugue in D major, BWV 532 - I. Prelude'         │                              │
│ │    audio_format = <AudioFormat.hi_res: 'HiRes'>                                     │                              │
│ │            self = Track(track_id=340908521, transparent=False)                      │                              │
│ │ track_substring = '01 - Prelude and Fugue in D major, BWV 532 - I. Prelude [HiRes]' │                              │
│ ╰─────────────────────────────────────────────────────────────────────────────────────╯                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'Track' object has no attribute 'codec'
~/git-checkouts/tidal-wave 󰘬trunk  ffmpeg -version
ffmpeg version N-70079-gdf868bae23-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil      59. 16.101 / 59. 16.101
libavcodec     61.  5.103 / 61.  5.103
libavformat    61.  3.103 / 61.  3.103
libavdevice    61.  2.100 / 61.  2.100
libavfilter    10.  2.101 / 10.  2.101
libswscale      8.  2.100 /  8.  2.100
libswresample   5.  2.100 /  5.  2.100
libpostproc    58.  2.100 / 58.  2.100
~/git-checkouts/tidal-wave 󰘬trunk 

@ebb-earl-co
Copy link
Owner

@eevan78 I see that it's failing inside Track.set_filename() claiming that there is no Track.codec available 🤔
I've got some time this weekend to dedicate to proper investigation, so I will get back to you on this shortly. Even though you're using WSL, the only difference between our setups is that you're on Windows! I have a gaming machine with Windows 10 so, as I said, I can make some progress this weekend.

@ebb-earl-co
Copy link
Owner

ebb-earl-co commented Mar 8, 2025

@eevan78 I am now on my Windows system and, because the (excellent) stacktrace points out that the error is occurring inside Track.set_filename(), it's probably something wrong with either the length or the filename of the track in this album

'01 - Prelude and Fugue in D major, BWV 532 - I. Prelude [HiRes]'

This tends to happen with classical music as the name of the album and the name of the tracks tend to be a lot of characters...

I will keep investigating, as I am experiencing a separate error while using tidal-wave on Windows.

Separately, I believe that I made a mistake in the PyInstaller script for Windows with the newest version... This GitHub Issue shows that different syntax should be used when on Windows to the other platforms...

@eevan78
Copy link
Author

eevan78 commented Mar 9, 2025

@ebb-earl-co just for the sake of it, I have tried to get the HiRes version of this album in proot environment (Ubuntu 22.04) inside Termux on Android. And I get the same AttributeError: 'Track' object has no attribute 'codec' error.

Thanks for your work to fix this problem!

@ebb-earl-co
Copy link
Owner

@eevan78 fascinating... All right, I will keep looking into it. I do have some fixes coming shortly from the work that I've done this weekend, so keep an eye on the releases.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants