From 0e3c4273714e0a24c92a197ac87fc382d8a07d5e Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Mon, 27 Feb 2023 10:30:06 +0100 Subject: [PATCH] Bump version to v0.4.3 for release --- src/auto_archiver/enrichers/screenshot_enricher.py | 6 +++--- src/auto_archiver/version.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/auto_archiver/enrichers/screenshot_enricher.py b/src/auto_archiver/enrichers/screenshot_enricher.py index 3c768f6..8b9e3c5 100644 --- a/src/auto_archiver/enrichers/screenshot_enricher.py +++ b/src/auto_archiver/enrichers/screenshot_enricher.py @@ -14,7 +14,8 @@ class ScreenshotEnricher(Enricher): return { "width": {"default": 1280, "help": "width of the screenshots"}, "height": {"default": 720, "help": "height of the screenshots"}, - "timeout": {"default": 60, "help": "timeout for taking the screenshot"} + "timeout": {"default": 60, "help": "timeout for taking the screenshot"}, + "sleep_before_screenshot": {"default": 4, "help": "seconds to wait for the pages to load before taking screenshot"} } def enrich(self, to_enrich: Metadata) -> None: @@ -27,7 +28,7 @@ class ScreenshotEnricher(Enricher): with Webdriver(self.width, self.height, self.timeout, 'facebook.com' in url) as driver: try: driver.get(url) - time.sleep(2) + time.sleep(int(self.sleep_before_screenshot)) screenshot_file = os.path.join(to_enrich.get_tmp_dir(), f"screenshot_{str(uuid.uuid4())[0:8]}.png") driver.save_screenshot(screenshot_file) to_enrich.add_media(Media(filename=screenshot_file), id="screenshot") @@ -35,4 +36,3 @@ class ScreenshotEnricher(Enricher): logger.info("TimeoutException loading page for screenshot") except Exception as e: logger.error(f"Got error while loading webdriver for screenshot enricher: {e}") - # return None diff --git a/src/auto_archiver/version.py b/src/auto_archiver/version.py index fba5983..6439298 100644 --- a/src/auto_archiver/version.py +++ b/src/auto_archiver/version.py @@ -3,7 +3,7 @@ _MAJOR = "0" _MINOR = "4" # On main and in a nightly release the patch should be one ahead of the last # released build. -_PATCH = "2" +_PATCH = "3" # This is mainly for nightly builds which have the suffix ".dev$DATE". See # https://semver.org/#is-v123-a-semantic-version for the semantics. _SUFFIX = ""