aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/refcat/tasks.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py
index 63b12f4..698ef24 100644
--- a/python/refcat/tasks.py
+++ b/python/refcat/tasks.py
@@ -460,6 +460,28 @@ class URLTabs(Refcat):
def output(self):
return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd)
+class URLTabsCleaned(Refcat):
+ """
+ URLTabs, cleaned.
+ """
+ def requires(self):
+ return URLTabs()
+
+ def run(self):
+ output = shellout("""
+ zstdcat -T0 {input} |
+ skate-cleanup -X -c url -B -S -f 3 |
+ LC_ALL=C sort -u -T {tmpdir} -k3,3 -S25% --parallel 4 |
+ LC_ALL=C grep -E '^https?://' |
+ zstd -T0 -c > {output}
+ """,
+ n=self.n,
+ tmpdir=self.tmpdir,
+ input=self.input().path)
+ luigi.LocalTarget(output).move(self.output().path)
+
+ def output(self):
+ return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd)
class URLList(Refcat):
"""