Update app.py
Browse files
app.py
CHANGED
@@ -98,13 +98,18 @@ def download_track(request: DownloadRequest):
|
|
98 |
|
99 |
# Download the track using deezspot
|
100 |
logger.info(f"Downloading track: {expected_filename}")
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
# Recursively search for the file in the downloads directory
|
110 |
filepath = None
|
|
|
98 |
|
99 |
# Download the track using deezspot
|
100 |
logger.info(f"Downloading track: {expected_filename}")
|
101 |
+
try:
|
102 |
+
# 下载文件的代码
|
103 |
+
dl.download_trackdee(
|
104 |
+
link_track=track_link,
|
105 |
+
output_dir="downloads",
|
106 |
+
quality_download=quality,
|
107 |
+
recursive_quality=False,
|
108 |
+
recursive_download=False
|
109 |
+
)
|
110 |
+
except Exception as e:
|
111 |
+
logger.error(f"Error downloading file: {e}")
|
112 |
+
raise HTTPException(status_code=500, detail="File download failed")
|
113 |
|
114 |
# Recursively search for the file in the downloads directory
|
115 |
filepath = None
|