reconSuave / RollingStoner

Bondi Secure DJVU to PDF Converter for "Rolling Stone: Cover to Cover"
Eclipse Public License 2.0
4 stars 0 forks source link

The New Yorker Archive, Please!! #1

Open sungjwoo opened 3 months ago

sungjwoo commented 3 months ago

I can't believe somebody figured this out...the DjVu files are the worst. Please, please create the same script for the New Yorker!

reconSuave commented 3 months ago

The PlayboyPDF repo is up already, and the tool for the New Yorker collection will be up soon.

The New Yorker DJVU files are different and a bit tricky, they don't use internally stored credentials like the Rolling Stone and Playboy files and you can't open them with the OpenDocument() function from BondiReader.DJVU.dll, it will just throw an error saying invalid credentials.

They use a different library called FataMorgana, it's FMLoader.dll in the New Yorker install directory. It's a mixed assembly DLL, the managed (.NET 2.0) fmManagedLoader is used to call functions from the unmanaged (C++) fmUnmanagedLoader. There's probably some way to do this in Python but I haven't been able to figure it out. I can call the unmanaged functions with ctypes but Python and .NET don't really play nice together, getting at the managed functions is the hard part.

But the good news is that .NET does this all auto-magically, so I have a working tool written in C#. The problem is that I don't know C# very well so it's not very good lmao. Things that would be really simple for me in python or golang are like major surgery in C#, and Visual Studio has this awful habit of giving error messages that have nothing to do with the actual error. Anyway, I can dump the contents of the New Yorker DJVU's to directories of JPEG images, that might be as good as I can do in C#.

But I'll have something up soon, at the very least it will dump the New Yorker files to images and then you can use a tool like pdfcpu (or any number of other great programs out there) to make PDF's from them. Or I could use python subprocess to call the compiled executable that dumps the JPEG's and then make PDF's from them like in this script, that would probably work fine but just seems hackish and bothers my sensibilities, still figuring it out. Something soon though.

sungjwoo commented 3 months ago

In my limited programming of C#, I agree with you wholeheartedly...there are some nice features for sure, but I found it to be mostly pedantic. I just can't believe my luck, as I've held TNY DVDs for years and years, hoping some supersmart coder would figure out how to crack the code. You are that person!! Congrats on figuring out RS and Playboy -- I'll take whatever you offer. The viewer software that comes with TNY is just the worst.

WhitmanHall commented 2 months ago

I also am anticipating an unlocking tool for the newyorker. No rush, i just wanted to add my name to the list.