2023-09-11 02:14:21 +00:00
|
|
|
import requests
|
2023-10-30 23:34:20 +00:00
|
|
|
import os
|
2023-09-11 02:14:21 +00:00
|
|
|
|
|
|
|
def download_file(url):
|
|
|
|
local_filename = url.split('/')[-1]
|
|
|
|
with requests.get(url, stream=True) as r:
|
|
|
|
r.raise_for_status()
|
|
|
|
with open(local_filename, 'wb') as f:
|
|
|
|
for chunk in r.iter_content(chunk_size=8192):
|
|
|
|
# If you have chunk encoded response uncomment if
|
|
|
|
# and set chunk_size parameter to None.
|
|
|
|
#if chunk:
|
|
|
|
f.write(chunk)
|
|
|
|
return local_filename
|
|
|
|
|
|
|
|
def init():
|
2023-10-30 23:34:20 +00:00
|
|
|
if not os.path.exists('small-image.png'):
|
2024-01-16 00:09:52 +00:00
|
|
|
download_file('https://files.ivanch.me/api/public/dl/ch3NV0P8/small-image.png')
|
2023-10-30 23:34:20 +00:00
|
|
|
if not os.path.exists('big-image.png'):
|
2024-01-16 00:09:52 +00:00
|
|
|
download_file('https://files.ivanch.me/api/public/dl/jNlXYMLR/big-image.png')
|
2023-10-30 23:34:20 +00:00
|
|
|
|
|
|
|
init()
|