summaryrefslogtreecommitdiff
path: root/download
diff options
context:
space:
mode:
Diffstat (limited to 'download')
-rwxr-xr-xdownload18
1 files changed, 18 insertions, 0 deletions
diff --git a/download b/download
new file mode 100755
index 0000000..ce20123
--- /dev/null
+++ b/download
@@ -0,0 +1,18 @@
+#!/bin/env python3
+
+import argparse
+from clnindexdl import download_all_from_index
+from pathlib import Path
+import os
+
+parser = argparse.ArgumentParser()
+parser.add_argument('indexes', metavar='indexes', type=str, nargs='+')
+parser.add_argument('--threads', '-t', type=int, default=6)
+
+args = parser.parse_args()
+
+for index in args.indexes:
+ with open(index) as file:
+ basedir = Path( index ).resolve().parent
+
+ download_all_from_index( file, Path(basedir), args.threads )