aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xckandumper6
1 files changed, 5 insertions, 1 deletions
diff --git a/ckandumper b/ckandumper
index c85a53d..1ec05d3 100755
--- a/ckandumper
+++ b/ckandumper
@@ -36,9 +36,12 @@ class ckandumper:
self.tag_list = '/api/3/action/tag_list'
self.tag_show = '/api/3/action/tag_show?'
+ if args.limit_rate != None
+ self.limit_rate = '--limit-rate=' + args.limit_rate
+
# Using wget as it is more reliable
def download(self, url, local_filename):
- subprocess.call('/usr/bin/wget -c -O "' + local_filename + '" ' + url, shell=True)
+ subprocess.call('/usr/bin/wget ' + self.limit_rate + ' -c -O "' + local_filename + '" ' + url, shell=True)
def ensuredir(self, dest):
# Ensure that the destination folder exists
@@ -128,6 +131,7 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Dump CKAN metadata and datasets.')
parser.add_argument('url', nargs='+', help='CKAN instance URL')
parser.add_argument('dest', nargs='+', help='Destination folder')
+ parser.add_argument("--limit-rate", help="Limit the download speed to amount bytes per second, per download")
args = parser.parse_args()
# Dispatch