Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Decryption fails on particular track. #44

Open
MarcG2 opened this issue Jun 24, 2019 · 8 comments
Open

Decryption fails on particular track. #44

MarcG2 opened this issue Jun 24, 2019 · 8 comments
Labels
bug Something isn't working

Comments

@MarcG2
Copy link

MarcG2 commented Jun 24, 2019

Program crashes when it tries to decrypt first track on:
https://listen.tidal.com/album/85187772

Quality is set to best available. Perhaps it's due to the file size?

@redsudo redsudo added the bug Something isn't working label Sep 3, 2019
@redsudo
Copy link
Owner

redsudo commented Sep 3, 2019

What region is your account in? I am having a hard time reproducing since my test credentials can't access that album due to region locking. Once I get account credentials for that region, I can test and fix.

@MarcG2
Copy link
Author

MarcG2 commented Sep 4, 2019

I'm in the US.

@redsudo
Copy link
Owner

redsudo commented Sep 4, 2019

I tried using a US based premium account on the latest redsea release (2.2) and it worked:

<<< Downloading single track... >>>
=== Downloading track ID 85187773 ===
Track: 01
Title: The Greatest Show on Earth (Remastered)
Artist: Nightwish
Album: Decades
----
Grabbing album info...
Grabbing stream URL...
Download progress: 100%
Looks like file is encrypted. Decrypting...
Downloading album art...
Download progress: 100%
Tagging media file...
=== 1/1 complete (100% done) ===

Download queue: 1/1 items complete (100% done) <

All downloads completed. <

Can you send me the log output?

@MarcG2
Copy link
Author

MarcG2 commented Sep 4, 2019

You are downloading at the highest quality right? Right after it outputs "Looks like file is encrypted. Decrypting....", it crashes. It doesn't output any error.


 /$$$$$$$                  /$$  /$$$$$$
| $$__  $$                | $$ /$$__  $$
| $$  \ $$  /$$$$$$   /$$$$$$$| $$  \__/  /$$$$$$   /$$$$$$
| $$$$$$$/ /$$__  $$ /$$__  $$|  $$$$$$  /$$__  $$ |____  $$
| $$__  $$| $$$$$$$$| $$  | $$ \____  $$| $$$$$$$$  /$$$$$$$
| $$  \ $$| $$_____/| $$  | $$ /$$  \ $$| $$_____/ /$$__  $$
| $$  | $$|  $$$$$$$|  $$$$$$$|  $$$$$$/|  $$$$$$$|  $$$$$$$
|__/  |__/ \_______/ \_______/ \______/  \_______/ \_______/

                    (c) 2016 Joe Thatcher
               https://github.com/Azalius/RedSea


<<< Downloading album: 22 track(s) in total >>>
=== Downloading track ID 85187773 ===
        Track: 01
        Title: The Greatest Show on Earth (Remastered)
        Artist: Nightwish
        Album: Decades
        ----
        Grabbing stream URL...
        Download progress: 100%
        Looks like file is encrypted. Decrypting...
Exiting...

@redsudo
Copy link
Owner

redsudo commented Sep 5, 2019

Yes. Here is the command I used and the output:

~/D/G/R/RedSea> pipenv run python redsea.py -p best_available https://tidal.com/browse/track/85187773

<<< Downloading single track... >>>
=== Downloading track ID 85187773 ===
Track: 01
Title: The Greatest Show on Earth (Remastered)
Artist: Nightwish
Album: Decades
----
Grabbing album info...
Grabbing stream URL...
Download progress: 100%
Looks like file is encrypted. Decrypting...
Downloading album art...
Download progress: 100%
Tagging media file...
=== 1/1 complete (100% done) ===

Download queue: 1/1 items complete (100% done) <

All downloads completed. <

Then I used mqaid to verify that it did indeed pull the MQA (highest quality) version:

~/D/G/R/mqaid> pipenv run python is_mqa.py .
Found 1 flac file(s). Decoding now...
MQA syncword present. [Nightwish - Decades/01 - The Greatest Show on Earth Remastered.flac]

Just a heads up, MQA format contains some artifacts (such as the syncword) that are generally unfavorable for certain applications vs standard 16bit flac but for personal use you should be fine.

Are you on RED IRC? Might be easier to help you there.

@MarcG2
Copy link
Author

MarcG2 commented Sep 7, 2019

I didn't realize the flac files I was getting also contained MQA data. Is it just metadata or is it mixed in with the encode?

I'm not on that IRC. Are you using different versions of the dependencies? This is what I have.
mutagen 1.42.0
opencv-python 3.4.4.19
pycryptodome 3.8.2
requests 2.9.1

Is there a way to get the application give information on whatever exception is being thrown?

@redsudo
Copy link
Owner

redsudo commented Sep 9, 2019

Yeah, even though MQA is technically higher quality since it is 24bit, it does contain artifacts embedded in the audio which can only be properly removed with MQA compatible hardware (the software MQA decoder will not completely reverse the MQA encoding).

The embedded data is not supposed to be audible so like many things in audio, it's a matter of debate/personal opinion whether its better to have MQA or standard 16bit flac. That's why I have the software default to 16bit flac but retain the option to download MQA. Perhaps I should add a warning/note regarding the MQA stuff.

I am using these dependencies with standard Python 3.7.4:

isort==4.3.21
lazy-object-proxy==1.4.2
mccabe==0.6.1
mutagen==1.31
pycryptodome==3.9.0
requests==2.9.1
six==1.12.0
typed-ast==1.4.0
wrapt==1.11.2

Regarding increased verbosity, there isn't currently an option for that but I will add it to the to-do list. Still, the place where the program is halting for you is really strange. "Exiting.." is not one of the messages in this program so it must be from one of the libraries, likely the crypto library.

I will work on getting a more verbose version of the program together.

@MarcG2
Copy link
Author

MarcG2 commented Sep 14, 2019

I tried downloading the album at FLAC quality instead, and it completed successfully. So the issue seems to be with the MQA files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants