-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
66 lines (49 loc) · 2.19 KB
/
app.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from flask import Flask, render_template
import shutil
app = Flask(__name__, static_url_path='/static')
destination_path = './1'
@app.route('/')
def index():
return render_template('index.html')
@app.route('/move_file_p1_1', methods=['POST'])
def move_file11():
source_path114 = './原神启动素材_P1_1版/1.mp4'
source_path113 = './原神启动素材_P1_1版/1.mp3'
try:
shutil.copy(source_path114, destination_path)
shutil.copy(source_path113, destination_path)
return '<script> window.alert("修改成功");window.open("/");</script>'
except Exception as e:
return f'Error moving file: {e}'
@app.route('/move_file_p2_1', methods=['POST'])
def move_file21():
source_path214 = './原神启动素材_P2_1版有音频版/1.mp4'
source_path213 = './原神启动素材_P2_1版有音频版/1.mp3'
try:
shutil.copy(source_path214, destination_path)
shutil.copy(source_path213, destination_path)
return '<script> window.alert("修改成功");window.open("/");</script>'
except Exception as e:
return f'Error moving file: {e}'
@app.route('/move_file_p3_2', methods=['POST'])
def move_file32():
source_path324 = './原神启动素材_P3_2版(植物大战僵尸音乐版)/1.mp4'
source_path323 = './原神启动素材_P3_2版(植物大战僵尸音乐版)/1.mp3'
try:
shutil.copy(source_path324, destination_path)
shutil.copy(source_path323, destination_path)
return '<script> window.alert("修改成功");window.open("/");</script>'
except Exception as e:
return f'Error moving file: {e}'
@app.route('/move_file_p4_2', methods=['POST'])
def move_file42():
source_path424 = './原神启动素材_P4_2版有音频(植物大战僵尸音乐版)/1.mp4'
source_path423 = './原神启动素材_P4_2版有音频(植物大战僵尸音乐版)/1.mp3'
try:
shutil.copy(source_path424, destination_path)
shutil.copy(source_path423, destination_path)
return '<script> window.alert("修改成功");window.open("/");</script>'
except Exception as e:
return f'Error moving file: {e}'
if __name__ == '__main__':
app.run(debug=True)