mirror of
https://github.com/openzim/zimit.git
synced 2025-09-23 03:52:16 -04:00
Merge pull request #309 from openzim/wait_until_choices
Fix `--waitUntil` crawler options
This commit is contained in:
commit
ae6e5ffaf6
@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fix support for Youtube videos (#291)
|
- Fix support for Youtube videos (#291)
|
||||||
|
- Fix crawler `--waitUntil` values (#289)
|
||||||
|
|
||||||
## [1.6.3] - 2024-01-18
|
## [1.6.3] - 2024-01-18
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ and then calls the Node based driver
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import atexit
|
import atexit
|
||||||
import itertools
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import shutil
|
import shutil
|
||||||
@ -120,10 +119,6 @@ class ProgressFileWatcher:
|
|||||||
|
|
||||||
|
|
||||||
def run(raw_args):
|
def run(raw_args):
|
||||||
wait_until_options = ["load", "domcontentloaded", "networkidle"]
|
|
||||||
wait_until_all = wait_until_options + [
|
|
||||||
f"{a},{b}" for a, b in itertools.combinations(wait_until_options, 2)
|
|
||||||
]
|
|
||||||
parser = ArgumentParser(
|
parser = ArgumentParser(
|
||||||
description="Run a browser-based crawl on the specified URL and convert to ZIM"
|
description="Run a browser-based crawl on the specified URL and convert to ZIM"
|
||||||
)
|
)
|
||||||
@ -143,8 +138,8 @@ def run(raw_args):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--waitUntil",
|
"--waitUntil",
|
||||||
help="Puppeteer page.goto() condition to wait for before continuing. One of "
|
help="Puppeteer page.goto() condition to wait for before continuing. One of "
|
||||||
f"{wait_until_options} or a comma-separated combination of those.",
|
"load, domcontentloaded, networkidle0 or networkidle2, or a "
|
||||||
choices=wait_until_all,
|
"comma-separated combination of those.",
|
||||||
default="load",
|
default="load",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user