athrowaway2021 / comix Goto Github PK
View Code? Open in Web Editor NEWSeamlessly download and de-drm comics and manga from Kindle in highest possible quality
License: MIT License
Seamlessly download and de-drm comics and manga from Kindle in highest possible quality
License: MIT License
Hey so I have made similar python bots to extract comics from apps such as marvel unlimited , manga sites and even Chegg bots.
I tried to make a bot for DC Universe. I was able to sniff the traffic and get the comic pages. But the comic pages of DC Universe are in a .enc format. That is encrypted. I have the asset_keys to unlock it but I don't know how to go about it . Maybe you could help me out?
I found some other requests in the api and I wanted to parse the protobuf but the problem is the response is in protobuf and I don't habe the .proto file to serialise it back. How did you solve this problem?
Similar to #23 ig.
Any help
{"response": {"challenge": {"challenge_reason": "HandleOnWebView", "uri": "https://www.amazon.com/ap/challenge?arb=907e0782-3533-4f52-b9cd-4fa720b9cd84"}}, "request_id": "01c71b7626704011a052af055326954c"}
Traceback (most recent call last):
File "/Users/Kenz/comix/comix.py", line 145, in
cmx = Cmx(sys.argv[1])
File "/Users/Kenz/comix/comix.py", line 23, in init
self.auth_token = amazon_api.login(config.EMAIL, config.PASSWORD)["access_token"]
TypeError: 'NoneType' object is not subscriptable
hello @athrowaway2021
tried this on cmx unlimited titles. comix doesnt work anymore on borrowed titles.
unkindle works on them, but downloads files of lower res.
Eg.
Edens Zero 214 is 18MB on unkindle, but latest comixology app shows the payload to be 74 mb in size. checked the response on the app and the unkindle, the size is different for both.
Is it possible to fix unkindle, so it fetches the HD content which the comixology app seems to show. also this fixes the unlimited titles not available issue.
When I try to run the command I get a "getting auth token" but then get a timeout error. What am I doing wrong?
I've been able to use this before with no issues but now I'm receiving
Could not find any book associated with this account . . .
What should I do.
Hi,
Recently bought a new manage released about a month ago. The file is no longer listed by using comix.py. Old ones still show up. Not sure if amazon changed anything. But thank you already for the work you do!
Regards
R
Thank you for working on the new version and this largely works real well. One error and maybe more to pop up:
Tested on this book B09CS2S3WN and it shows unsupported yjconversion feature. Thank you!
Fixed in 3309195
Originally posted by @athrowaway2021 in #30 (comment)
{"response": {"challenge": {"challenge_reason": "AuthenticationFailed", "uri": "https://www.amazon.com/ap/challenge?arb=14c7afd4-2ad6-4249-8564-cb60fb081415", "required_authentication_method": "GenericClaimPassword"}}, "request_id": "0825dd8f55734e85b7f3a0d7af1a62c2"}
Traceback (most recent call last):
File "/home/fletcher/comix/comix.py", line 142, in <module>
cmx = Cmx(None)
File "/home/fletcher/comix/comix.py", line 23, in __init__
self.auth_token = amazon_api.login(config.EMAIL, config.PASSWORD)["access_token"]
TypeError: 'NoneType' object is not subscriptable
Known good password and email. Works fine with an older version of the script.
Ran with `python comix.py list' after adding account info to config.py
Hi,
Just came back to this script after not using it for quite some time. I came across an error and thought I'd advise how I got around it incase others have the same issue.
After setting up the script as per the README, when trying to run the script I got this issue...
Traceback (most recent call last):
File "/comix/comix.py", line 12, in <module>
import amazon_auth
File "/comix/amazon_auth.py", line 1, in <module>
from Crypto.Cipher import AES
ModuleNotFoundError: No module named 'Crypto'
I found installing PyCryptodome package by running pip install pycryptodome
, and now I get this...
/comix# python comix.py
usage:
comix <item_id>
- Downloads the content for the specified item id
comix list
- Lists all content associated with the current account
👍
Tried to download your method. unfortunately the protobuf doesn't work. Any fix yet ? @athrowaway2021
comix-main % python3 comix.py list
Getting auth token . . .
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1040, in _validate_conn
conn.connect()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connection.py", line 358, in connect
conn = self._new_conn()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x10e28b1c0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/adapters.py", line 440, in send
resp = conn.urlopen(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 785, in urlopen
retries = retries.increment(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.amazon.com', port=443): Max retries exceeded with url: /auth/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10e28b1c0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/tomtom/Downloads/comix-main/comix.py", line 150, in
cmx = Cmx(None)
File "/Users/tomtom/Downloads/comix-main/comix.py", line 23, in init
tokens = amazon_api.login(config.EMAIL, config.PASSWORD)
File "/Users/tomtom/Downloads/comix-main/amazon_api.py", line 118, in login
return refresh(tokens)
File "/Users/tomtom/Downloads/comix-main/amazon_api.py", line 189, in refresh
response_json = requests.post(f"https://api.amazon.com/auth/token", headers=get_auth_headers(tokens["domain"]), json=body).json()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/api.py", line 117, in post
return request('post', url, data=data, json=json, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/sessions.py", line 645, in send
r = adapter.send(request, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.amazon.com', port=443): Max retries exceeded with url: /auth/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10e28b1c0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
[deleted]
So every time I rip a book the pages are massively out of order. Is there anyway to fix this?
Every book I downloaded have the cover as jpg and much lower resolution, is it a bug or is it how amazon handles the new files?
Basically I'm unable to get auth to work. The Comix main script just crashes. Tells me line 24 is trying to iterat on a nontype. Thats the auth line. So I tried to coax amazon_auth.py into doing something. it gave me this error
{"response": {"error": {"code": "CredentialError", "message": "The input credential is invalid."}}, "request_id": "1f979a34-a6ac-40c6-8e4b-2f88a89675a6"}
Could not login!
I ran it like this
python amazon_auth.py email password com
of note I have to escape the special characters in my password, but I don't think it matters as it worked before.
Edit: So I have confirmation from two others the script is busted with the same error out.
Edit 2: I noticed here #15 (comment)
They had a similar issue, but I don't have 2FA on.
I keep having a TypeError: Couldn't parse file content! I am using the correct format for the auth_token and my protobuf is 3.14.0. What am I doing wrong?
Traceback (most recent call last):
File "/comixology/comix/comix.py", line 13, in <module>
import comix_pb2
File "/comixology/comix/comix_pb2.py", line 16, in <module>
DESCRIPTOR = _descriptor.FileDescriptor(
File "/usr/lib/python3.9/site-packages/google/protobuf/descriptor.py", line 965, in __new__
return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: Couldn't parse file content!
Is this tool just broken now or did I miss a step?
Just went to test this in a VM and it works fine on Windows but not Linux.
(This is a Linux issue)
Hi, is there any way to get the comics purchased by amazon? In my country, national comics are not distributed by comixology, only by amazon. And the quality varies by device, on PC the quality is ridiculous, on tablets and android phones a little better, but they never reach the file size indicated on the amazon page, I believe that only Apple users can get the maximum quality. Thanks in advance!
And I'm sorry for my bad English.
Comix works with most titles however there seems to be problems with manga published by Kodansha?. Both "Hozuki's Coolheadedness" and "Kino's Journey" cannot be saved.
# python3 comix.py 871492
871492 : Kino's Journey - v06
Downloading page 000 . . .Traceback (most recent call last):
File "/home/user/Downloads/comix-main/comix.py", line 138, in <module>
cmx.download()
File "/home/user/Downloads/comix-main/comix.py", line 114, in download
zf.extractall(content_folder, pwd=image_key)
File "/usr/local/lib/python3.9/dist-packages/pyzipper/zipfile.py", line 2106, in extractall
self._extract_member(zipinfo, path, pwd)
File "/usr/local/lib/python3.9/dist-packages/pyzipper/zipfile.py", line 2159, in _extract_member
with self.open(member, pwd=pwd) as source, \
File "/usr/local/lib/python3.9/dist-packages/pyzipper/zipfile.py", line 2013, in open
return self._open_to_read(mode, zinfo, pwd)
File "/usr/local/lib/python3.9/dist-packages/pyzipper/zipfile.py", line 2024, in _open_to_read
raise e
File "/usr/local/lib/python3.9/dist-packages/pyzipper/zipfile.py", line 2021, in _open_to_read
return self.zipextfile_cls(zef_file, mode, zinfo, True, pwd)
File "/usr/local/lib/python3.9/dist-packages/pyzipper/zipfile.py", line 1203, in __init__
self.read_init()
File "/usr/local/lib/python3.9/dist-packages/pyzipper/zipfile.py", line 1218, in read_init
self._decrypter = self.get_decrypter()
File "/usr/local/lib/python3.9/dist-packages/pyzipper/zipfile.py", line 1306, in get_decrypter
decrypter = self._decrypter_cls(
File "/usr/local/lib/python3.9/dist-packages/pyzipper/zipfile_aes.py", line 61, in __init__
raise RuntimeError("Bad password for file %r" % zinfo.filename)
RuntimeError: Bad password for file 'COMIXOLOGY_BOOK_ENCRYPTED_HD_0001.jpg'
I don't have this issue with volumes from other publishers so far.
Whenever I am trying to download books using the tool, i am getting no output at all. And when I tried using the old tool, it gave the following error:
File "G:\comix-main (old)\comix.py", line 13, in <module>
import comix_pb2
File "G:\comix-main (old)\comix_pb2.py", line 16, in <module>
DESCRIPTOR = _descriptor.FileDescriptor(
File "C:\Users\anon\anaconda3\lib\site-packages\google\protobuf\descriptor.py", line 982, in __new__
return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: Couldn't parse file content!
Hello, I know this isn't a comix related bug or issue per-se, but can't find a better way/place to discuss it, apologize for it in advance!
I had a book that was released back in August 2021, way before the switch to the new framework and such.
It was 28MB, but when I download it again now, its 63MB.
I know Amazon did increase the newer title's image quality to 97 at the end of June 2023, but it seems they also messed with their previous files as well.
Question: is there any way to get the result of those earlier settings (lower file size, less quality etc) without manually going through the downloaded images via Magick or any other converter?
Thank you.
Is there a way to list recent comics bought from Amazon/Kindle? When I run the program, only Comixology comics are listed.
After getting the newest version I get this error:
File "...comix.py", line 73, in get_comic
if publisher_id == "274" or publisher_id == "281":
UnboundLocalError: local variable 'publisher_id' referenced before assignment
I fixed it as such:
if self.publisher_id == "274" or self.publisher_id == "281":
self.publisher_id = "6670"
This made it work, but without this it did not
When I use "python3 comix.py list" to show a list of the items I own, it always caps out at 700 (the perils of both buying a lot and buying a lot of free items). My library is larger than 700, so I'm not always seeing the items I want, which is typically ones I've just purchased.
Is this a limit that's built into the script, or something from Amazon's end? The 700 items it reports aren't always the same, either, although it does tend to show items purchased first near the top of the list (but not all of them). I just bought a comic a few days ago, and it shows up at the moment, but others purchased the same day don't, and tomorrow those "missing" items might appear but the one showing now might not. Is there any way to increase this so that the list is complete?
Is it possible for the tool to output .png image files instead of .jpg?
DESCRIPTOR = _descriptor.FileDescriptor( File "/Library/Python/3.8/site-packages/google/protobuf/descriptor.py", line 942, in __new__ return _message.default_pool.AddSerializedFile(serialized_pb) TypeError: Couldn't parse file content!
Any help? Tried downgrading protobuf didn't work :(
New install, got the Auth Token form the app (atna%EwICIILCqsLMlH67Vyhv1 ....)
No problem with comix.py, but with unkindle.py i have tis problem:
PS X:x\comix-main> python unkindle.py list
Authenticating . . .
Could not acquire the manifest!
PS X:x\comix-main> python unkindle.py B08CSYTX83
Authenticating . . .
download size: 12MB
Downloading the book . . 83%
Extracting . . .
B08CSYTX83 : Ecos- Caminhos desencontrados
Traceback (most recent call last):
File "X:x\comix-main\unkindle.py", line 154, in
kindle.download()
File "X:x\comix-main\unkindle.py", line 137, in download
book.extract_to_folder(content_folder, f"{self.release_name} - p")
File "X:x\comix-main\yj_to_folder.py", line 259, in extract_to_folder
self.process_content(self.get_fragment(ftype="$608", fid=page_templates[0]))
File "X:x\comix-main\yj_to_folder.py", line 137, in process_content
self.process_content_list(story, num)
File "X:x\comix-main\yj_to_folder.py", line 123, in process_content_list
self.process_content(_content, num)
File "X:x\comix-main\yj_to_folder.py", line 139, in process_content
self.process_content_list(content, num)
File "X:x\comix-main\yj_to_folder.py", line 123, in process_content_list
self.process_content(_content, num)
File "X:x\comix-main\yj_to_folder.py", line 139, in process_content
self.process_content_list(content, num)
File "X:x\comix-main\yj_to_folder.py", line 123, in process_content_list
self.process_content(_content, num)
File "X:x\comix-main\yj_to_folder.py", line 139, in process_content
self.process_content_list(content, num)
File "X:x\comix-main\yj_to_folder.py", line 123, in process_content_list
self.process_content(_content, num)
File "X:x\comix-main\yj_to_folder.py", line 227, in process_content
raw_media = self.book_data["$417"] [resource["$165"]]
KeyError: '$165'
PS X:x\comix-main>
Hi,
When I try to download a comic book I purchased, I receive this error
D:\comix-main>python comix.py 1005546
Getting auth token . . .
1005546 : Fence- Rise
Downloading page 000 . . .Traceback (most recent call last):
File "D:\comix-main\comix.py", line 155, in
cmx.download()
File "D:\comix-main\comix.py", line 131, in download
zf.extractall(content_folder, pwd=image_key)
File "C:\Users\miste\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyzipper\zipfile.py", line 2106, in extractall
self._extract_member(zipinfo, path, pwd)
File "C:\Users\miste\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyzipper\zipfile.py", line 2159, in _extract_member
with self.open(member, pwd=pwd) as source,
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\miste\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyzipper\zipfile.py", line 2013, in open
return self._open_to_read(mode, zinfo, pwd)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\miste\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyzipper\zipfile.py", line 2024, in _open_to_read
raise e
File "C:\Users\miste\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyzipper\zipfile.py", line 2021, in _open_to_read
return self.zipextfile_cls(zef_file, mode, zinfo, True, pwd)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\miste\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyzipper\zipfile.py", line 1203, in init
self.read_init()
File "C:\Users\miste\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyzipper\zipfile.py", line 1218, in read_init
self._decrypter = self.get_decrypter()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\miste\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyzipper\zipfile.py", line 1306, in get_decrypter
decrypter = self._decrypter_cls(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\miste\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyzipper\zipfile_aes.py", line 61, in init
raise RuntimeError("Bad password for file %r" % zinfo.filename)
RuntimeError: Bad password for file 'COMIXOLOGY_BOOK_ENCRYPTED_HD_0001.jpg'
this gives me an error that it cant get past the 2fa screen.
Getting this error when trying to fetch titles from the publisher Animate International Co., Ltd. Have tried the solution suggested in #39 and it returns publisher_id as 469 which does not overlap with the others but still doesn’t work. Any ideas?
How do I download books borrowed from kindle/comixology unlimited
Have tried this with multiple Viz Media titles and it works with none of them. I get this error.
File "/opt/homebrew/lib/python3.10/site-packages/pyzipper/zipfile.py", line 2106, in extractall
self._extract_member(zipinfo, path, pwd)
File "/opt/homebrew/lib/python3.10/site-packages/pyzipper/zipfile.py", line 2159, in _extract_member
with self.open(member, pwd=pwd) as source,
File "/opt/homebrew/lib/python3.10/site-packages/pyzipper/zipfile.py", line 2013, in open
return self._open_to_read(mode, zinfo, pwd)
File "/opt/homebrew/lib/python3.10/site-packages/pyzipper/zipfile.py", line 2024, in _open_to_read
raise e
File "/opt/homebrew/lib/python3.10/site-packages/pyzipper/zipfile.py", line 2021, in _open_to_read
return self.zipextfile_cls(zef_file, mode, zinfo, True, pwd)
File "/opt/homebrew/lib/python3.10/site-packages/pyzipper/zipfile.py", line 1203, in init
self.read_init()
File "/opt/homebrew/lib/python3.10/site-packages/pyzipper/zipfile.py", line 1218, in read_init
self._decrypter = self.get_decrypter()
File "/opt/homebrew/lib/python3.10/site-packages/pyzipper/zipfile.py", line 1306, in get_decrypter
decrypter = self._decrypter_cls(
File "/opt/homebrew/lib/python3.10/site-packages/pyzipper/zipfile_aes.py", line 61, in init
raise RuntimeError("Bad password for file %r" % zinfo.filename)
RuntimeError: Bad password for file 'COMIXOLOGY_BOOK_ENCRYPTED_HD_0001.jpg
when i type in py comix.py or add any arguments it only outputs the auth token and wont do anything else
So when listing out my titles I don't see an issue from a new title I just bought. It was the first issue I'd bought of this title. Is the list of titles cached somewhere? Or is there an alternative way to get the id number of the titles to just feed to the command?
Thanks.
Traceback (most recent call last):
File "/Users/xxxxxx/comix/unkindle.py", line 9, in
from third_party.ion import DrmIon,DrmIonVoucher
File "/Users/xxxxxx/comix/third_party/ion.py", line 33, in
from Crypto.Cipher import AES
ModuleNotFoundError: No module named 'Crypto'
Verified that pycryptodome is installed. All modules in requirements.txt are installed
The program cannot find any of my comics, how do I solve this?
It seems that for some books, the encoding mechanism might be a little bit different. Because this takes specific comic books to debug, more than happy to work privately on those cases The trace is as follows:
Getting auth token . . .
48386 : Fables - v07
Downloading page 000 . . .Traceback (most recent call last):
File "[Redacted]\comix.py", line 150, in
cmx.download()
File "[Redacted]\comix.py", line 126, in download
zf.extractall(content_folder, pwd=image_key)
File "[Redacted]\AppData\Roaming\Python\Python310\site-packages\pyzipper\zipfile.py", line 2106, in extractall
self._extract_member(zipinfo, path, pwd)
File "[Redacted]\AppData\Roaming\Python\Python310\site-packages\pyzipper\zipfile.py", line 2159, in _extract_member
with self.open(member, pwd=pwd) as source,
File "[Redacted]\AppData\Roaming\Python\Python310\site-packages\pyzipper\zipfile.py", line 2013, in open
return self._open_to_read(mode, zinfo, pwd)
File "[Redacted]\AppData\Roaming\Python\Python310\site-packages\pyzipper\zipfile.py", line 2024, in _open_to_read
raise e
File "[Redacted]\AppData\Roaming\Python\Python310\site-packages\pyzipper\zipfile.py", line 2021, in _open_to_read
return self.zipextfile_cls(zef_file, mode, zinfo, True, pwd)
File "[Redacted]\AppData\Roaming\Python\Python310\site-packages\pyzipper\zipfile.py", line 1203, in init
self.read_init()
File "[Redacted]\AppData\Roaming\Python\Python310\site-packages\pyzipper\zipfile.py", line 1218, in read_init
self._decrypter = self.get_decrypter()
File "[Redacted]\AppData\Roaming\Python\Python310\site-packages\pyzipper\zipfile.py", line 1306, in get_decrypter
decrypter = self._decrypter_cls(
File "[Redacted]\AppData\Roaming\Python\Python310\site-packages\pyzipper\zipfile_aes.py", line 61, in init
raise RuntimeError("Bad password for file %r" % zinfo.filename)
RuntimeError: Bad password for file 'COMIXOLOGY_BOOK_ENCRYPTED_HD_0001.jpg'
I don't have the 2FA turned on on my amazon account, but this error message appears when I try to use unkindle.py:
Amazon needs to reconfirm your identity with 2FA. Please logout and login again in your browser.
'NoneType' object is not subscriptable
Traceback (most recent call last):
File "D:\User\Downloads\comix\comix-main\unkindle.py", line 186, in
kindle = Kindle(args.asin, hdv_png=not args.jpeg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\User\Downloads\comix\comix-main\unkindle.py", line 26, in init
raise Exception("Could not authenticate!")
Exception: Could not authenticate!
2FA is off, logged out and logged in several times, same error message.
would it be possible to use this tool to remove DRM from the Marvel Comics downloaded from the self named App (not Marvel Unlimited)?
The comic downloads as individual page files, actually two per page. one is an encrypted Compress file and other file is very small about 40KB
remove the file extension so see there original format.
781224-1-t.txt
781224-1-f.txt
If you have MFA enabled, the first login using email + password will fail but then you should get the text message, and you need to reenter email + password concatenated with the 6 digit code. I confirmed this works.
We should be able to handle this more elegantly - not sure if the login failure has any code that indicate MFA is enabled or not, if so, we can prompt for the MFA code and add it to the PW. We need to make sure that if we're caching the PW for future sessions to store the version that does not concatenate with the MFA code.
(I might mess with trying to get this to work properly)
This has worked mostly well with the books I have attempted, except for this one: B0BPX4YJ8V
Microsoft Windows [Version 10.0.22631.3085]
(c) Microsoft Corporation. All rights reserved.
D:\comix-main>python unkindle.py B0BPX4YJ8V
Authenticating . . .
Logged in with saved state
Authenticated!
Download size: 124MB
Downloading the book . . . 97%
Extracting . . .
Traceback (most recent call last):
File "D:\comix-main\unkindle.py", line 188, in <module>
kindle.download(args.output, args.keep_temp)
File "D:\comix-main\unkindle.py", line 138, in download
metadata = self.book.get_metadata()
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comix-main\third_party\kfxlib\yj_book.py", line 156, in get_metadata
if self.has_metadata() and self.has_cover_data():
^^^^^^^^^^^^^^^^^^^
File "D:\comix-main\third_party\kfxlib\yj_metadata.py", line 246, in has_metadata
self.fragments.get(YJFragmentKey(ftype="$258")) is not None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comix-main\third_party\kfxlib\yj_container.py", line 322, in get
raise KeyError("YJFragmentList get has multiple matches for %s: %s" % (repr(key), list_symbols(matches)))
KeyError: 'YJFragmentList get has multiple matches for $258::: $258::, $258::'
D:\comix-main>
I have tried to delete the output folder it created, then retrying the process from the start, but continue to get the same error each time. It seems to always happen after the "download" gets to 97% and begins to extract, then error.
Other books before this one and after, have not received any errors on my end. My script knowledge is extremely limited so I don't know how to troubleshoot.
Still Getting 2FA error. I'm still getting "Could not get auth token" error, even after login/logout in my account and running the program again:
C:\comix-main>python comix.py list
Getting auth token . . .
{"response": {"challenge": {"challenge_reason": "HandleOnWebView", "uri": "https://www.amazon.com/ap/challenge?arb=370d12b1-17b0-4720-b6be-c2f4d779cef3"}}, "request_id": "01cd1df43kilokh521548c0132066"}
Amazon needs to reconfirm your identity with 2FA. Please logout and login again in your browser.
Traceback (most recent call last):
File "C:\comix-main\comix.py", line 152, in
cmx = Cmx(None)
^^^^^^^^^
File "C:\comix-main\comix.py", line 27, in init
raise Exception("Could not get auth token")
Exception: Could not get auth token
Hi!
I tried running your code, and I got the following error:
Traceback (most recent call last):
File "/comix/comix.py", line 13, in <module>
import comix_pb2
File "/comix/comix_pb2.py", line 16, in <module>
DESCRIPTOR = _descriptor.FileDescriptor(
File "/usr/local/lib/python3.9/site-packages/google/protobuf/descriptor.py", line 965, in __new__
return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: Couldn't parse file content!
I run the code on a docker container:
$ docker -ti python bash
# git clone 'https://github.com/athrowaway2021/comix.git'
# cd comix/
# pip install -r requirements.txt
# apt update; apt install vim
# vim config.py # For setting the AUTH_TOKEN
# python comix.py
I think the problem has to do with serialized_pb
being invalid in comix_pb2.py
at line 22.
Let me know if there is any other information that I can give you or if I am doing something wrong.
I tried to troubleshoot this by running git bisect
but I found no solution whatsoever. Since the application seem to be working for other people the only thing that comes to mind is that the problem might be related to the dependencies' versions.
These are the versions of the dependencies that I have installed by running pip install -r requirements.txt
in both a completely new virtualenv in my local machine (python --version
is Python 3.8.0
) and the docker container pulled from python/latest (python --version
is Python 3.9.4
). In both cases pip installs the same version for the dependencies.
$ pip freeze
certifi==2020.12.5
chardet==4.0.0
idna==2.10
protobuf==3.15.8
pycryptodomex==3.10.1
pyzipper==0.3.5
requests==2.25.1
six==1.15.0
urllib3==1.26.4
Let me know if you have older versions installed.
.
python3.8 comix.py list
returns no result
After some debugging I found that get_issue_infos() receives a reply:
b'\n\x0f\x08\x01\x12\x0bNo ids sent'
even if there are ids given and correctly get by print_list() function.
It looks that maybe ids format is changed in API?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.