Файл: vsime.com/files/inc/act_flv.php
Строк: 36
<?
### 20:15 31.07.2013 ###
@ob_clean();
$unique_code = "unique_code";
$get_unique_code = hsc($_GET['unique_code']);
$mdp_unique_code = hsc($_GET['mdp_unique_code']);
$q = mysqli_query($dbi, "SELECT * FROM `files`");
$id_file = 0;
while ($post = mysqli_fetch_array($q)) {
if (md5($post['id']) == my_esc(hsc($_GET['md5_id'])))$id_file = $post['id'];
}
$file = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `files` WHERE `id` = '".intval($id_file)."' AND `type` = 'file'"));
if (@$file['id']) {
if ($get_unique_code != $unique_code || $mdp_unique_code != $mdp) {
locon(" /files/?file=$file[id]");
exit();
}
$dir = dir_files_info($file['id_dir']);
$ank = profile($file['id_user']);
if (!dir_files_access($dir, NULL, 1)) {
dir_files_access($dir, access_denied());
}
$file['path'] = H."system/files/files/users/user$ank[id]/dir$file[id_dir]/".$file['id'].".dat";
$file['path_flv'] = H."i/tmp_flv/".$file['id'].".video.flv";
$video_rasar = array('3gp', '3gp2', 'asf', 'avi', 'flv', 'mp4', 'mpe', 'mpeg', 'mpg', 'wmv');
if (in_array($file['ras'], $video_rasar)) {
if (is_file($file['path_flv'])) {
$file['path_run'] = $file['path_flv'];
DownloadFile($file['path_run'], "video.flv", ras_to_mime("flv"));
exit();
} else {
$ffmpeg = new ffmpeg_movie($file['path']);
$width = 2 * $ffmpeg->getFrameWidth();
$height = 2 * $ffmpeg->getFrameHeight();
$file['path_run'] = H."i/tmp_flv/0.video.flv";
DownloadFile($file['path_run'], "video.flv", ras_to_mime("flv"));
system("ffmpeg -i $file[path] -ar 44100 -s ".$width."x".$height." -f flv $file[path_flv]");
exit();
}
} else {
$text = "It's not a video";
}
} else {
$text = "File not founded";
}
header("Content-type: image/png");
$image = imagecreate(200, 18);
$background_color = imagecolorallocate ($image, 255, 255, 255);
$count_chars = 2;
$black = imagecolorallocate($image, 255, 0, 0);
ImageString($image,6,$count_chars,1,$text,$black);
imagepng($image);
imagedestroy($image);
exit();
?>