Mbucari / AAXClean

Decrypt Audible aax and aaxc files.
GNU General Public License v3.0
53 stars 8 forks source link

Wrong Chapter Order #10

Closed VarSell closed 2 years ago

VarSell commented 2 years ago

Hi! Really impressed with the decryption / writing speed of this project, started using it instead of ffmpeg as it seems to be able to decrypt and write files in seconds :} I was wondering if you could take a look at this issue? When writing the M4B, the chapters seem to get mixed up in order. This only happened to 1 .aax so far, the others are all in order. Here is the original aax layout aax MediaInfo And here is the finished M4B layout m4b MediaInfo

I'm not intercepting or modifying the file in any way myself, using only aaxcFile.ConvertToMp4a(File.Open($"{file}.{ext}", FileMode.OpenOrCreate, FileAccess.ReadWrite)); Decrypting with ffmpeg has the output file with ordered chapters. Is there any method to reorganize the chapter order to force them in order of increments (eg, if AAXClean reads them in the order of, 06, 01, 02, 07.., it would force them to 01, 02, 03..)

audiamus commented 2 years ago

It's an integer overflow, would be fixed by #7.

VarSell commented 2 years ago

Works perfectly, thank you.

VarSell commented 2 years ago

Sorry for re-opening this, but I just realized that with #7 the Chapters (with all books) are shifted back by 1. At the Chapter 2 marking, Chapter 1 starts, Chapter 2 starts at the Chapter 3 marking, and so on. Is there any existing fix for this, or is it unavoidable? Sorry haha, new to coding so editing the chapter meta is out of my area of experties at the moment.

audiamus commented 2 years ago

This has nothing to do with AAXClean, I'd say. It's the way Audible names the chapters, with the exception of very few and very recent books, always numerical, not observing actual chapter numbers or titles in the book. The alternative is the chapter meta data you receive via the json response to the Audible API call. There is no guarantee, though. For some books you'll get proper chapter titles and proper numbers, for some only the same simple numbering scheme as with the embedded chapters. Another problem is the bad accuracy of the chapter marks in the extra json data which I encountered quite often.

VarSell commented 2 years ago

Oh, good at least to know it's not a problem when writing the local file then, just Audible and their strange ways. I did see a thread on reddit from two years ago stating that they were slowly adding them, but have personally not found one yet with embedded titles. I was thinking of looking into the API to retrieve Chapter titles, and perhaps mess around with aaxc decryption, but don't think I'll continue down that path if their accuracy is often skewed. Thanks for the information!