'.Wait_Message.'
';
echo '
';
echo '
'.$vidInfo['title'].'
';
echo '
'.$converter->GetConvertedFileType().'
';
echo '
';
echo '
'.Downloading_Process_Message.'
';
echo (!Config::_CACHING_ENABLED) ? '
' : '';
echo '
';
$converter->FlushBuffer();
// Main Program Execution
$cachedFile = (Config::_CACHING_ENABLED) ? $converter->RetrieveCachedFile() : '';
if (!empty($cachedFile))
{
$progressIncrements = mt_rand(4,8);
$downloadPercent = 0;
for ($**1; $i<=$progressIncrements; $i++)
{
$downloadPercent += floor(100 / $progressIncrements);
echo '';
$converter->FlushBuffer();
usleep((1500000 * (16 / $progressIncrements)) * ((100 / $progressIncrements) / 100));
}
$fileNameParts = explode("/", $cachedFile);
$convertedFileName = implode("/", array_slice($fileNameParts, count(preg_split('/\//', Config::_CONVERTED_FILEDIR, -1, PREG_SPLIT_NO_EMPTY))));
$convertedFileNiceName = $converter->PrepareConvertedFileNameForDownload(end($fileNameParts));
echo '
';
echo '';
}
else
{
if ($converter->DownloadVideo($vidURL))
{
$fileNameParts = explode("/", $converter->GetConvertedFileName());
$convertedFileName = implode("/", array_slice($fileNameParts, count(preg_split('/\//', Config::_CONVERTED_FILEDIR, -1, PREG_SPLIT_NO_EMPTY))));
$convertedFileNiceName = $converter->PrepareConvertedFileNameForDownload(end($fileNameParts));
echo '
';
if ($converter->GetSkipConversion())
{
echo '';
}
else
{
echo '';
flush();
$converter->DoConversion();
// Configure cancel button click to abort FFmpeg process if conversion is canceled.
$_SESSION['ffmpegCmd'] = str_rot13(base64_encode(str_rot13(preg_replace('/( 2>.+)$/', "", $converter->GetFFmpegCommand()))));
$_SESSION['token'] = $_SESSION[Config::_SITENAME];
$_SESSION['tempVid'] = $converter->GetTempVidFileName();
$converter->FlushBuffer();
}
}
else
{
echo '
'.Download_Error_Message.'
'.Validation_Error_Suffix.'
';
}
}
}
else
{
echo '
'.$_SESSION['translations'][$converter->GetValidationError()].' '.Validation_Error_Suffix.'
';
}
}
?>
$currentVideoId,
'vidTitle' => $vidInfo['title'],
'vidImage' => $vidInfo['thumb_preview'],
'vidHost' => $converter->GetCurrentVidHost(),
'ftype' => $converter->GetConvertedFileType()
);
include 'inc/share_buttons_popup.php';
}
?>