🎨 Moved curl to subprocess function
This commit is contained in:
parent
c4383db473
commit
a8745622e0
|
@ -478,18 +478,12 @@ function main_menu:upload_catbox()
|
||||||
-- This uses cURL to send a request to the cat-/litterbox API.
|
-- This uses cURL to send a request to the cat-/litterbox API.
|
||||||
-- cURL is included on Windows 10 and up, most Linux distributions and macOS.
|
-- cURL is included on Windows 10 and up, most Linux distributions and macOS.
|
||||||
|
|
||||||
local r = mp.command_native({ -- This is technically blocking, but I don't think it has any real consequences ..?
|
local r = subprocess({ -- This is technically blocking, but I don't think it has any real consequences ..?
|
||||||
name = 'subprocess',
|
os_type == 'windows' and 'curl.exe' or 'curl', '-s',
|
||||||
playback_only = false,
|
'-F', 'reqtype=fileupload',
|
||||||
capture_stdout = true,
|
'-F', 'time=' .. config['litterbox_expire'],
|
||||||
capture_stderr = true,
|
'-F', 'fileToUpload=@"' .. outfile .. '"',
|
||||||
args = {
|
endpoint
|
||||||
os_type == 'windows' and 'curl.exe' or 'curl', '-s',
|
|
||||||
'-F', 'reqtype=fileupload',
|
|
||||||
'-F', 'time=' .. config['litterbox_expire'],
|
|
||||||
'-F', 'fileToUpload=@"' .. outfile .. '"',
|
|
||||||
endpoint
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Exit codes in the range [0, 99] are returned by cURL itself.
|
-- Exit codes in the range [0, 99] are returned by cURL itself.
|
||||||
|
|
Loading…
Reference in a new issue