summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorEvgeny Sorokin <me@ch1p.io>2024-06-26 01:31:28 +0300
committerEvgeny Sorokin <me@ch1p.io>2024-06-26 01:31:28 +0300
commit42295b7b0ac18c4ad6a28396e04802fb22031549 (patch)
treef80441c0ac5ffa839544738bc84bb960c18691aa /main.py
parent2db780e2009c43466f718c24895bcfc3b89763f1 (diff)
add --skip-pages argument
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.py b/main.py
index db0c80e..0a2662b 100755
--- a/main.py
+++ b/main.py
@@ -76,11 +76,16 @@ if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('--uuid', type=str, required=True)
parser.add_argument('--output-dir', type=str, required=True)
+ parser.add_argument('--skip-pages', type=int, default=0,
+ help='number of pages to skip')
args = parser.parse_args()
m = fetch_manifest(args.uuid)
page = 0
for c in m['sequences'][0]['canvases']:
+ if args.skip_pages != 0 and page < args.skip_pages:
+ page += 1
+ continue
download_and_merge_image(c['width'], c['height'], extract_uuid(c['@id']), os.path.join(args.output_dir, f'{page}.jpg'))
print(f'{page} done')
page += 1