soiz commited on
Commit
08b9d9a
Β·
verified Β·
1 Parent(s): ba2f9e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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', port=7860)
 
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')