ebb-earl-co / tidal-wave

Waving at the TIDAL music service
Apache License 2.0
35 stars 2 forks source link

Fix New Code Path to Decrypt Audio for Windows-Gleaned Access Token #94

Closed ebb-earl-co closed 4 months ago

ebb-earl-co commented 4 months ago

This pull request fixes a small bug that was introduced on the way to addressing #88: trying to read the bytes from a file that was opened in open(filename, "wb") mode. This changes to using pathlib.Path(filename).read_bytes(): hopefully there are no issues later down the line with reading the bytes of a file with an open file descriptor...

Also, when the Windows token is expired, now the windows-tidal.token now is deleted from the file system.

ebb-earl-co commented 4 months ago

I've just found an unrelated issue in playlist.Playlist.flatten_playlist_dir(): in particular, AttributeError: 'NoneType' object has no attribute 'outfile' in the situation that i, the index variable in a for loop over all the tracks/videos retrieved, has the value 101, so this is probably and enumerate/off-by-1 problem, but it needs to be fixed before a new version... New pull request for it?