Commit 0b02a654 authored by Marcus Edel's avatar Marcus Edel Committed by Marcus Edel
Browse files

Add data download script.

parent a57a443c
Pipeline #32105 failed with stage
in 5 minutes and 50 seconds
import sys
import requests
def download(url, filename):
with open(filename, 'wb') as f:
response = requests.get(url, stream=True)
total = response.headers.get('content-length')
if total is None:
f.write(response.content)
else:
downloaded = 0
total = int(total)
for data in response.iter_content(chunk_size=max(int(total/1000), 1024*1024)):
downloaded += len(data)
f.write(data)
done = int(50*downloaded/total)
sys.stdout.write('\r[{}{}]'.format('#' * done, '.' * (50-done)))
sys.stdout.flush()
sys.stdout.write('\n')
print('[*] Downloading hand.tar.gz of size 6.7GB...')
download('https://kurg.org/data/collabora/hand.tar.gz', 'hand.tar.gz')
print('[*] Done!')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment