DJDoubleD / QobuzDownloaderX-MOD

Downloads streams directly from Qobuz. Experimental refactoring of QobuzDownloaderX by AiiR
GNU General Public License v3.0
406 stars 14 forks source link

[Feature Request] Missing Vorbis? and more #44

Closed orbittwz closed 10 months ago

orbittwz commented 10 months ago

🚀 Feature Request

Is your feature request related to a problem? Please describe.


Describe the solution you'd like


Describe alternatives you've considered


Additional context

orbittwz commented 10 months ago

Adding some feedback over tracks I got using this version... All the tracks have this vorbis tags: image This is not needed, and maybe you can omit this or at least have a toggle to keep or not. Moreover, both PUBLISHER and BARCODE are actually exist in this version already, but not the right vorbis tags. ORGANIZATION should be PUBLISHER. UPC should be BARCODE but without the extra zero prefix. Thanks!

DJDoubleD commented 10 months ago

A few remarks regarding this feature request:

In conclusion: some requests are simply impossible to provide and other need at least some clarification and/or justification before I can consider to change them. It would seem tagging is a delicate subject as everybody has their own preferences so the most objective thing to do, is follow existing standards...

orbittwz commented 10 months ago

Thanks for the detailed information... Do you know if Qobuz API allows further vorbis rewriting with different metadata encoders such as Mutagen or FLAC?

DJDoubleD commented 10 months ago

Thanks for the detailed information... Do you know if Qobuz API allows further vorbis rewriting with different metadata encoders such as Mutagen or FLAC?

I'm afraid I don't understand your question.

The Qobuz API is just an interface to send and receive data from Qobuz. QBDLX-MOD then uses the available received data to write to the most essential and popular tags using taglib-sharp. Mutagen is just like taglib-sharp but in/for python instead of c#. From their own website : Mutagen is a Python module to handle audio metadata.

And FLAC is just a container format with the ability to contain compressed lossless audio and Vorbis Comment tags.

orbittwz commented 10 months ago

let me rephrase then: since Qobuz API doesn't write CRC and Encoder tags, is it possible to do so somehow with your program? can you use another library to create and insert them into FLAC streams?

DJDoubleD commented 10 months ago

let me rephrase then: since Qobuz API doesn't write CRC and Encoder tags, is it possible to do so somehow with your program? can you use another library to create and insert them into FLAC streams?

Te biggest problem is simply: the source information for the original server side audio stream cannot be retrieved and the same goes for the encoder that was used on to generate the original files. The only way that I see to generate a MD5 checksum (in the STREAMINFO header, this is not a Vorbis Comment tag!) is to re-encode the downloaded audio files. And that would just be completely unreasonable in my opinion...

orbittwz commented 10 months ago

I've never heard of un-Encoder tagged FLACs and this is quite the problem... Not knowing which Encoder was used to actually compress and encode the audio stream is very weird to say the least! Can you check if your problem is by some odd way is stripping this kind of information?? Of all my years as audiophile, this is first for me. Let me know (also do try to check if CRC can be inserted as well to the stream info as you said) Thanks

DJDoubleD commented 10 months ago

I've never heard of un-Encoder tagged FLACs and this is quite the problem... Not knowing which Encoder was used to actually compress and encode the audio stream is very weird to say the least! Can you check if your problem is by some odd way is stripping this kind of information?? Of all my years as audiophile, this is first for me. Let me know (also do try to check if CRC can be inserted as well to the stream info as you said) Thanks

I agree this is weird, but it's just the way Qobuz serves their FLAC files for streaming. Maybe they have some kind of custom transcoding workflow which doesn't calculate/write these values to their files, or maybe they use a tool like ExiffTool to strip their files of these 2 fields. I have no idea...

The MD5 checksum of the unencoded stream in a FLAC file is calculated during the encoding process. There is no way to (re)calculate this for an already encoded file. You can only transcode the FLAC into a new FLAC, which will automatically add both the encoder (the one used to encode the new file) and MD5 checksum to the FLAC STREAMINFO headers. This seems redundant to say the least and is way out of scope of a simple downloader...

If I'm wrong, feel free to point me to a documentation link which explains how to recalculate the checksum of an already encoded file without transcoding it and I'll look into it.

DJDoubleD commented 10 months ago

OK some progress, I've just added the Encoder tag without value using dbpoweramp and the Encoder was added with the track original value... So basically the downloaded files using your program have the value, not the field?? Can you check if this is possible to fix? same goes to CRC field

As far as I know, dbpoweramp is a Music Converter. When you add the tag, you literally need to press a button "Convert". So I highly suspect dbpoweramp simply writes the encoder used by dbpoweramp itself to update the file when you leave the value of the tag empty. In your examples, you get a libFLAC build from 2023-06-23 as encoder. I suspect you will get this result for all files you try this manipulation on? Please try this on older Qobuz files which must have been encoded on their server before 2023-06-23 and see if you get an older libFLAC build version or the same recent one. Also, the tagging editor that dbpoweramp uses, seems to be a proprietary tool, so I can't check the source.

DJDoubleD commented 10 months ago

Seems you are correct, so it's writing the encoder it already have... So it's not a good example...

That's what I was saying all along, the original data simply isn't there unfortunately.

What can be done so files from Qobuz have their original Encoder and CRC? does downloads using your program different from purchased downloads?

As far as I know, there simply isn't anything to be done to retrieve the original Encoder and CRC. I can't compare with purchased downloads from Qobuz as I have none (impossible to rip purchase only tracks). And even if I were to have purchased downloads and they do contain this info, it still wouldn't offer a solution to the missing data in the files they serve up for streaming...

I have exhausted all possible avenues to a solution for your request regarding the encoder and CRC fields, which simply aren't available. So unless you can provide me with a workable solution, I'll have to close this issue as there is nothing to be done...

orbittwz commented 10 months ago

Sure thanks man for your kindness explaining and taking the time answering this... Will close for now.

orbittwz commented 10 months ago

this is not OK because clearly something is not right... FLAC files must contain how they were encoded and what are their CRC hash after being encoded... Please further test why the downloaded streams are being "stripped" somehow... maybe it's the API of yours you are using, maybe the program... something is messing with the files. let me know...

DJDoubleD commented 10 months ago

this is not OK because clearly something is not right... FLAC files must contain how they were encoded and what are their CRC hash after being encoded... Please further test why the downloaded streams are being "stripped" somehow... maybe it's the API of yours you are using, maybe the program... something is messing with the files. let me know...

This really has nothing to do with my use of the API nor the way I save the downloaded files. The simple fact is that the source files on the Qobuz servers do not contain this data.

Feel free to try any of the other Qobuz downloaders out there (streamrip, qobuz-dl, OrpheusDL, ...). You will find that they will also produce the exact same audio stream with MD5 of the unencoded content : 00000000000000000000000000000000 (so no CRC) and possibly something like Writing library : Mutagen 1.46.0, which is only the result of writing the metadata with the mutagen library (which obviously isn't the original encoding library).

There really isn't anything to be done here, I'm afraid.