Spaces:
Runtime error
Runtime error
File size: 1,292 Bytes
66ca64a |
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 |
import ffmpeg
from .get import *
from .. import helpers
def getFull(request):
answer = get(request, "full")
try:
if answer['error']: return answer
except KeyError: pass
except Exception as e: return {"status": "error", "details": { "error_code": 123, "error_details": e }}
urlcode = answer['urlcode']
bitrate = answer['bitrate']
quality = answer['quality']
error_code = answer['ytdlp-code']
if answer['done-or-not']:
return {"status": "pass", "details": {"code": error_code, "name":"{}.ogg".format(urlcode), "result": "http://funapi.dnszilla.bar/static/full/{}.ogg".format(urlcode)}}
try:
audio_input = ffmpeg.input(answer['path'])
audio_output = ffmpeg.output(audio_input.audio, "/home/ubuntu/api/static/full/{}.ogg".format(urlcode), audio_bitrate=bitrate)
ffmpeg.run(audio_output)
helpers.deleteAudio("temp/{}.ogg".format(urlcode))
except Exception as e: return {"status": "error", "details": {"error_code": 102, "error_details": str(e), "result": "http://funapi.dnszilla.bar/static/temp/{}.ogg".format(urlcode)}}
return {"status": "pass", "details": {"code": error_code, "name":"{}.ogg".format(urlcode), "result": "http://funapi.dnszilla.bar/static/full/{}.ogg".format(urlcode)}}
|