Skip to content
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

Invalid Json Web Token #34

Open
ethan-edgelord opened this issue Mar 20, 2023 · 14 comments
Open

Invalid Json Web Token #34

ethan-edgelord opened this issue Mar 20, 2023 · 14 comments

Comments

@ethan-edgelord
Copy link

ethan-edgelord commented Mar 20, 2023

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"}}

@hamorillo
Copy link

Same issue here

@planalp
Copy link

planalp commented May 14, 2023

I also received this error.
? ^::^

@MotObv
Copy link

MotObv commented May 28, 2023

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.)

@mugurelu
Copy link

mugurelu commented Jul 9, 2023

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

@TheAxeDude
Copy link
Owner

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.

@hieronymousch
Copy link

Same problem, not a device limit issue (one 1/5 used for me).

@hieronymousch
Copy link

(everyting worked fine until last week).

@SR-G
Copy link

SR-G commented Aug 15, 2023

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...

@potterface
Copy link

potterface commented Aug 27, 2023

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...

@hieronymousch
Copy link

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 ;)

@TheAxeDude
Copy link
Owner

TheAxeDude commented Sep 4, 2023

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!

@SR-G
Copy link

SR-G commented Sep 4, 2023

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)
...

@TheAxeDude
Copy link
Owner

@SR-G please check the latest commit?

@SR-G
Copy link

SR-G commented Sep 6, 2023

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.

image

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"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants