diff options
author | Evgeny Sorokin <me@ch1p.io> | 2024-06-26 01:31:28 +0300 |
---|---|---|
committer | Evgeny Sorokin <me@ch1p.io> | 2024-06-26 01:31:28 +0300 |
commit | 42295b7b0ac18c4ad6a28396e04802fb22031549 (patch) | |
tree | f80441c0ac5ffa839544738bc84bb960c18691aa /main.py | |
parent | 2db780e2009c43466f718c24895bcfc3b89763f1 (diff) |
add --skip-pages argument
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |