feat: scripts

This commit is contained in:
2025-04-05 16:57:26 +08:00
parent bd4fe63cdc
commit 3e996ffab3
62 changed files with 4905 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env runjs
var main = function() {
if ($ARGS.length == 0) {
xprintln('[ERROR] No arguments.');
return;
}
var f = __.rfile.from($ARGS[0]);
if (f.notExists()) {
xprintln('[ERROR] File not exists: ' + $ARGS[0]);
return;
}
var o = $ARGS[0];
var n = $ARGS[0] + '.processed.mp4';
xprintln('[INFO] Start process: ' + o);
$$.shell(true).commands('ffmpeg', '-i', o, '-c:a', 'copy', '-c:v', 'copy', '-movflags', 'faststart', n).run();
$$.sleep(500);
if ($ARGS.length > 1 && $STR($ARGS[1]) == "re") {
if (__.rfile.from(n).exists()) {
__.rfile.from(o).file().delete();
$$.shell(true).commands("mv", n, o).run();
}
}
}
main();