-
Notifications
You must be signed in to change notification settings - Fork 10
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
Route not found error #44
Comments
I get the same error. |
I get the error message is {"status":false,"error":{"message":"Route not found in ApiRouter","internal_code":"APPERR13131313"}} |
now i also get |
same here, I was trying to backup my library and run into the issue. Is there any plan to update the tool? |
I am getting this error as well. I would love to see the project updated. Does anyone know of any alternatives. I have ton of magazines that I have been subscribing to for years and now Zinio wants you to pay monthly for access to old issues that you already paid for. |
Same error on both MacOS 14.6.1 and on Ubuntu 22.04. |
Looks like Zinio have made a few changes to their backend. I have gotten past the original problem raised, but have encountered a few more - will work on those. |
It looks like Zinio no longer has the older SVG-based reader, which this tool was based on. This may be a major roadblock - we will need to look into how their PDF-based reader works. In the long run, this should be better - but will take some time. |
I have successfully fix this problem, it's only because of the get library api changes, the keys now are 'library-issues' 'offset'. And in order to terminate process this change is also needed
BTW, the changes I made are based on @motoyugota 's fork. |
I can confirm that it's now working ! Good job. git clone https://github.com/motoyugota/ZiniGo/
cd ZiniGo
git checkout fixgetpages
cd ZiniGo
vi main.go # then just replace the whole content of the "GetLibrary" method
go build .
mkdir "issue/" # otherwise weird permissions ... but still, generated files have now weird permissions
cp ../built/template.html .
./ZiniGo
But in the generated .PDF, i have a weird "PDF note" (small note in top left corner) everywhere (with the content "page=Cover", etc.). Was not happening before / don't know from where this is coming. The template.html ? |
Ok so i still don't know from where these "notes" are coming (it seems to be "sticky notes"), but to remove them, i just had to add (line 186) : _ = api.MergeCreateFile(filenames, completeName, nil)
err2 := api.RemoveAnnotationsFile(completeName, "", nil, nil, nil, nil, false)
if err2 != nil {
fmt.Println(err2)
} |
(sorry, several edits, i should stop writing this comment alongside my tests ...) First, i encountered again some This is solved like this (removal of the "N retry with a delay" in order to try one time without password, one time with the err = api.RemovePagesFile(filenames[i], "", []string{"2-"}, nil)
if err != nil {
fmt.Printf("Removing extra pages from ["+filenames[i]+"] failed with %s\n.", err)
err = api.RemovePagesFile(filenames[i], "", []string{"2-"}, conf)
if err != nil {
fmt.Printf("Removing extra pages from ["+filenames[i]+"] still failed with %s\n.", err)
}
} Then i encountered some errors (now displayed) about unsupported PDF features
This is related to : pdfcpu/pdfcpu#654
with two code changes :
At this point on my side, it seems WAY better now. |
@SR-G, nothing more exciting than seeing fresh comments on a repo! Nice job :) Last month I wrote an AHK script that prints each individual page to PDF and combines into one big one because I didn't have the skills to troubleshoot... |
@SR-G I was hoping I can fix those problem after I learn some more golang. I've never coded in go. I don't know why I got a |
After a
|
But now I encounter this problem pdfcpu/pdfcpu#901 some of the encrypted file have incorrect date thich crash pdfcpu. |
Sadly the
So there are several options :
(i'm speaking about "cleaning up the metadata" in order to "prepare" the temporary .PDF and have them ready to be processed by |
I tried https://github.com/sfomuseum/go-pdfbox.git and https://pkg.go.dev/github.com/KarmaPenny/pdfparser
the code is something like this
according to https://pdfbox.apache.org/2.0/commandline.html |
@ER-EPR in my last experiments, it seemed that Zinio had stopped using the "Legacy" flag to mark files, and set the PDF. Unfortunately, my library isnt very big so none of my issues actually used this. It almost seemed at some point like every other page was using a different password. I have got a version using c# (Im a lot more familiar with c# than golang - this was just an experimental project for me) which I can try to get cleaned up and uploaded here. Im not sure if makes sense to archive this repo and move to a new one, anyone have thoughts? |
I think it would be best to "cap" the go archive with a build with the main extract fix in it and create a new C# archive |
But i don't understand @TheAxeDude your last comment - with the previous comments from yesterday, a lot of things are still working here :
What remains seems only to be (for SOME of the pages downloaded) the weird date, at this time unparseable by the PDFCPU library. |
im no coder at all! thanks! |
@ER-EPR So, i made a few extra tests (after having been able to be in a situation with the same wrong date than you), and i think i've understood a few things. First, many issues were coming from the failure of executions at 'decrypt time' The biggest problem has been since a long time the fact that ... all errors at decrypt time are hidden : os.WriteFile(pathString+".pdf", html, 0644)
api.DecryptFile(pathString+".pdf", "", conf) So in case of failures here, everything else was broken (and no valid PDF in the end) : and this is why sometimes some temporary pages were found on disk and were asking for a password : because decrypt had silently failed ! Of course proper pattern is just : os.WriteFile(pathString+".pdf", html, 0644)
err = api.DecryptFile(pathString+".pdf", "", conf)
if err != nil {
fmt.Println("Can't decrypt ["+pathString+".pdf] : ", err)
} And then we can see the errors, like (what you were encountering) the errors with the weird dates. How to solve the errors about weird dates (still with PDFCPU) As said before and after having checked the code, the pdfcpu is really not flexible at all (= it's very difficult to change it's behavior, or to use internal deep parts, like altering the validation). However, in local, and before they would be able to handle the situation with these specific dates (or, better, if they would introduce a "NoDateValidation" mode, etc.), you can do the following :
(...)
// Remove trailing 0x00
s = strings.TrimRight(s, "\x00")
if strings.Contains(s, "-001-1-1-1-1-1-00") {
s = "D:20000101100000Z" // YYYYMMDDHHmmSSZ
}
if relaxed {
(...) The principle is obvious : this method is executed BEFORE the dates are parsed, and there we are "sanitizing" it, by removing the weird string and putting a valid date (i think a valid date is still needed, per the followup lines). And the good thing is that it solves all situations (Decrypt, Merge pages, RemovePages, ... : they are all in need of a 100% valid PDF and were all failing before). Like this, at least this error should be easily corrected. Of course it's more a temporary hack than anything else, and a proper fix should be applied in the pdfcpu library (per the #910 issue in their repo). However I would be curious to see if this is working on your side ;) |
go build -o zinigo ZiniGo/main.go |
@SR-G It works quite well! I change it a little bit, by remove all dashes from the string and replace them with '0'. And now no error at all. Thanks very much
I can see the downloaded pages was OK only encrypted before this correction, it is the api.decrypt process fail and the following remove page and merge will too. I also use Stirling PDF docker container to decrypt and merge those pages before, by using it's pipeline function, and success. But nothing is comparable to this perfect fix, thanks again. |
@TheAxeDude I think you can approve the pull request #40, merge it and you can integrate the code I provided above in getLibrary, and @SR-G's enhancements, then you would find it working flawlessly. |
I will try to spend some time on that this weekend! Thank you :) |
im too stupid to get this to work on osx.... |
Even after building, I'm still getting the "Route not found" error. Am I missing something here? I checked with the latest pull request and I have the most recent main.go file in the repo so I am a little confused. |
Not sure what you did (i don't understand your "i have the most recent main.go file in the repo" part - especially, you do NOT want the most recent one from this repo, but the one from the pull request + all the adjustements discussed in previous comments). I tested 5 min ago and it's still working on my side. Also i pushed my changes here (incl. the "vendor" stuff) (but there are still some uneeded tests inside the code), you should be able to grab it from there and build the binary (or use the one commited at the root, for linux) |
Got this error after logging in
GotLogin
Fetching Library
Fetching page:1
{"status":false,"error":{"message":"Route not found in ApiRouter","internal_code":"CONTENT_ERROR"}}
Terminating the application...
The text was updated successfully, but these errors were encountered: