TheAxeDude / ZiniGo

Utility to backup magazines from the Zinio service as PDF, bypassing/Removing their DRM.
MIT License
51 stars 9 forks source link

Application terminates without downloading anything #36

Open AndreMareno opened 1 year ago

AndreMareno commented 1 year ago

Hello,

the "Zinigo_Windows_x86.exe" application terminates without downloading anything. Is there any chance for an update?

Thank you so much in advance.

Andre

TheAxeDude commented 1 year ago

HI @AndreMareno can you provide any more details? Have you setup the config.json? Does the program output anything around managing to login/try to fetch the library?

AndreMareno commented 1 year ago

Hi, to be honest: I just downloaded the Zinigo_Windows_x86.exe (I use a Windows 7 computer), I did a double click on the exe and than I see: Getting Login, Got Login, Fetching Library, Fetching page: 1 then there are two lines of text that I can't read because the program terminates than instantly. Thank you so much for your help.

zeppelinguy82 commented 1 year ago

same here. It had been working beautifully for a month. Then today it gets to "fetching page 1" and closes out

ChezMarsupilami commented 1 year ago

Hi, same in my case, worked fine till now. The output is this:

GettingLogin GotLogin Fetching Library Fetching page:1 {"status":false,"error":{"message":"Invalid Json Web Token in AsyncMiddleware","internal_code":"INVALID_TOKEN"}} Terminating the application...

That's all. Thanks for your help.

TheAxeDude commented 1 year ago

Just took a look, they have changed the structure of the login request. I have got a locally-working POC - will try to clean it up and push an update this weekend.

They also now return an error when the device limit is reached...and I have reached my device limit. I had a quick peak at how they're doing device ID resolution...and I havent found a fool-proof way to do it yet. One thing we can do is try to keep a consistent ID so its easy to not exhaust them. (There is a bit of chat in another issue about this)

mugurelu commented 1 year ago

From what I've seen, they need also the email here, in this json: https://github.com/TheAxeDude/ZiniGo/blob/master/ZiniGo/main.go#L281

{'status': False, 'error': {'message': 'There have been validation errors: Invalid value: email = undefined', 'internal_code': 'INVALID_PARAMS'}}

I think this is a very recent change, in the past 2-3 days.

BlackB846 commented 1 year ago

Just took a look, they have changed the structure of the login request. I have got a locally-working POC - will try to clean it up and push an update this weekend.

They also now return an error when the device limit is reached...and I have reached my device limit. I had a quick peak at how they're doing device ID resolution...and I havent found a fool-proof way to do it yet. One thing we can do is try to keep a consistent ID so its easy to not exhaust them. (There is a bit of chat in another issue about this)

Really appreciate your work on this - did you have a chance yet to push the updates? I'd be happy to test the windows version

TheAxeDude commented 1 year ago

Just pushed some updates! I havent had a chance to test them on a non-Apple Silicon device, so please let me know if there are issues!

zeppelinguy82 commented 1 year ago

hate to bother you more, but I downloaded the new .exe and now I get an error that says "The app can't run on your PC"

hieronymousch commented 1 year ago

Just recompiled, getting {"status":false,"error":{"message":"Invalid Json Web Token in AsyncMiddleware","internal_code":"INVALID_TOKEN"}} Different error but same cause? Running on Linux (AMD64)

BlackB846 commented 1 year ago

hate to bother you more, but I downloaded the new .exe and now I get an error that says "The app can't run on your PC"

I'm afraid I'll have to confirm the same problem. I tried both the 32bit and 64bit versions for Windows on my Windows 11 PC. Both are not executed with the message, they are not compatible with Windows 64bit operating system. I tried setting them to Windows 7 compatibility mode - no change.

Looking at the first characters in the file I could imagine, they were compiled for a different platform?

TheAxeDude commented 1 year ago

I think there's something weird when building for Windows on macOS. Ive just tried building from my win machine, and it works fine.

However, theres a new issue - they've changed the structure of another endpoint - the one where we pull the pages from. I think in the long-run it'll make it easier to get original PDFs, but I am going to need to dig in a bit further. Ill push the new windows builds, but they wont be of much use Im afraid.

BlackB846 commented 1 year ago

As you stated - binary for windows (64bit version) starts and downloads the list of magazines but terminates when trying to download the first magazine (panic: runtime error: index out of range [0] with length 0).

Thanks for your support.

TheAxeDude commented 1 year ago

New version uploaded - seems we can now pull the PDFs directly. Testers needed!

zeppelinguy82 commented 1 year ago

New version uploaded - seems we can now pull the PDFs directly. Testers needed!

Thanks! It's about 50/50 for me now. Some magazines are working perfectly. Others I am getting this error

".retrying after error: pdfcpu: please provide the correct password Removing extra pages failed with pdfcpu: please provide the correct password"

This is using the win86 version

AndreMareno commented 1 year ago

I also get the same error as zeppelinguy82: ".retrying after error: pdfcpu: please provide the correct password Removing extra pages failed with pdfcpu: please provide the correct password"

But thanks a lot for your work.

BlackB846 commented 1 year ago

Thank you for the update.

I'm testing the windows 64bit version on a Windows 11 64bit installation. First two issues just finished downloading.

Downloading individual pages is substantially faster than before. Combining the individual pages to a single PDF feels substantially longer.

Haven't seen the error reported by @zeppelinguy82 yet - I have a few more issues to go, let's see, if it shows up later.

When opening the final pdf in Acrobat Reader - a message is displayed that there is an error on the page. The page looks fine so it seems to be neglectable. The error doesn't occur when opening the file in edge or chrome.

After 4 downloaded issues, the program died with the following error:

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]: github.com/pdfcpu/pdfcpu/pkg/api.Merge({0x12af070?, 0x0, 0x0}, {0xfff040, 0xc000190000}, 0xc002fd25d8?) C:/projects/GOPATH/pkg/mod/github.com/pdfcpu/pdfcpu@v0.3.13/pkg/api/merge.go:59 +0x2e7 github.com/pdfcpu/pdfcpu/pkg/api.MergeCreateFile({0x0?, 0x0?, 0x0?}, {0xc0000b0140, 0x45}, 0xc000098586?) C:/projects/GOPATH/pkg/mod/github.com/pdfcpu/pdfcpu@v0.3.13/pkg/api/merge.go:128 +0x2a5 main.main() C:/projects/ZiniGo/Zinigo/main.go:185 +0x1375

potterface commented 1 year ago

Thanks for the hard work. The updated version it's working for me now. I can download most of the issues in my library, except some wich outputs an error like this one:

{355186 December 11, 2017 {TV Guide Magazine 0}  }
Checking if issue exists: E:\Tools\ZiniGo\issue\TV Guide Magazine - December 11, 2017.pdf
Downloading issue: TV Guide Magazine - December 11, 2017
No Download URL for page  0
No Download URL for page  1
No Download URL for page  2
No Download URL for page  3
No Download URL for page  4
No Download URL for page  5
No Download URL for page  6
No Download URL for page  7
No Download URL for page  8
No Download URL for page  9
No Download URL for page  10
...
hieronymousch commented 1 year ago

Just recompiled, getting {"status":false,"error":{"message":"Invalid Json Web Token in AsyncMiddleware","internal_code":"INVALID_TOKEN"}} Different error but same cause? Running on Linux (AMD64)

I resolved this issue, this was the max number of devices problem. Removed the other devices, recompiled, works like a charm on Linux. Thank you very much for your work!

hieronymousch commented 1 year ago

Author

Same issue here for some magazines. He actually creates the different PDF for the individual pages but merge seems to fail somehow

AndreMareno commented 1 year ago

Some magazines have a password protection on the second (one even on the fourth page) as well as penultimate pdf page. Therefore, Zinigo cannot merge them. Otherwise everything works perfectly.

ChezMarsupilami commented 1 year ago

Some magazines have a password protection on the second (one even on the fourth page) as well as penultimate pdf page. Therefore, Zinigo cannot merge them. Otherwise everything works perfectly.

Same for me, the page-PDF files are downloaded fine, but can't be merged (any of them) due to a password protection issue.

potterface commented 1 year ago

Thanks for the hard work. The updated version it's working for me now. I can download most of the issues in my library, except some wich outputs an error like this one:

{355186 December 11, 2017 {TV Guide Magazine 0}  }
Checking if issue exists: E:\Tools\ZiniGo\issue\TV Guide Magazine - December 11, 2017.pdf
Downloading issue: TV Guide Magazine - December 11, 2017
No Download URL for page  0
No Download URL for page  1
No Download URL for page  2
No Download URL for page  3
No Download URL for page  4
No Download URL for page  5
No Download URL for page  6
No Download URL for page  7
No Download URL for page  8
No Download URL for page  9
No Download URL for page  10
...

Nevermind this issue. It's a problem with Zinio themselves as I cannot view this edition in their official app or the browser. I'm going to contact Zinio's customer support about this as it's a problem with the files on their server.

zeppelinguy82 commented 1 year ago

side note @TheAxeDude , how do we buy you a coffee to say thanks?

zeppelinguy82 commented 1 year ago

This stopped working for me again yesterday. It finds a new magazine then closes out before it downloads the pages. Happens so quickly I can't even see what the error is

potterface commented 1 year ago

Yeah, the app stopped working again. Some issues were not downloading due to that password problem, now we're back to not downloading anything. It looks like Zinio is always ahead of us.

hieronymousch commented 1 year ago

Yeah, the app stopped working again. Some issues were not downloading due to that password problem, now we're back to not downloading anything. It looks like Zinio is always ahead of us.

Yeah... seems that way. I've actually started looking to another provider for e-magazines. I really enjoyed reading on my Remarkable

potterface commented 1 year ago

Here's the error I'm getting now:

Loading HTML template
Resolved working directory to: D:\Tools\ZiniGo
{582676 October 2023 {Reader's Digest 0}  }
Password: c4a58163c3114bf43fa6e0c1cd06d2471a63a843
Checking if issue exists: D:\Tools\ZiniGo\issue\Reader's Digest - October 2023.pdf
Downloading issue: Reader's Digest - October 2023
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/pdfcpu/pdfcpu/pkg/api.Merge({0x95f420?, 0x0, 0x0}, {0x68f720, 0xc00022a1c8}, 0x5c9cc0?)
        C:/Users/potterface/go/pkg/mod/github.com/pdfcpu/pdfcpu@v0.3.13/pkg/api/merge.go:59 +0x2b4
github.com/pdfcpu/pdfcpu/pkg/api.MergeCreateFile({0x0?, 0x0, 0xc0000900c0?}, {0xc0001e81c0, 0x38}, 0xc000016306?)
        C:/Users/potterface/go/pkg/mod/github.com/pdfcpu/pdfcpu@v0.3.13/pkg/api/merge.go:128 +0x41d
main.main()
        C:/Users/potterface/Downloads/ZiniGo-master/Zinigo/main.go:186 +0x1335

The password thing is a line of code I added to display the password when I built it from souce, just in case I needed to open the encrypted PDF files. Apart from that the code was unchanced and it was working until a few days ago.