ZiniGo
ZiniGo copied to clipboard
Invalid Json Web Token
Once i run the executable using ./zinigo I am retured wtih the following error.
{"status":false,"error":{"message":"Invalid Json Web Token in AsyncMiddleware","internal_code":"INVALID_TOKEN"}}
Same issue here
I also received this error. ? ^::^
I received the same error. In my case, it was apparently caused by my config.json file, which was created in Notepad and contained smart quotation marks. The solution in my case was to replace the smart quotation marks with standard ones.
(Still getting unrelated errors though.)
I think Zinio is enforcing now a limit of maximum devices per account (maximum of 5). If the script shows up as a different device every time it does something, it might lead to this.
So for example, this shouldn't change this often, because it's user device ID, it should be generated only once: https://github.com/TheAxeDude/ZiniGo/blob/master/ZiniGo/main.go#L493-L500
I had missed the comms around the device limits. I'll see if I can recreate this on my side, and find a long-term workaround.
Same problem, not a device limit issue (one 1/5 used for me).
(everyting worked fine until last week).
Same issue here, i also don't think it's a device limit issue :
- the script was working fine for month
- i'm only using it for one single magazine (once per month)
- i'm never logging into Zinio in any way from anywhere (only through this script)
- i'm using the exact same computer since 2 years
And i haven't encountered this issue until this month.
Config file loaded
Username taken from config file
password taken from config file
chromepath taken from config file
GettingLogin
GotLogin
Fetching Library
Fetching page:1
{"status":false,"error":{"message":"Invalid Json Web Token in AsyncMiddleware","internal_code":"INVALID_TOKEN"}}
Terminating the application...
I'm having the exact same issue. I hope there's a fix for it soon.
Username taken from config file
password taken from config file
chromepath taken from config file
GettingLogin
GotLogin
Fetching Library
Fetching page:1
{"status":false,"error":{"message":"Invalid Json Web Token in AsyncMiddleware","internal_code":"INVALID_TOKEN"}}
Terminating the application...
Me as well... Missing reading on my remarkable in stead of the horrible Zinio app. I'm willing to contribute a number of coffees to get this going ;)
Just pushed some updates! I haven't had a chance to test them on a non-Apple Silicon device, so please let me know if there are issues!
Hey, hey. I think you are on the good track : it's way better, it seems the AUTH / library retrieval is now working. However on my side (linux box) i now have an error just after :
Downloading issue: <expected title>
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/pdfcpu/pdfcpu/pkg/api.Merge({0xc08360?, 0x0, 0x0}, {0x939d60, 0xc0001141f8}, 0x4dacd1?)
go/pkg/mod/github.com/pdfcpu/[email protected]/pkg/api/merge.go:59 +0x2b4
github.com/pdfcpu/pdfcpu/pkg/api.MergeCreateFile({0x0?, 0x0, 0x13?}, {0xc00029a2a0, 0x54}, 0xc000130186?)
go/pkg/mod/github.com/pdfcpu/[email protected]/pkg/api/merge.go:128 +0x41d
main.main()
ZiniGo/ZiniGo/main.go:239 +0x12d8
And so it creates a blank .PDF - however, all the previously downloaded issues are correctly detected and skipped (per the library being correctly retrieved)
I did a "go mod tidy", so my go.mod is :
module ZiniGo
go 1.19
require (
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.7.2
github.com/icza/gox v0.0.0-20220921190100-610a6663952b
github.com/pdfcpu/pdfcpu v0.3.13
github.com/playwright-community/playwright-go v0.2000.1
github.com/tidwall/gjson v1.16.0
github.com/tidwall/sjson v1.2.5
)
require (
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/hhrutter/lzw v0.0.0-20190829144645-6f07a24e8650 // indirect
github.com/hhrutter/tiff v0.0.0-20190829141212-736cae8d0bc7 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect
golang.org/x/text v0.3.6 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
(but even after taking the github version, it's the same - i think it's the same content / versions anyway)
Otherwise in the logs i have
GotLogin
Fetching Library
Fetching page:1
(huge JSON)
Fetching page:2
{"status":true,"data":[],"pagination_limit":120,"pagination_page":2,"pagination_page_total":-1,"pagination_total":-1}
Loading HTML template
Resolved working directory to:
(small JSON with ID and month and issue)
Checking if issue exists: (full path)
Downloading issue: (full name)
...
@SR-G please check the latest commit?
Thanks. It's again way, way better. But i now have another error at a later step :
(...)
ID: 86
Source https://cdn2.audiencemedia.com/<several IDs>.pdf
ID: 87
Removing extra pages failed with pdfcpu: please provide the correct password
.retrying after error: pdfcpu: please provide the correct password
(...)
And indeed, while this script is running, all the temporary .PDF (inside the issue/ folder) have a password (if i try to open one with evince : i can't). They however have a "regular" size (= are not empty, ...), like several hundeds of kb.
The resulting / final PDF in the end is sadly empty (0 bytes).
My config file is just :
{
"username":"XXXXXXXXXXXXXXXXXXXXXXXX",
"password":"XXXXXXXXXXXXXXXXXXXXXXXX",
"chromepath":"/usr/bin/google-chrome-stable",
"fingerprint":"XXXXXXXXXXXXXXXXXX"
}