Enabled FTP over TLS

This commit is contained in:
Samuel Walker 2024-06-20 06:47:26 -06:00
parent ebe15c51d1
commit 8a8e1216c1
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# Windows path: os.getenv('LOCALAPPDATA')/Programs/PrismLauncher/prismlauncher.exe
# Windows instance path: os.getenv('APPDATA')/PrismLauncher/instances
# Linux instance path: .local/share/PrismLauncher/instances
from ftplib import FTP
from ftplib import FTP_TLS as FTP
import os
import io
import json
@ -18,6 +18,7 @@ def main():
prism_instance_path = os.getenv("APPDATA")+"/PrismLauncher/instances"
ftp = FTP("gitea.piwalker.net")
ftp.login()
ftp.prot_p()
bio = io.BytesIO()
ftp.retrbinary("RETR versions.json", bio.write)
bio.seek(0)

View File

@ -1,4 +1,4 @@
from ftplib import FTP
from ftplib import FTP_TLS as FTP
from getpass import getpass
import json
import io
@ -9,6 +9,7 @@ username = input("Username: ")
password = getpass()
version_tag = input("Version Number: ")
ftp = FTP("gitea.piwalker.net", username, password)
ftp.prot_p()
bio = io.BytesIO()
ftp.retrbinary("RETR versions.json", bio.write)
bio.seek(0)