aboutsummaryrefslogtreecommitdiffstats
path: root/walker.py
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2023-07-12 16:25:49 +0100
committergarret <garret@airmail.cc>2023-07-12 17:14:20 +0100
commit09a68dc0f0008b513b03621d15c483bbb6f5bc29 (patch)
tree30bd504665729e32f9b337f8a18520be29748f71 /walker.py
parentd523b6ee7748745d221c1e53f802563852e565e7 (diff)
downloadcomicwalker-dl-09a68dc0f0008b513b03621d15c483bbb6f5bc29.tar.gz
comicwalker-dl-09a68dc0f0008b513b03621d15c483bbb6f5bc29.tar.bz2
comicwalker-dl-09a68dc0f0008b513b03621d15c483bbb6f5bc29.zip
use the nice features that make life easier
Diffstat (limited to 'walker.py')
-rw-r--r--walker.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/walker.py b/walker.py
index 9c626fa..d98be8f 100644
--- a/walker.py
+++ b/walker.py
@@ -17,7 +17,7 @@ if args.cid == None:
sys.exit()
def start(url, headers):
- meta = json.loads(requests.get(url=url, headers=headers).content)
+ meta = requests.get(url=url, headers=headers).json()
img_url = f'{url}/frames?enable_webp=true'
try:
@@ -36,7 +36,7 @@ def start(url, headers):
undrm(img_url, headers, cid_info)
def undrm(url, headers, cid_info):
- meta = json.loads(requests.get(url=url, headers=headers).content)
+ meta = requests.get(url=url, headers=headers).json()
print('Page count: {}\n'.format(len(meta['data']['result'])))
@@ -67,8 +67,8 @@ def undrm(url, headers, cid_info):
def xor(bin, key):
retval = []
- for i in range(len(bin)):
- retval.append(bin[i] ^ key[i % len(key)])
+ for idx, val in enumerate(bin):
+ retval.append(val ^ key[idx % len(key)])
return bytes(retval)