mirror of
https://github.com/ieshuelin/cyr3a25.git
synced 2026-06-06 01:16:48 +00:00
download zip
This commit is contained in:
14
main.py
14
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')
|
||||
print('Todo listo')
|
||||
Reference in New Issue
Block a user