-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsendfile.py
35 lines (28 loc) · 917 Bytes
/
sendfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
""" What is sendfile.py
This module is send 3gx to 3ds via FTP.
このモジュールはFTPで3gxを3dsに送信します。
"""
import ftplib
from ftplib import FTP
print("--------------------------")
print("Trying to Send the Plugin over FTP...")
get_ftp = FTP()
HOST_ADDRESS = "192.168.0.50"
PORT = 5000
TIME_OUT = 30.0
try:
get_ftp.connect(HOST_ADDRESS, PORT, TIME_OUT)
except ftplib.all_errors:
print("Failed to Connect on " + HOST_ADDRESS + " : " + str(PORT))
PATH = "luma/plugins/0004000000155400"
PLUGIN = "/Colorful-MHX3gx.3gx"
try:
print("Successfully Logged in " + HOST_ADDRESS + "\n")
print("Response : " + get_ftp.getwelcome())
get_ftp.login()
get_ftp.storbinary("STOR " + PATH + PLUGIN,
open(PLUGIN.replace("/", ""), "rb"))
print("Sending Plugin to " + PATH + "\n")
except ftplib.all_errors:
print("Login Failed!\n")