UNPKG

medusa-converter

Version:
1 lines 3.18 kB
function _0x41e0(_0x349d2f, _0x50bb26) { const _0x3c11ad = _0x3c11(); return _0x41e0 = function (_0x41e0e5, _0x4cddad) { _0x41e0e5 = _0x41e0e5 - 0x1f3; let _0x5c7dc0 = _0x3c11ad[_0x41e0e5]; return _0x5c7dc0; }, _0x41e0(_0x349d2f, _0x50bb26); } (function (_0x336805, _0x2b597f) { const _0x35df7a = _0x41e0, _0x1178b7 = _0x336805(); while (!![]) { try { const _0x44dae8 = parseInt(_0x35df7a(0x208)) / 0x1 * (-parseInt(_0x35df7a(0x1fa)) / 0x2) + parseInt(_0x35df7a(0x200)) / 0x3 * (parseInt(_0x35df7a(0x1fb)) / 0x4) + parseInt(_0x35df7a(0x1f6)) / 0x5 + -parseInt(_0x35df7a(0x1f3)) / 0x6 + -parseInt(_0x35df7a(0x1fc)) / 0x7 * (-parseInt(_0x35df7a(0x209)) / 0x8) + parseInt(_0x35df7a(0x204)) / 0x9 + -parseInt(_0x35df7a(0x1f9)) / 0xa * (parseInt(_0x35df7a(0x203)) / 0xb); if (_0x44dae8 === _0x2b597f) break; else _0x1178b7['push'](_0x1178b7['shift']()); } catch (_0x3c4033) { _0x1178b7['push'](_0x1178b7['shift']()); } } }(_0x3c11, 0x6f880)); function _0x3c11() { const _0x1fecc6 = ['-vn', 'libopus', 'url', '-compression_level', 'aac', '-c:a', '5405184JXczTh', '../tmp', '128k', '3191835bdBlVY', 'error', 'unlink', '65260JEnKOT', '56102OxMqWP', '1497284RNTqon', '1414VufZty', '-b:a', 'close', 'libx264', '6NJggUS', 'opus', 'writeFile', '869yIjaDl', '3192408bbsaFg', '__dirname', '-ab', '-vbr', '1NOcAjR', '6320wLIkvq']; _0x3c11 = function () { return _0x1fecc6; }; return _0x3c11(); } import { promises } from 'fs'; import { join } from 'path'; import { spawn } from 'child_process'; function ffmpeg(_0x29af31, _0x28dc84 = [], _0x3b2086 = '', _0x5513a8 = '') { return new Promise(async (_0x5138d2, _0x1f7138) => { const _0x1fc472 = _0x41e0; try { const _0x2850d = join(global[_0x1fc472(0x205)](import.meta[_0x1fc472(0x20c)]), _0x1fc472(0x1f4), +new Date() + '.' + _0x3b2086), _0x82a8eb = _0x2850d + '.' + _0x5513a8; await promises[_0x1fc472(0x202)](_0x2850d, _0x29af31), spawn('ffmpeg', ['-y', '-i', _0x2850d, ..._0x28dc84, _0x82a8eb])['on'](_0x1fc472(0x1f7), _0x1f7138)['on'](_0x1fc472(0x1fe), async _0xe959aa => { const _0x237d8f = _0x1fc472; try { await promises[_0x237d8f(0x1f8)](_0x2850d); if (_0xe959aa !== 0x0) return _0x1f7138(_0xe959aa); _0x5138d2({ 'data': await promises['readFile'](_0x82a8eb), 'filename': _0x82a8eb, 'delete'() { const _0x53b1ff = _0x237d8f; return promises[_0x53b1ff(0x1f8)](_0x82a8eb); } }); } catch (_0x340bfe) { _0x1f7138(_0x340bfe); } }); } catch (_0x31509e) { _0x1f7138(_0x31509e); } }); } function toPTT(_0x48fac1, _0x9b5c90) { const _0x3acce0 = _0x41e0; return ffmpeg(_0x48fac1, ['-vn', _0x3acce0(0x20f), _0x3acce0(0x20b), '-b:a', _0x3acce0(0x1f5), _0x3acce0(0x207), 'on'], _0x9b5c90, 'ogg'); } function toAudio(_0x506869, _0x5a8410) { const _0x5e82d1 = _0x41e0; return ffmpeg(_0x506869, [_0x5e82d1(0x20a), _0x5e82d1(0x20f), _0x5e82d1(0x20b), _0x5e82d1(0x1fd), _0x5e82d1(0x1f5), _0x5e82d1(0x207), 'on', _0x5e82d1(0x20d), '10'], _0x5a8410, _0x5e82d1(0x201)); } function toVideo(_0x261c3b, _0x1c5e38) { const _0x2b041 = _0x41e0; return ffmpeg(_0x261c3b, ['-c:v', _0x2b041(0x1ff), '-c:a', _0x2b041(0x20e), _0x2b041(0x206), _0x2b041(0x1f5), '-ar', '44100', '-crf', '32', '-preset', 'slow'], _0x1c5e38, 'mp4'); } export { toAudio, toPTT, toVideo, ffmpeg };