From 1cb818435d2c0094d77f541b3f57c5a18fd34888 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Thu, 15 Jul 2021 18:48:12 +0200 Subject: tasks: add BrefZipWayback --- python/refcat/tasks.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'python') diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index c721486..2d31068 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -1521,3 +1521,23 @@ class CDXURL(Refcat): def output(self): return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) + + +class BrefZipWayback(Refcat): + def requires(self): + return { + "refs": RefsURL(), + "cdx": CDXURL(), + } + + def run(self): + output = shellout(""" + skate-reduce -m wb -F <(zstdcat -T0 {refs}) -C <(zstdcat -T0 {cdx}) | zstd -c -T0 > {output} + """, + refs=self.input().get("refs").path, + cdx=self.input().get("cdx").path) + + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) -- cgit v1.2.3