From 90cb6e989b492bbfe2f242c77aad616b86637052 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Sat, 6 Nov 2021 23:20:24 +0100 Subject: [PATCH] Do not download single videos if cache does not exist --- PFERD/crawl/ilias/kit_ilias_web_crawler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PFERD/crawl/ilias/kit_ilias_web_crawler.py b/PFERD/crawl/ilias/kit_ilias_web_crawler.py index c3e51ef..c6115f4 100644 --- a/PFERD/crawl/ilias/kit_ilias_web_crawler.py +++ b/PFERD/crawl/ilias/kit_ilias_web_crawler.py @@ -514,7 +514,12 @@ instance's greatest bottleneck. else: log.explain(f"Using single video mode for {element.name}") stream_element = stream_elements[0] - await self._stream_from_url(stream_element.url, sink, bar, is_video=True) + + # We do not have a local cache yet + if self._output_dir.resolve(original_path).exists(): + log.explain(f"Video for {element.name} existed locally") + else: + await self._stream_from_url(stream_element.url, sink, bar, is_video=True) self.report.add_custom_value(str(original_path), [original_path.name]) return