Spaces:
Running
Running
Commit
·
af98f80
1
Parent(s):
7f349e8
Update routes/ytApi/getFull.py
Browse files- routes/ytApi/getFull.py +4 -1
routes/ytApi/getFull.py
CHANGED
@@ -13,6 +13,9 @@ def getFull(request):
|
|
13 |
bitrate = answer['bitrate']
|
14 |
quality = answer['quality']
|
15 |
error_code = answer['ytdlp-code']
|
|
|
|
|
|
|
16 |
|
17 |
config = helpers.configFile()
|
18 |
if answer['done-or-not']:
|
@@ -20,7 +23,7 @@ def getFull(request):
|
|
20 |
|
21 |
try:
|
22 |
audio_input = ffmpeg.input(answer['path'])
|
23 |
-
audio_output = ffmpeg.output(audio_input.audio, f"{config['full-path']}/{urlcode}.
|
24 |
ffmpeg.run(audio_output)
|
25 |
helpers.deleteAudio(f"temp/{urlcode}.ogg")
|
26 |
except Exception as e: return {"status": "error", "details": {"error_code": 102, "error_details": str(e), "result": f"{config['url']}/static/temp/{urlcode}.ogg"}}, 400
|
|
|
13 |
bitrate = answer['bitrate']
|
14 |
quality = answer['quality']
|
15 |
error_code = answer['ytdlp-code']
|
16 |
+
|
17 |
+
extension = helpers.getFromRequest(request, "extension")
|
18 |
+
if not extension: extension = "ogg"
|
19 |
|
20 |
config = helpers.configFile()
|
21 |
if answer['done-or-not']:
|
|
|
23 |
|
24 |
try:
|
25 |
audio_input = ffmpeg.input(answer['path'])
|
26 |
+
audio_output = ffmpeg.output(audio_input.audio, f"{config['full-path']}/{urlcode}.{extension}", audio_bitrate=bitrate)
|
27 |
ffmpeg.run(audio_output)
|
28 |
helpers.deleteAudio(f"temp/{urlcode}.ogg")
|
29 |
except Exception as e: return {"status": "error", "details": {"error_code": 102, "error_details": str(e), "result": f"{config['url']}/static/temp/{urlcode}.ogg"}}, 400
|