diff options
author | garret <garret@airmail.cc> | 2023-07-12 16:25:49 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2023-07-12 17:14:20 +0100 |
commit | 09a68dc0f0008b513b03621d15c483bbb6f5bc29 (patch) | |
tree | 30bd504665729e32f9b337f8a18520be29748f71 /walker.py | |
parent | d523b6ee7748745d221c1e53f802563852e565e7 (diff) | |
download | comicwalker-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.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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)
|