Add random delay to fake download

This commit is contained in:
Tanner 2021-03-10 22:41:37 -07:00
parent 5f8aad7355
commit ce46f006d5

View File

@ -9,6 +9,7 @@ def fake_download(ip, dest):
import requests, random import requests, random
num = ip.split('.')[3] num = ip.split('.')[3]
r = requests.get('https://picsum.photos/400/300?random=' + num) 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: with open(dest / (num + '_420.jpg'), 'wb') as f:
f.write(r.content) f.write(r.content)