GithubHelp home page GithubHelp logo

theaxedude / zinigo Goto Github PK

View Code? Open in Web Editor NEW
44.0 8.0 7.0 176.38 MB

Utility to backup magazines from the Zinio service as PDF, bypassing/Removing their DRM.

License: MIT License

Go 92.97% HTML 2.94% PowerShell 2.12% Shell 1.97%
magazines pdf drm removal drm-bypass zinio zinigo magazine save

zinigo's People

Contributors

jessienab avatar theaxedude avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zinigo's Issues

Does this project still work?

Hi,
Could you tell me if this project still works please as my download doesnt seem to be logging in,
when i run the executable on windows 10 i get the following,
'Starting the application...
Found 0 issues in library.
Loading HTML template
Terminating the application...'

google-chrome command works on its own also and loads chrome.
i changed the password to see if it gave me an error saying incorrect password but it didnt.
thanks

10 issue limitation?

I was able to download for 10 issues in my library, but then the app stops. My Zinio library probably has close to 100 issues, so I'm not sure why its stopping at 10. When the app runs it says "Found 10 issues in library." I also tried to "archive" within Zinio all of the newest issues that were already downloaded to see if it might then catch the next 10 most recent. But it still only sees 10 and says those issues were already downloaded and found.

Problem with template.html

Other than the problems with password protection it has been working fine until I got the following

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: C:\temp\zinigo
{578657 Issue Fifty Seven {Darkside Magazine 0} }
Checking if issue exists: C:\temp\zinigo\issue\Darkside Magazine - Issue Fifty Seven.pdf
Downloading issue: Darkside Magazine - Issue Fifty Seven
panic: runtime error: index out of range [0] with length 0

What should template.html look like - I tried creating a dummy one but it didn't make a difference

Step-by-Step FAQ?

Is there a step by step FAQ on how to use this? TheAxeDude was supposed to create one but never did. Did anyone else?

Some pdfs downloaded is password protected.

I'm using fork branch fixgetpages from @motoyugota , it works most of the time, thank you very much, it helps me a lot.
I subscribe to a magazine but several issue of the magazine can't be combine to one pdf. The error is as follows.

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

And the pages downloaded is all password protected. I can't see any patten, seems random, totally.
An example of the password protected pdf looks like this. And if I skip the password protected issues, other issues can be downloaded quite fine.
618519_0.pdf

         Someone mentioned it in another bug report:
(...)
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"
}

Originally posted by @SR-G in #34 (comment)

cmd.Run() failed with exec: "C:" file does not exist

Chrome's path has been set correctly, and the program is running as an administrator, but an error occurred when starting to download the issue:
cmd.Run() failed with exec: "C:" file does not exist. You should retry this page.Source

panic: Get "": unsupported protocol scheme ""

I started using ZiniGo today. At first, I would get an error message about the connection being terminated, once forcely from the host, and I would just try again. However, I now get this error message.

Checking if issue exists: E:\Zinio/issue/[name].pdf
Issue already found: E:\Zinio/issue/[name].pdf
.....
Checking if issue exists: E:\Zinio/issue/[name].pdf
Downloading issue: [name]
Source
ID: 0
panic: Get "": unsupported protocol scheme ""

goroutine 1 [running]:
main.main()
C:/projects/ZiniGo/Grabazine.go:124 +0x2439

E:\Zinio>

C:/projects doesn't exist for me so that folder must be on your end, though I suspect it has nothing to do with this issue. I am not using any special paramaters and I tried without and with config.json. Windows 10, build 20H2. Binary, not compiled.

Symbol not found: _clock_gettime (Zinigo_Macos_Intel)

I'm getting the following error from running the prebuilt MacOS Intel version:

dyld: Symbol not found: _clock_gettime
Referenced from: /pathname_to_executable/Zinigo_Macos_Intel
Expected in: flat namespace

Trace/BPT trap

Index out of range

Hi,

I just came across the following error:

Starting the application...
panic: runtime error: index out of range [2] with length 0

goroutine 1 [running]:
main.GetInitialToken(0x945980, 0xc0000ce008, 0xc0000cb3e8, 0x1)
C:/projects/ZiniGo/Grabazine.go:247 +0x267
main.main()
C:/projects/ZiniGo/Grabazine.go:72 +0x3af

I currently have 531 magazines in my library - is there a limitation?

Thanks.

Forward slashes instead of backslashes

The Windows x64 version doesn't seem to work even if you have Chrome is the same directory.

The commands it's giving don't seem to be valid on Windows filesystems and it exits with a failure.

[GoogleChromePortable.exe --headless --disable-gpu --print-to-pdf=D:\Downloads\Zinigo/issue/556768_98.pdf --no-margins D:\Downloads\Zinigo/issue/556768_98.html]
Source  https://cdn2.audiencemedia.com/3be76cc016a8c850661956c5f71d14c621cf6a69_207/d427614b4348298b86aa863510fedc606ec0b04d8f6c5900421bcf6ff7319801/6f61e0310b2f99ad60357765de2526e47ca04806c4e41ee4b6abf0ea2e3830ff.svg
ID:  99
[GoogleChromePortable.exe --headless --disable-gpu --print-to-pdf=D:\Downloads\Zinigo/issue/556768_99.pdf --no-margins D:\Downloads\Zinigo/issue/556768_99.html]
Removing extra pages failed with open D:\Downloads\Zinigo/issue/556768_99.pdf: The system cannot find the file specified.
.retrying after error: open D:\Downloads\Zinigo/issue/556768_99.pdf: The system cannot find the file specified.
Terminating the application...

Specify number of issues to download.

Is there any way to specify the number of issues to download? Say I subscribe to 6 magazines. Each month I would like to download only six issues and stop. Currently it just continues. downloading until it downloads everything it finds. or is stopped manually.

Getting an invalid JSON Web Token error

Hello, I just ran the latest binary Zinigo_Windows_x64.exe on my Windows 11 64bit system and am getting the following error:

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

Pdfs are zoomed in too close

I am able to run the program, get the pages, and have a full issue of a magazine created in pdf. However, each page shows only the upper left corner of the magazine page - in other words, it is zoomed in too much on the corner.

Random Downloads

Hello. Can you please tell if you happened to write up a step-by-step guide? I kind of got ZiniGo working, but it does not download the items from my Zinio downloaded magazines. I am not sure why it is downloading what it is downloading, it seems to be downloading random items. I am sure I have done something wrong, just not sure what I have done. Thank you for your help and for making this program.

Edit: ZiniGo seems to be downloading all magazines related to my account including archived.

Using Windows 10, at the command prompt in the same directory as the ZinioGo and chrome.exe (copied the chrome application folder to this location), I am executing the following:
zinigo -u=[email protected] -p=MyPassword [-c=/D:/Download/Zinio/chrome.exe]

image

Possible to use it with partners?

There are a few partners of Zinio which use there own layout but with the backend of zinio. Maybe is it useful to add the url also to the config file.

AccessToken missing from LoginResponse

Nifty bit of code that I want to see work, but unless I'm missing something, they've changed the login response since you've last updated. The nature of API's I guess :/

I've been tinkering with your source and in the login response I'm seeing a data structure like this:

{"data":{"user":{"allow_adult_content":true,"default_currency_code":"USD","default_locale_code":"en_US","default_newsstand_id":101,"country_code":"US","first_name":null,"email":"[email protected]","user_id_string":"2357563771234567891","user_external_id":"[email protected]"}},"status":true}

Subsequent requests throw 401 errors because the access_token is missing in the json response of the login request. Not sure where to go from there.

Chrome isn't opening.

Error message:

cmd.Run() failed with exec: "google-chrome": executable file not found in %PATH%

I tried in the both ways, using the config.json and via the path [-c=], both result the same error.

What can be my mistake here?

"Unable to read location" error on Linux

I downloaded Zinigo_Linux_AMD64 from https://github.com/TheAxeDude/ZiniGo/tree/master/built, renamed it, and did a chmod +x. I also downloaded template.html from the same URL.

I run it using the following command line:

> ./zinigo -u xxx -p password -c google-chrome-stable

After reading the entire list of magazines, it starts to try to read them, and I get the same error for all my magazines:

Resolved working directory to: /home/xxx/Downloads
{630607 March/April 2024 {FineScale Modeler 0}  }
Checking if issue exists: /home/xxx/Downloads/issue/FineScale Modeler - March_April 2024.pdf
Unable to read location - check permissions: /home/xxx/Downloads/issue/FineScale Modeler - March_April 2024.pdf
Issue already found: /home/xxx/Downloads/issue/FineScale Modeler - March_April 2024.pdf

I've checked the permissions on /home/xxx/Downloads/issue/, and changed them from 600 to 666 with no effect.

I've tried using Brave, which is a Chrome based browser, to no effect.

The -playwright option doesn't work for this version, and the latest (v1.3) has other issues.

I'm not a Go dev, so I'm not good enough to debug this and propose a fix.

Limit the number of issues to download

Hi,

I've been using Zinio for a very long time and have subscriptions that go back +5 years. The script is now downloading issues from 2020.
It would be nice to limit the number of issues that will be downloaded. I think that a hard date limit would be a good start.

Thx

Application terminates without downloading anything

Hi,

up until recently, the program worked fine. I tried to download the newest issues today and the app terminated without doing anything ("Terminating the application...").

Any idea if Zinio changed their web service?

Thanks

Cool project bull nill pointer deref

Hello,
It's a nice little project and I'd like to use it.
So far there is a nil pointer deref in the GetLibrary function,
I believe it has to do with the read all that does not read anything due to a bad response from the Zinio API but it is just a guess...

I'm not good at Go (or at programming for that matter) either but maybe it would be nice to get the API urls out of the code because they tend to evolve quite a lot ?

Anyway I encourage you to keep working on this because I'm sure there is plenty of people that would find it useful.

Have a nice day.

cmd.Run() failed with exec: "D:\x00": file does not exist

D:\zinigo>Zinigo_Windows_x64.exe
Config file loaded
Username taken from config file
password taken from config file
chromepath taken from config file
Loading HTML template
Resolved working directory to: D:\zinigo
Checking if issue exists: D:\zinigo/issue/Seventeen - December_January 2017.pdf
Downloading issue: Seventeen - December_January 2017
Source https://cdn2.audiencemedia.com/var/site_869/storage/issues/83/svg/page-002.svg
ID: 0
[D: --headless --disable-gpu --print-to-pdf=D:\zinigo/issue/47889_0.pdf --no-margins D:\zinigo/issue/47889_0.html]
cmd.Run() failed with exec: "D:\x00": file does not exist
. You should retry this page.Source https://cdn2.audiencemedia.com/var/site_869/storage/issues/83/svg/page-003.svg
ID: 1
[D: --headless --disable-gpu --print-to-pdf=D:\zinigo/issue/47889_1.pdf --no-margins D:\zinigo/issue/47889_1.html]
cmd.Run() failed with exec: "D:\x00": file does not exist
. You should retry this page.Source https://cdn2.audiencemedia.com/var/site_869/storage/issues/83/svg/page-004.svg

app crashes after 306 issues

Hi

I have a relative large library and your last improvement to download more than 10 issues really made a difference. Never the less after 306 issues, the app crashes with the following message (windows version)

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x7b6a1f]

goroutine 1 [running]:
main.fileExists(0xc0014f45b0, 0x69, 0x6)
C:/projects/ZiniGo/Grabazine.go:308 +0x9f
main.main()
C:/projects/ZiniGo/Grabazine.go:106 +0xa4d

I now have 306 files in my issue folder and if I restart the app, it will list all of them as already downloaded and then crash with above message.

Thanks

pdfcpu password issue

I get the following error on the new build:

retrying after error: pdfcpu: please provide the correct password

And the pdf issues are created with a zero byte size.

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

Error when trying to download magazines: "index out of range"

Description:
I encountered an error while attempting to download magazines I purchased using ZiniGo. When I run the executable with my credentials, the program crashes with a "panic: runtime error: index out of range [2] with length 0" message.

Steps to Reproduce:

Downloaded the Windows x64 version of ZiniGo.
Ran the program using the command: Zinigo_Windows_x64.exe -u=[email protected] -p=mypassword (Note: These aren't my real credentials).
Observed the error shortly after the program started.
Expected Behavior:
I anticipated the program would download my magazines without errors.

Actual Behavior:
The program crashed with a message:

panic: runtime error: index out of range [2] with length 0
goroutine 1 [running]:
main.GetInitialToken(0x8f9060, 0xc000006018, 0xc000077650, 0x1)
C:/projects/ZiniGo/Grabazine.go:215 +0x267
main.main()

Environment:

Operating System: Windows 11 64-bit (ARM-based processor)
ZiniGo Version: 1.3
Browser: Chrome Version 120.0.6090.0
Additional Information:
I have Chrome installed, and I made sure the path was correct. Not sure if it's related, but wanted to include this information.

Optimized Download Procedure

hey there,
first off - thank you for supplying such a useful app. but i feel like the process could be optimized to take a lot less time.
isnt downloading each svg, then converting them into an html, then into a pdf a very tedious way to do it?
i would think that downloading all the svgs first, then directly putting them into a pdf would be a much more efficient way to handle it.

sadly, im inexperienced with go, so i struggle to do my own tests. but i can say that downloading a single 160 page magazine takes up to 20 minutes, as creating every single pdf page takes about 5 seconds.

let me know what you think of this

Not downloading all the issues

[](url
Screen Shot 2022-01-12 at 8 10 57 PM
)
The program downloaded about 50% of my magazines before stopping on its own, nothing past 2017 was downloaded for some reason.

Filtering out invalid characters in title names

I came across a problem where a magazine issue title has an invalid windows character in it. In my case there is a title that was named for 2 months, for example: "Road & Track - Mar/Apr 2018." So zinigo sees that name isn't in my folder (which it can never be since it has invalid characters for windows) and it starts to download. Once it has all of the individual pages, it goes to consolidate but it can't write the filename since it would have an invalid character. I would actually be ok with this as I can manually regroup, but the problem is that every time I re-start zinigo it will see that title is not present and download it all over again.

For other issues, I've been able to put in dummy names to get it to skip over issues I don't want, but since the title has invalid characters we can never fake that in the folder.

How about using higher svg image quality?

I noticed that there is a q=80 parameter in the SVG URL.
I guess the q means image quality and done a simple test.
I am not sure whether it can affect the final pdf file quality.
If it can, should we use q=100 instead of q=80 or add a quality option in the config file?

<image x="0" y="-1" width="911" height="1206" xlink:href="http://cdn-assets.ziniopro.com/var/site_3184/storage/issues/120/svg/img/page-018-img1.jpg?q=80"/>

I tested both q=80 and q=100 parameters. And the result is below.

image
image

PS attached the original Html file if you need it.
205560_16.html.tar.gz

Sometimes there are random blank pages in the PDF

Sometimes, the resultant pdfs have blank pages in between regular pages.

This seems fairly random, and testing the same document a few times shows it isnt the same pages.

There is a dodgy process performed when printing to PDF via chrome, where we inject the SVG into a HTML page, to remove some of the margins. Sometimes when printing to PDF, the content spills to a second page, and that mostly-blank page needs to be removed.

I suspect there is a race condition between the PDF file being created, and the extra pages being removed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.