Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,8 @@ def download_video():
|
|
14 |
if not video_id:
|
15 |
return jsonify({'error': 'Missing video ID'}), 400
|
16 |
|
|
|
|
|
17 |
try:
|
18 |
# YouTube URLγδ½ζ
|
19 |
youtube_url = f'https://www.youtube.com/watch?v={video_id}'
|
@@ -55,9 +57,9 @@ def download_video():
|
|
55 |
|
56 |
finally:
|
57 |
# γ―γͺγΌγ³γ’γγ: δ½Ώη¨εΎγ«γγ‘γ€γ«γει€
|
58 |
-
if os.path.exists(file_path):
|
59 |
os.remove(file_path)
|
60 |
|
61 |
|
62 |
if __name__ == '__main__':
|
63 |
-
app.run(debug=True, host='0.0.0.0'
|
|
|
14 |
if not video_id:
|
15 |
return jsonify({'error': 'Missing video ID'}), 400
|
16 |
|
17 |
+
file_path = None # file_path γδΊεγ«εζε
|
18 |
+
|
19 |
try:
|
20 |
# YouTube URLγδ½ζ
|
21 |
youtube_url = f'https://www.youtube.com/watch?v={video_id}'
|
|
|
57 |
|
58 |
finally:
|
59 |
# γ―γͺγΌγ³γ’γγ: δ½Ώη¨εΎγ«γγ‘γ€γ«γει€
|
60 |
+
if file_path and os.path.exists(file_path):
|
61 |
os.remove(file_path)
|
62 |
|
63 |
|
64 |
if __name__ == '__main__':
|
65 |
+
app.run(debug=True, host='0.0.0.0')
|