diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-07-15 18:48:12 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-07-15 18:48:12 +0200 |
commit | 1cb818435d2c0094d77f541b3f57c5a18fd34888 (patch) | |
tree | 3c04b80869b4eb903284f902014519ac9fd6df31 /python | |
parent | bf2c526fab3b9baac53f279adf3081e2092d9565 (diff) | |
download | refcat-1cb818435d2c0094d77f541b3f57c5a18fd34888.tar.gz refcat-1cb818435d2c0094d77f541b3f57c5a18fd34888.zip |
tasks: add BrefZipWayback
Diffstat (limited to 'python')
-rw-r--r-- | python/refcat/tasks.py | 20 |
1 files changed, 20 insertions, 0 deletions
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) |