dynamic upload&remove unpack.php

This commit is contained in:
Alexander Popov 2022-08-05 23:35:28 +03:00
parent 9bc77e0c8b
commit 482ac333d2
Signed by: iiiypuk
GPG Key ID: D8C9B59A9F04A70C

View File

@ -26,14 +26,19 @@ def upload_by_ftps(archive):
if ftp.pwd() == '/':
with open(archive, 'rb') as f:
ftp.storbinary('STOR {0}'.format(archive), f)
os.remove(archive)
with open('unpack.php', 'rb') as f:
ftp.storbinary('STOR unpack.php', f)
def get_unpack(archive):
f = urllib.request.urlopen('https://blog.iiiypuk.me/unpack.php?f={0}'.format(archive))
f.read()
ftp = ftplib.FTP_TLS(host=HOST, user=USER, passwd=PASSWORD)
ftp.delete('unpack.php')
if __name__ == '__main__':
os.system('rm -rf ./public/ &> /dev/null') # FIXIT