Add random delay to fake download

master
Tanner 3 years ago
parent 5f8aad7355
commit ce46f006d5
  1. 1
      server/download.py

@ -9,6 +9,7 @@ def fake_download(ip, dest):
import requests, random
num = ip.split('.')[3]
r = requests.get('https://picsum.photos/400/300?random=' + num)
time.sleep(random.uniform(2, 10))
with open(dest / (num + '_420.jpg'), 'wb') as f:
f.write(r.content)

Loading…
Cancel
Save