Audio/Video/Image Conversions via ffmpeg and/or Image/PDF Conversions via ImageMagick";
$avtypes="";
$types = ["audio/x-m4r","audio/wav","audio/x-wav","audio/x-pn-realaudio","audio/x-mpegurl","audio/x-aiff","audio/mpeg","audio/mid",
"audio/basic","audio/ogg","video/x-sgi-movie","video/x-msvideo","video/quicktime","audio/mp3","video/mp4","video/mpeg",
"video/x-la-asf","video/ogg","video/webm","audio/mp4", "image/jpeg", "image/jpeg", "image/png", "image/gif", "image/bmp", "image/tif",
"text/html", "text/html", "text/html", "text/javascript", "text/css", "text/plain", "text/xml", "text/csv",
"application/vnd.ms-word", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/x-php", "application/pdf", "IMAGE/pdf",
"application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.ms-powerpoint",
"application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];
$exts = [".m4r",".wav",".wav",".ram",".m3u",".aiff",".mp3",".rmi",
".snd",".ogg",".movie",".avi",".mov",".mp3",".m4v",".mpeg",
".lsx",".ogv",".webm",".m4a", ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tif",
".htm", ".html", ".htmls", ".js", ".css", ".txt", ".xml", ".csv",
".doc", ".docx", ".php", ".pdf", ".pdf",
".pptx", ".ppt",
".xls", ".xlsx"];
$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$ipad = strpos($_SERVER['HTTP_USER_AGENT'],"iPad");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
$blackberry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
if (isset($_POST['command0'])) {
$ic=0;
exec("echo y > /tmp/macos.yes");
while (isset($_POST['command' . $ic])) {
exec(str_replace("+"," ",urldecode($_POST['command' . $ic])));
$ic++;
}
exit;
}
function jserver_remote_addr($delit) {
global $stfle;
$rma = $_SERVER['REMOTE_ADDR'];
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
// you can add different browsers with the same way ..
if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua))
$rma = '000000'.$rma;
elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua))
$rma = '00000'.$rma;
elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua))
$rma = '0000'.$rma;
elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua))
$rma = '000'.$rma;
elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua))
$rma = '00'.$rma;
elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua))
$rma = '0'.$rma;
if ($delit != '') {
if (file_exists("PHP/animegif/" . str_replace(":", "_", $rma) . ".php")) {
exec("rm -f PHP/animegif/" . str_replace(":", "_", $rma) . ".php; echo '
Blank
' > PHP/animegif/" . str_replace(":", "_", $rma) . ".php");
}
}
return str_replace(":", "_", $rma);
}
if (isset($argv)) { // command line
$numargs = sizeof($argv);
if ($numargs <= 4) {
if (PHP_OS == 'WINNT') {
echo '$ Input path ( eg. we will take blank to mean ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . ' ) then Audio/Video/Image/PDF Input File(spec) then Output path ( eg. we will take blank to mean ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . ' ) then Audio/Video/Image/PDF Output File Extension below ...' . "\n";
$line = stream_get_line(STDIN, 1024, PHP_EOL);
if (str_replace("\n", "", $line) == "") { $line=dirname(__FILE__) . DIRECTORY_SEPARATOR; }
$lineinspec = stream_get_line(STDIN, 1024, PHP_EOL);
$outline = stream_get_line(STDIN, 1024, PHP_EOL);
if (str_replace("\n", "", $outline) == "") { $outline=dirname(__FILE__) . DIRECTORY_SEPARATOR; }
$outlineinspec = stream_get_line(STDIN, 1024, PHP_EOL);
if (strpos(($outlineinspec . "~"), "htm~") !== false) { $outlineinspec.="l"; }
} else {
$line = readline('$ Input path ( eg. we will take blank to mean ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . ' ) then Audio/Video/Image/PDF Input File(spec) then Output path ( eg. we will take blank to mean ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . ' ) then Audio/Video/Image/PDF Output File Extension below ...' . "\n");
if (str_replace("\n", "", $line) == "") { $line=dirname(__FILE__) . DIRECTORY_SEPARATOR; }
$lineinspec = readline('');
$outline = readline('');
if (str_replace("\n", "", $outline) == "") { $outline=dirname(__FILE__) . DIRECTORY_SEPARATOR; }
$outlineinspec = readline('');
if (strpos(($outlineinspec . "~"), "htm~") !== false) { $outlineinspec.="l"; }
}
$cmdsuff="";
$openers="";
$openersdelim="";
foreach (glob($line . $lineinspec) as $filename) {
$outnameis=$outline . str_replace("." . explode(".", basename($filename))[-1 + sizeof(explode(".", basename($filename)))], ".", basename($filename)) . str_replace(".", "", $outlineinspec);
if (file_exists($outnameis)) {
$sufext="_0";
$iext=0;
$rone="";
$rtwo="";
while (file_exists($outnameis . $sufext)) {
$iext++;
$sufext="_" . $iext;
}
$rtwo=$outnameis;
$rone=$outnameis . $sufext;
echo "Renaming " . $outnameis . " to " . $outnameis . $sufext . "\n";
try {
rename($outnameis, $outnameis . $sufext);
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
if (!file_exists($outnameis . $sufext)) {
echo "Renaming did not happen." . "\n";
}
}
if (explode(".",$outlineinspec)[-1 + sizeof(explode(".",$outlineinspec))] == "pdJUNKf") {
echo ("php " . $argv[0] . " " . $line . " " . basename($filename) . " " . $outline . " " . $outlineinspec . "\n");
passthru("php " . $argv[0] . " " . $line . " " . basename($filename) . " " . $outline . " " . $outlineinspec);
} else {
$mimetypeis="";
$videoin=false;
for ($jia=0; $jia macos_ffmpeg_convert.out 2> macos_ffmpeg_convert.err");
echo ($verb . " " . $switchone . " " . $filename . " " . $switchtwo . " " . $outnameis . $cmdsuff . " < /tmp/macos.yes > macos_ffmpeg_convert.out 2> macos_ffmpeg_convert.err \n");
exec($verb . " " . $switchone . " " . $filename . " " . $switchtwo . " " . $outnameis . $cmdsuff . " < /tmp/macos.yes > macos_ffmpeg_convert.out 2> macos_ffmpeg_convert.err; cat macos_ffmpeg_convert.err");
//passthru($verb . " " . $switchone . " " . $filename . " " . $switchtwo . " " . $outnameis . $cmdsuff . " < /tmp/macos.yes > macos_ffmpeg_convert.out 2> macos_ffmpeg_convert.err");
if (file_exists("macos_ffmpeg_convert.out") && file_exists("macos_ffmpeg_convert.err")) {
if (7 == 6 && filesize("macos_ffmpeg_convert.out") == 0 && filesize("macos_ffmpeg_convert.err") != 0) {
if ($rone != "" && $rtwo != "") {
echo "Renaming " . $rone . " back to " . $rtwo . "\n";
rename($rone, $rtwo);
}
echo "\n\n" . file_get_contents("macos_ffmpeg_convert.err") . "\n\n";
}
}
if (PHP_OS == "Darwin") { // && explode(".",$outlineinspec)[-1 + sizeof(explode(".",$outlineinspec))] != "pdf") {
if (file_exists($outnameis)) {
$openers.=$openersdelim . "open " . $outnameis;
$openersdelim=" ; ";
}
}
}
}
if (PHP_OS == "Darwin" && $openers != "") {
echo "\n\nWill try to open successful (or old resurrected) files in 8 seconds ...\n";
sleep(8);
echo ($openers . " \n");
exec($openers);
}
//echo "do the work";
} else {
$openers="";
$openersdelim="";
$line=trim($argv[1]);
if (str_replace("\n", "", $line) == "") { $line=dirname(__FILE__) . DIRECTORY_SEPARATOR; }
$lineinspec=$argv[2];
$outline=trim($argv[3]);
if (str_replace("\n", "", $outline) == "") { $outline=dirname(__FILE__) . DIRECTORY_SEPARATOR; }
$outlineinspec=$argv[4];
$cmdsuff="";
foreach (glob($line . $lineinspec) as $filename) {
$outnameis=$outline . str_replace("." . explode(".", basename($filename))[-1 + sizeof(explode(".", basename($filename)))], ".", basename($filename)) . str_replace(".", "", $outlineinspec);
if (file_exists($outnameis)) {
$sufext="_0";
$iext=0;
$rone="";
$rtwo="";
while (file_exists($outnameis . $sufext)) {
$iext++;
$sufext="_" . $iext;
}
$rtwo=$outnameis;
$rone=$outnameis . $sufext;
echo "Renaming " . $outnameis . " to " . $outnameis . $sufext . "\n";
rename($outnameis, $outnameis . $sufext);
}
$mimetypeis="";
$videoin=false;
for ($jia=0; $jia macos_ffmpeg_convert.out 2> macos_ffmpeg_convert.err");
echo ($verb . " " . $switchone . " " . $filename . " " . $switchtwo . " " . $outnameis . $cmdsuff . " < /tmp/macos.yes > macos_ffmpeg_convert.out 2> macos_ffmpeg_convert.err \n");
exec($verb . " " . $switchone . " " . $filename . " " . $switchtwo . " " . $outnameis . $cmdsuff . " < /tmp/macos.yes > macos_ffmpeg_convert.out 2> macos_ffmpeg_convert.err; cat macos_ffmpeg_convert.err");
//passthru($verb . " " . $switchone . " " . $filename . " " . $switchtwo . " " . $outnameis . $cmdsuff . " < /tmp/macos.yes > macos_ffmpeg_convert.out 2> macos_ffmpeg_convert.err");
if (file_exists("macos_ffmpeg_convert.out") && file_exists("macos_ffmpeg_convert.err")) {
if (8 == 9 && filesize("macos_ffmpeg_convert.out") == 0 && filesize("macos_ffmpeg_convert.err") != 0) {
if ($rone != "" && $rtwo != "") {
echo "Renaming " . $rone . " back to " . $rtwo . "\n";
rename($rone, $rtwo);
}
echo "\n\n" . file_get_contents("macos_ffmpeg_convert.err") . "\n\n";
}
}
if (PHP_OS == "Darwin") { // && explode(".",$outlineinspec)[-1 + sizeof(explode(".",$outlineinspec))] != "pdf") {
if (file_exists($outnameis)) {
$openers.=$openersdelim . "open " . $outnameis;
$openersdelim=" ; ";
}
}
}
if (PHP_OS == "Darwin" && $openers != "") {
echo "\n\nWill try to open successful (or old resurrected) files in 8 seconds ...\n";
sleep(8);
echo ($openers . " \n");
exec($openers);
}
//echo "Do the work ";
}
exit;
}
if (strpos($_SERVER['SERVER_NAME'], "rjmprogramming.com.au") !== false) {
if ($iphone || $ipad || $android || $ipod || $blackberry) { // thanks to http://www.phpmysqlscript.com/2012/03/detecting-users-screen-size-and.html
$cself=" 🤳 ";
$cvse="Email 📧";
$divinfront="";
} else {
$cvse="Email";
$divinfront="";
}
$title="Email off your Media Conversion Attachment Input Files for Your Inhouse Media Converter to Listen For and Convert";
$onl="";
}
if (isset($_POST['to']) && isset($_POST['subject']) && isset($_POST['body'])) {
$tow=str_replace("+"," ",urldecode($_POST['to']));
if (strpos($tow, "@") !== false) {
$subjw=str_replace('*','m4v',str_replace("+"," ",urldecode($_POST['subject'])));
$orign=basename(explode(" ", $subjw)[0]);
$thenn=basename(explode(" ", $subjw)[-1 + sizeof(explode(" ", $subjw))]);
$bodyn=str_replace(" ","+",urldecode($_POST['body']));
if (strpos($bodyn, "data:") !== false) {
file_put_contents($thenn, base64_decode(explode(";base64,", $bodyn)[1]));
} else {
file_put_contents($thenn, $bodyn);
}
if (1 == 1) { // thanks to https://community.hpe.com/t5/general/use-of-sendmail-and-uuencode/td-p/2431436#.XxqPtvgzZZo
//$cmd="/usr/sbin/sendmail " . $tow . " << END\nSubject: " . $subjw . "\n`uuencode " . $thenn . " " . $thenn . "`\nEND";
//$cmd="/usr/sbin/sendmail " . $tow . " << END\nSubject: " . $subjw . "\nFrom: rjmprogr@vs-rmetcalfe.au.syrahost.com\n`uuencode " . $thenn . " " . $thenn . "`\nEND";
$cmd="/usr/sbin/sendmail " . $tow . " << END\nSubject: " . $subjw . "\n`uuencode " . $thenn . " " . $thenn . "`\nEND";
//file_put_contents("00x.00x", $cmd);
exec($cmd);
exec("rm -f " . $thenn);
} else {
//file_put_contents("0x.0x", "uuencode " . $thenn . " " . $thenn . " > " . explode(".", $thenn)[0] . "; cat " . explode(".", $thenn)[0] . " | /usr/sbin/sendmail " . $tow . "; rm -f " . explode(".", $thenn)[0] . "; rm -f " . $thenn);
//exec("uuencode " . $thenn . " " . $thenn . " > " . explode(".", $thenn)[0] . "; cat " . explode(".", $thenn)[0] . " | /usr/sbin/sendmail " . $tow . " > smail.out 2> smail.err; rm -f " . explode(".", $thenn)[0] . "; rm -f " . $thenn);
exec("uuencode " . $thenn . " " . $thenn . " > " . explode(".", $thenn)[0] . "; cat " . explode(".", $thenn)[0] . " | /usr/sbin/sendmail " . $tow . " > smail.out 2> smail.err; rm -f " . explode(".", $thenn)[0] . "; rm -f " . $thenn);
}
}
exit;
}
if (isset($_GET['globit'])) {
$accf="";
$accfd="";
$accfout="";
$accfoutext=".m4v";
$pprefix=dirname(__FILE__) . DIRECTORY_SEPARATOR;
if (isset($_GET['globpath'])) {
if (str_replace("+", " ", urldecode($_GET['globpath'])) != "") {
$pprefix=str_replace("+", " ", urldecode($_GET['globpath']));
}
}
if (isset($_GET['globext'])) {
$accfoutext="." . str_replace(".", "", str_replace("+", " ", urldecode($_GET['globext'])));
}
foreach (glob($pprefix . str_replace("+", " ", urldecode($_GET['globit']))) as $filename) {
$accf.=$accfd . basename($filename);
$accfout.=$accfd . explode(".", basename($filename))[0] . $accfoutext;
$accfd=",";
}
echo "" . $title . "";
exit;
}
for ($iav=0; $iavConvert to " . strtoupper(substr($types[$iav],0,1)) . str_replace("/"," ",substr($types[$iav],1)) . "";
}
}
}
function nosourcei($inh) {
global $verb;
if (strpos(strtolower($inh), "","",str_replace(">","",str_replace(" controls>","",str_replace(" controls>","",str_replace(" controls>","",str_replace(" controls>