diff --git a/main.py b/main.py index 60eb794..d7057a7 100644 --- a/main.py +++ b/main.py @@ -3,9 +3,21 @@ import glob import os from ai import completion import shutil +import requests html_path_list = [] +if not os.path.exists('cyr.zip'): + print('Descargando zip...') + + zip_cdn = requests.get(os.environ['ZIP_DL'], headers={'User-Agent': 'build'}) + with open('cyr.zip', 'wb') as cyr_zip: + cyr_zip.write(zip_cdn.content) + + archive = zipfile.ZipFile('cyr.zip') + archive.extractall() + shutil.move('webs cyr/', 'webs/') + if os.path.exists('dist'): shutil.rmtree('dist') @@ -38,4 +50,4 @@ with open('template.html', 'r') as template: str_path_list = '\n'.join(html_path_list) final_index.write(template_text.replace('{{LIST}}', str_path_list)) -print('Todo hecho') \ No newline at end of file +print('Todo listo') \ No newline at end of file