3590 lines
141 KiB
PHP
3590 lines
141 KiB
PHP
|
|
<?php
|
||
|
|
//last one removed: video_groupmanage_jobs3
|
||
|
|
/* $Id: functions_video.php 120 2009-03-17 22:35:01Z john $ */
|
||
|
|
|
||
|
|
|
||
|
|
//
|
||
|
|
// THIS FILE CONTAINS VIDEO-RELATED FUNCTIONS
|
||
|
|
//
|
||
|
|
// FUNCTIONS IN THIS CLASS:
|
||
|
|
// video_manage_jobs()
|
||
|
|
// search_video()
|
||
|
|
// deleteuser_video()
|
||
|
|
// site_statistics_video()
|
||
|
|
// extract_youtube_code()
|
||
|
|
//
|
||
|
|
|
||
|
|
defined('SE_PAGE') or exit();
|
||
|
|
//if(SE_DEBUG1){
|
||
|
|
require("include/getid3/getid3.php");/*}else{
|
||
|
|
require("include/getid/getid3/getid3.php");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
function tag_videos()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results,$id;
|
||
|
|
$vidsonly=1;
|
||
|
|
if($vidsonly==1){
|
||
|
|
// CONSTRUCT QUERY
|
||
|
|
$video_query = "SELECT
|
||
|
|
se_videos.*,
|
||
|
|
se_users.user_id,
|
||
|
|
se_users.user_username,
|
||
|
|
se_users.user_photo,
|
||
|
|
se_users.user_fname,
|
||
|
|
se_users.user_lname
|
||
|
|
FROM
|
||
|
|
se_videos,
|
||
|
|
se_users,
|
||
|
|
se_levels, bateworldcom_zips.videointeresttagged
|
||
|
|
WHERE
|
||
|
|
se_videos.approved=1 AND se_videos.shadowbanned=0 AND
|
||
|
|
se_videos.video_user_id=se_users.user_id AND
|
||
|
|
se_users.user_enabled=1 AND
|
||
|
|
se_users.user_level_id=se_levels.level_id AND
|
||
|
|
(
|
||
|
|
se_videos.video_search='1' OR
|
||
|
|
se_levels.level_video_search='0'
|
||
|
|
)
|
||
|
|
AND bateworldcom_zips.videointeresttagged.user_id=video_id AND bateworldcom_zips.videointeresttagged.interest_id='".$database->database_real_escape_string($id)."'
|
||
|
|
AND se_videos.video_admin_approved=1";
|
||
|
|
}else{
|
||
|
|
$video_query = "SELECT
|
||
|
|
se_videos.*,
|
||
|
|
se_users.user_id,
|
||
|
|
se_users.user_username,
|
||
|
|
se_users.user_photo,
|
||
|
|
se_users.user_fname,
|
||
|
|
se_users.user_lname
|
||
|
|
FROM
|
||
|
|
se_videos,
|
||
|
|
se_users,
|
||
|
|
se_levels
|
||
|
|
WHERE
|
||
|
|
se_videos.approved=1 AND
|
||
|
|
se_videos.video_user_id=se_users.user_id AND
|
||
|
|
se_users.user_enabled=1 AND
|
||
|
|
se_users.user_level_id=se_levels.level_id AND
|
||
|
|
(
|
||
|
|
se_videos.video_search='1' OR
|
||
|
|
se_levels.level_video_search='0'
|
||
|
|
)
|
||
|
|
AND
|
||
|
|
(
|
||
|
|
se_videos.video_title LIKE '%$search_text%' OR
|
||
|
|
se_videos.video_desc LIKE '%$search_text%'
|
||
|
|
) AND se_videos.video_admin_approved=1";
|
||
|
|
}
|
||
|
|
|
||
|
|
// GET TOTAL RESULTS
|
||
|
|
$total_videos = $database->database_num_rows($database->database_query($video_query.""));
|
||
|
|
|
||
|
|
// IF NOT TOTAL ONLY
|
||
|
|
if($t == "" || $t == "video") {
|
||
|
|
|
||
|
|
// MAKE VIDEO PAGES
|
||
|
|
$start = ($p - 1) * $results_per_page;
|
||
|
|
$limit = $results_per_page+1;
|
||
|
|
|
||
|
|
// SEARCH VIDEOS
|
||
|
|
$video = new se_video();
|
||
|
|
$videos = $database->database_query($video_query." ORDER BY video_id DESC LIMIT $start, $limit");
|
||
|
|
while($video_info = $database->database_fetch_assoc($videos)) {
|
||
|
|
|
||
|
|
// CREATE AN OBJECT FOR USER
|
||
|
|
$profile = new se_user();
|
||
|
|
$profile->user_info["user_id"] = $video_info["user_id"];
|
||
|
|
$profile->user_info["user_username"] = $video_info["user_username"];
|
||
|
|
$profile->user_info["user_fname"] = $video_info["user_fname"];
|
||
|
|
$profile->user_info["user_lname"] = $video_info["user_lname"];
|
||
|
|
$profile->user_info["user_photo"] = $video_info["user_photo"];
|
||
|
|
$profile->user_displayname();
|
||
|
|
|
||
|
|
// SET RESULT VARS
|
||
|
|
$result_url = $url->url_create("video", $video_info["user_username"], $video_info["video_id"]);
|
||
|
|
$result_name = 5500141;
|
||
|
|
$result_desc = 5500142;
|
||
|
|
|
||
|
|
// SET DIRECTORY
|
||
|
|
$video_info["video_dir"] = $video->video_dir($video_info["user_id"]);
|
||
|
|
|
||
|
|
// CHECK FOR THUMBNAIL
|
||
|
|
$thumb_path = IMAGECDN1.$video_info["video_dir"].$video_info["video_id"]."_thumb.jpg";
|
||
|
|
//if(!file_exists($thumb_path)) { $video_info[video_thumb] = "./images/video_placeholder.gif"; }
|
||
|
|
|
||
|
|
// IF NO TITLE
|
||
|
|
if($video_info["video_title"] == "") { $video_info["video_title"] = SE_Language::get(589); }
|
||
|
|
|
||
|
|
// IF DESCRIPTION IS LONG
|
||
|
|
if(strlen($video_info["video_desc"]) > 150) { $video_info["video_desc"] = substr($video_info["video_desc"], 0, 147)."..."; }
|
||
|
|
$minutes = floor($video_info['video_duration_in_sec']/60);
|
||
|
|
$seconds = $video_info['video_duration_in_sec']-60*$minutes;
|
||
|
|
$video_info['video_duration_in_min'] = sprintf("%02d:%02d", $minutes, $seconds);
|
||
|
|
$results[] = Array('result_url' => $result_url,
|
||
|
|
'result_icon' => $thumb_path,
|
||
|
|
'result_name' => $result_name,
|
||
|
|
'result_name_1' => $video_info["video_title"],
|
||
|
|
'time' => $video_info["video_datecreated"],
|
||
|
|
'result_desc' => $result_desc,
|
||
|
|
'result_desc_1' => $url->url_create('profile', $video_info["user_username"]),
|
||
|
|
'result_desc_2' => $profile->user_displayname,
|
||
|
|
'result_desc_3' => $video_info["video_desc"],
|
||
|
|
'video_duration_in_min' => $video_info["video_duration_in_min"],
|
||
|
|
'video_views' => $video_info["video_views"],
|
||
|
|
'video_id' => $video_info["video_id"]);
|
||
|
|
}
|
||
|
|
|
||
|
|
// SET TOTAL RESULTS
|
||
|
|
$total_results = $total_videos;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// SET ARRAY VALUES
|
||
|
|
SE_Language::_preload_multi(5500141, 5500142, 5500143);
|
||
|
|
if($total_videos > 200) { $total_videos = "200+"; }
|
||
|
|
$search_objects[] = Array('search_type' => 'video',
|
||
|
|
'search_lang' => 5500143,
|
||
|
|
'search_total' => $total_videos);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
function search_video_new($vidsonly="")
|
||
|
|
{
|
||
|
|
global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;
|
||
|
|
if($vidsonly==1){
|
||
|
|
// CONSTRUCT QUERY
|
||
|
|
$video_query = "SELECT
|
||
|
|
se_videos.*,
|
||
|
|
se_users.user_id,
|
||
|
|
se_users.user_username,
|
||
|
|
se_users.user_photo,
|
||
|
|
se_users.user_fname,
|
||
|
|
se_users.user_lname
|
||
|
|
FROM
|
||
|
|
se_videos,
|
||
|
|
se_users,
|
||
|
|
se_levels
|
||
|
|
WHERE
|
||
|
|
se_videos.approved=1 AND
|
||
|
|
se_videos.video_user_id=se_users.user_id AND
|
||
|
|
se_users.user_enabled=1 AND
|
||
|
|
se_users.user_level_id=se_levels.level_id AND
|
||
|
|
(
|
||
|
|
se_videos.video_search='1' OR
|
||
|
|
se_levels.level_video_search='0'
|
||
|
|
)
|
||
|
|
AND
|
||
|
|
(
|
||
|
|
(se_videos.video_title LIKE '%$search_text%' OR
|
||
|
|
se_videos.video_desc LIKE '%$search_text%')
|
||
|
|
OR (se_users.user_username LIKE '%$search_text%')
|
||
|
|
) AND se_videos.video_admin_approved=1";
|
||
|
|
}else{
|
||
|
|
$video_query = "SELECT
|
||
|
|
se_videos.*,
|
||
|
|
se_users.user_id,
|
||
|
|
se_users.user_username,
|
||
|
|
se_users.user_photo,
|
||
|
|
se_users.user_fname,
|
||
|
|
se_users.user_lname
|
||
|
|
FROM
|
||
|
|
se_videos,
|
||
|
|
se_users,
|
||
|
|
se_levels
|
||
|
|
WHERE
|
||
|
|
se_videos.approved=1 AND
|
||
|
|
se_videos.video_user_id=se_users.user_id AND
|
||
|
|
se_users.user_enabled=1 AND
|
||
|
|
se_users.user_level_id=se_levels.level_id AND
|
||
|
|
(
|
||
|
|
se_videos.video_search='1' OR
|
||
|
|
se_levels.level_video_search='0'
|
||
|
|
)
|
||
|
|
AND
|
||
|
|
(
|
||
|
|
se_videos.video_title LIKE '%$search_text%' OR
|
||
|
|
se_videos.video_desc LIKE '%$search_text%'
|
||
|
|
) AND se_videos.video_admin_approved=1";
|
||
|
|
}
|
||
|
|
|
||
|
|
// GET TOTAL RESULTS
|
||
|
|
$total_videos = $database->database_num_rows($database->database_query($video_query.""));
|
||
|
|
|
||
|
|
// IF NOT TOTAL ONLY
|
||
|
|
if($t == "" || $t == "video") {
|
||
|
|
|
||
|
|
// MAKE VIDEO PAGES
|
||
|
|
$start = ($p - 1) * $results_per_page;
|
||
|
|
$limit = $results_per_page+1;
|
||
|
|
|
||
|
|
// SEARCH VIDEOS
|
||
|
|
$video = new se_video();
|
||
|
|
$videos = $database->database_query($video_query." ORDER BY video_id DESC LIMIT $start, $limit");
|
||
|
|
while($video_info = $database->database_fetch_assoc($videos)) {
|
||
|
|
|
||
|
|
// CREATE AN OBJECT FOR USER
|
||
|
|
$profile = new se_user();
|
||
|
|
$profile->user_info["user_id"] = $video_info["user_id"];
|
||
|
|
$profile->user_info["user_username"] = $video_info["user_username"];
|
||
|
|
$profile->user_info["user_fname"] = $video_info["user_fname"];
|
||
|
|
$profile->user_info["user_lname"] = $video_info["user_lname"];
|
||
|
|
$profile->user_info["user_photo"] = $video_info["user_photo"];
|
||
|
|
$profile->user_displayname();
|
||
|
|
|
||
|
|
// SET RESULT VARS
|
||
|
|
$result_url = $url->url_create("video", $video_info["user_username"], $video_info["video_id"]);
|
||
|
|
$result_name = 5500141;
|
||
|
|
$result_desc = 5500142;
|
||
|
|
|
||
|
|
// SET DIRECTORY
|
||
|
|
$video_info["video_dir"] = $video->video_dir($video_info["user_id"]);
|
||
|
|
|
||
|
|
// CHECK FOR THUMBNAIL
|
||
|
|
$thumb_path = IMAGECDN1.$video_info["video_dir"].$video_info["video_id"]."_thumb.jpg";
|
||
|
|
//if(!file_exists($thumb_path)) { $video_info[video_thumb] = "./images/video_placeholder.gif"; }
|
||
|
|
|
||
|
|
// IF NO TITLE
|
||
|
|
if($video_info["video_title"] == "") { $video_info["video_title"] = SE_Language::get(589); }
|
||
|
|
|
||
|
|
// IF DESCRIPTION IS LONG
|
||
|
|
if(strlen($video_info["video_desc"]) > 150) { $video_info["video_desc"] = substr($video_info["video_desc"], 0, 147)."..."; }
|
||
|
|
$minutes = floor($video_info['video_duration_in_sec']/60);
|
||
|
|
$seconds = $video_info['video_duration_in_sec']-60*$minutes;
|
||
|
|
$video_info['video_duration_in_min'] = sprintf("%02d:%02d", $minutes, $seconds);
|
||
|
|
$results[] = Array('result_url' => $result_url,
|
||
|
|
'result_icon' => $thumb_path,
|
||
|
|
'result_name' => $result_name,
|
||
|
|
'result_name_1' => $video_info["video_title"],
|
||
|
|
'time' => $video_info["video_datecreated"],
|
||
|
|
'result_desc' => $result_desc,
|
||
|
|
'result_desc_1' => $url->url_create('profile', $video_info["user_username"]),
|
||
|
|
'result_desc_2' => $profile->user_displayname,
|
||
|
|
'result_desc_3' => $video_info["video_desc"],
|
||
|
|
'video_duration_in_min' => $video_info["video_duration_in_min"],
|
||
|
|
'video_views' => $video_info["video_views"],
|
||
|
|
'video_id' => $video_info["video_id"]);
|
||
|
|
}
|
||
|
|
|
||
|
|
// SET TOTAL RESULTS
|
||
|
|
$total_results = $total_videos;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// SET ARRAY VALUES
|
||
|
|
SE_Language::_preload_multi(5500141, 5500142, 5500143);
|
||
|
|
if($total_videos > 200) { $total_videos = "200+"; }
|
||
|
|
$search_objects[] = Array('search_type' => 'video',
|
||
|
|
'search_lang' => 5500143,
|
||
|
|
'search_total' => $total_videos);
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function check_bate_videos()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM bate_videos WHERE is_converted=2 AND rawfile!=''");
|
||
|
|
$video = new se_video();
|
||
|
|
echo "R";
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
echo "A";
|
||
|
|
$directory="./bate_videos/";
|
||
|
|
$directory1="bate_videos/";
|
||
|
|
if(file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
echo $row["video_id"];
|
||
|
|
|
||
|
|
$database->database_query("UPDATE bate_videos SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"].".mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1.$row["id"].".mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1.$row["id"].".mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"].".jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1.$row["id"].".jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1.$row["id"].".jpg");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE bate_videos SET is_converted='0' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function manage_bate_videos(){
|
||
|
|
//remove function is fine
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$getID3 = new getID3;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*echo("Duration: ".$file['playtime_string'].
|
||
|
|
" / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
|
||
|
|
" / Filesize: ".$file['filesize']." bytes<br />");*/
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM bate_videos WHERE is_converted=0 AND rawfile!='' AND attempt<6 ORDER BY id LIMIT 1");
|
||
|
|
$job_counter = 0;
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done", $database->database_num_rows($query));
|
||
|
|
if($database->database_num_rows($query)==0){
|
||
|
|
groupvideo_reencode();
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
//mail("leprakhauns@gmail.com", "Bator Training Started", "Bator Training Started");
|
||
|
|
//echo "SELECT * FROM bateworldcom_zips.bator_training WHERE video_is_converted=0 AND rawfile!='' AND video_user_id='7653' ORDER BY id LIMIT 1";
|
||
|
|
while($row=$database->database_fetch_array($query))
|
||
|
|
{
|
||
|
|
$database->database_query("UPDATE bate_videos SET attempt=attempt+1 WHERE id='".$row["id"]."'");
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done 2", $row["id"]);
|
||
|
|
$directory="./bate_videos/";
|
||
|
|
$directory1="bate_videos/";
|
||
|
|
|
||
|
|
$file = $getID3->analyze($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
//var_dump($file);
|
||
|
|
if($file['video']['resolution_x']>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
}
|
||
|
|
else{ $width=$file['video']['resolution_x'];}
|
||
|
|
if($file['video']['resolution_y']>1920)
|
||
|
|
{
|
||
|
|
$width=1080;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
//echo $width;
|
||
|
|
|
||
|
|
|
||
|
|
$duration=$file['playtime_seconds'];
|
||
|
|
$min_duration = 1;
|
||
|
|
|
||
|
|
|
||
|
|
if(empty($duration) || $duration <= $min_duration)
|
||
|
|
{
|
||
|
|
|
||
|
|
$user_info = $database->database_fetch_assoc($database->database_query("SELECT id FROM bate_videos WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$database->database_query("UPDATE bate_videos SET is_converted='-1' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."'");
|
||
|
|
|
||
|
|
$directory = getcwd().substr($video->video_dir($user_info["video_user_id"]), 1);
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
unlink($directory.$row["id"].'_thumb.jpg');
|
||
|
|
}
|
||
|
|
|
||
|
|
// VIDEO WAS ENCODED SUCCESSFULLY, UPDATE DATABASE
|
||
|
|
else
|
||
|
|
{
|
||
|
|
echo $row["id"];
|
||
|
|
if(!file_exists()){
|
||
|
|
|
||
|
|
//$dir = opendir('uploads_video/encoding/queue/'); # This is the directory it will count from
|
||
|
|
$i = 0; # Integer starts at 0 before counting
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE bate_videos SET video='".$directory.$row["id"].".mp4', picture='".$directory.$row["id"]."_thumb.jpg', is_converted='2', video_duration_in_sec='".$duration."' WHERE id='".$row["id"]."'");
|
||
|
|
// /usr/local/bin/ffmpeg -i testconversion.mp4 -f null /dev/null 2>&1
|
||
|
|
$a= exec("{$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]. " -f null /dev/null 2>&1", $o, $t);
|
||
|
|
//echo $o[30];
|
||
|
|
$o=implode("//", $o);
|
||
|
|
$o=str_replace(" ", "",$o);
|
||
|
|
$o=explode("rotate:",$o);
|
||
|
|
|
||
|
|
if($o[1]!=""){
|
||
|
|
|
||
|
|
$t=explode("//", $o[1]);
|
||
|
|
$rotate=$t[0];
|
||
|
|
if($rotate==180)
|
||
|
|
{
|
||
|
|
$vf='-vf "vflip,hflip"';
|
||
|
|
}
|
||
|
|
else{$vf="";}
|
||
|
|
}
|
||
|
|
else{$rotate="";}
|
||
|
|
|
||
|
|
//echo "touch uploads_video/encoding/queue/".$row["id"];exit;
|
||
|
|
//-vf scale=320:-1
|
||
|
|
|
||
|
|
$output=shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -vf scale=".$width.":-2 -f image2 -ss 4.00 -vframes 1 {$directory}".$row["id"]."_thumb.jpg 2>&1 \n");
|
||
|
|
|
||
|
|
$image_info = getimagesize($directory.$row["id"]."_thumb.jpg");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if($image_info[0]>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
$height=-2;
|
||
|
|
}
|
||
|
|
else{ $width=$image_info[0]; $height=-2;}
|
||
|
|
if($image_info[1]>1920)
|
||
|
|
{
|
||
|
|
$width=-2;
|
||
|
|
$height=1920;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
if($height%2!=0){$height=$height-1;}
|
||
|
|
//sleep(10);
|
||
|
|
|
||
|
|
//sleep(300);
|
||
|
|
|
||
|
|
//54038.original.mp4
|
||
|
|
///bin/nice /usr/local/bin/ffmpeg -i coachtyler.mp4 -movflags faststart -vcodec h264 -acodec aac -strict -2 -vf scale=1920:-1 coachtyler1.mp4
|
||
|
|
// /bin/nice /usr/local/bin/ffmpeg -i testconversion.mp4 -movflags faststart -codec:v libx264 -preset fast -acodec aac -strict -2 -vf scale=1920:-2 testconversion1.mp4
|
||
|
|
// /bin/nice /usr/local/bin/ffmpeg -i coachtyler.mp4 -movflags faststart -threads 3 -codec:v libx264 -preset fast -acodec aac -strict -2 -vf scale=1920:-2 coachtyler2.mp4
|
||
|
|
|
||
|
|
// /bin/nice /usr/local/bin/ffmpeg -i 93766.mp4 -movflags faststart -threads 3 -codec:v libx264 -preset fast -acodec aac -strict -2 -vf "format=yuv420p, scale=1920:-2" iii.mp4
|
||
|
|
shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -movflags faststart -threads 3 -codec:v libx264 -preset fast -acodec aac -strict -2 -vf 'format=yuv420p, scale=".$width.":".$height."' ".$directory.$row["id"].".mp4");
|
||
|
|
|
||
|
|
//shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -y -vcodec libx264 -g 30 -vf scale=".$width.":-1 ".$directory.$row["id"].".mp4 2>&1 \n");
|
||
|
|
//mail("leprakhauns@gmail.com", "Bator Training Ended", "Bator Training Ended");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function introvideocheckconversion1()
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_users WHERE video_is_converted=2 AND rawfile!=''");
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
|
||
|
|
$directory=$url->url_userdir($row["user_id"]);
|
||
|
|
echo "A";
|
||
|
|
if(file_exists($directory."a12541a.mp4")){
|
||
|
|
echo "R";
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_users SET video_is_converted='1', introapproved='1', attempt=0 WHERE user_id='".htmlspecialchars(strip_tags($row["user_id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$action_media = array();
|
||
|
|
$thumb_path = str_replace('./', '', $directory."a12541a_thumb.jpg");
|
||
|
|
|
||
|
|
|
||
|
|
if( file_exists($thumb_path) )
|
||
|
|
{
|
||
|
|
$media_width = $misc->photo_size($thumb_path, "100", "100", "w");
|
||
|
|
$media_height = $misc->photo_size($thumb_path, "100", "100", "h");
|
||
|
|
$action_media[] = array(
|
||
|
|
'media_link' => $media_link,
|
||
|
|
'media_path' => $thumb_path,
|
||
|
|
'media_width' => $media_width,
|
||
|
|
'media_height' => $media_height
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
// INSERT ACTION
|
||
|
|
//if(strlen($video_info[video_title]) > 100) { $video_info[video_title] = substr($video_info['video_title'], 0, 97); $video_info['video_title'] .= "..."; }
|
||
|
|
|
||
|
|
# $actions->actions_add($author, "newvideo", array($author->user_info['user_username'], $author->user_displayname, $video_info['video_id'], $video_info['video_title']), $action_media, 0, false, "user", $author->user_info['user_id'], $author->user_info['user_privacy']);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory."a12541a.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory."a12541a.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory."a12541a.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory."a12541a_thumb.jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory."a12541a_thumb.jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory."a12541a_thumb.jpg");
|
||
|
|
|
||
|
|
}
|
||
|
|
elseif(!file_exists($directory."a12541a.mp4")){
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function mbmGetFLVDuration($file){
|
||
|
|
global $setting;
|
||
|
|
|
||
|
|
//$time = 00:00:00.000 format
|
||
|
|
$time = exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$file." 2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//");
|
||
|
|
|
||
|
|
$duration = explode(":",$time);
|
||
|
|
$duration_in_seconds = $duration[0]*3600 + $duration[1]*60+ round($duration[2]);
|
||
|
|
|
||
|
|
return $duration_in_seconds;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// THIS FUNCTION TRIGGERS THE JOB QUEUE TO RUN
|
||
|
|
// INPUT:
|
||
|
|
// OUTPUT:
|
||
|
|
|
||
|
|
function video_groupmanage_jobs3()
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
mail("sean@bateworld.com", "video_groupmanage_jobs3", "video_groupmanage_jobs3");
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_group_videos WHERE video_duration_in_sec=0 AND video_uploaded='1' AND video_is_converted=0 AND attempt<11 AND rawfile!='' ORDER BY video_id DESC LIMIT 1");
|
||
|
|
$job_counter = 0;
|
||
|
|
|
||
|
|
if($database->database_num_rows($query)==0){
|
||
|
|
//video_intro2();
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
|
||
|
|
$getID3 = new getID3;
|
||
|
|
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query))
|
||
|
|
{
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_group_videos SET attempt=attempt+1 WHERE video_id='".$row["video_id"]."'");
|
||
|
|
$directory=group_dir($row["video_group_id"]);
|
||
|
|
$file = $getID3->analyze($directory.$row["rawfile"]);
|
||
|
|
if($file['video']['resolution_x']>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
}
|
||
|
|
else{ $width=$file['video']['resolution_x'];}
|
||
|
|
if($file['video']['resolution_y']>1920)
|
||
|
|
{
|
||
|
|
$width=1080;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
//echo $width;
|
||
|
|
|
||
|
|
|
||
|
|
$duration=$file['playtime_seconds'];;
|
||
|
|
|
||
|
|
|
||
|
|
//echo "<br />".$duration."<br />";
|
||
|
|
$min_duration = 1;
|
||
|
|
|
||
|
|
// mail("leprakhauns@gmail.com", "Bateworld Video Cron", "Bateworld Cron");
|
||
|
|
// DELETE VIDEO IF ENCODING WAS SCREWED UP
|
||
|
|
if(empty($duration) || $duration <= $min_duration)
|
||
|
|
{
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Bateworld Video Cron Failed", "Bateworld Cron ".$video_id);
|
||
|
|
// GET USER ID
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_group_videos SET video_is_converted='-1' WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."'");
|
||
|
|
|
||
|
|
//$directory = getcwd().substr($video->video_dir($user_info[video_user_id]), 1);
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
unlink($directory."video_".$row["video_id"].'_thumb.jpg');
|
||
|
|
}
|
||
|
|
|
||
|
|
// VIDEO WAS ENCODED SUCCESSFULLY, UPDATE DATABASE
|
||
|
|
else
|
||
|
|
{
|
||
|
|
echo $row["video_id"];
|
||
|
|
if(!file_exists($directory."video_".$row["video_id"].".mp4")){
|
||
|
|
|
||
|
|
$dir = opendir('uploads_video/encoding/queue/'); # This is the directory it will count from
|
||
|
|
$i = 0; # Integer starts at 0 before counting
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_group_videos SET video_is_converted='2', video_duration_in_sec='".$duration."' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$output=shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -vf scale=".$width.":-2 -f image2 -ss 4.00 -vframes 1 {$directory}"."video_".$row["video_id"]."_thumb.jpg 2>&1 \n");
|
||
|
|
|
||
|
|
$image_info = getimagesize($directory."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if($image_info[0]>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
$height=-2;
|
||
|
|
}
|
||
|
|
else{ $width=$image_info[0]; $height=-2;}
|
||
|
|
if($image_info[1]>1920)
|
||
|
|
{
|
||
|
|
$width=-2;
|
||
|
|
$height=1920;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
if($height%2!=0){$height=$height-1;}
|
||
|
|
//sleep(10);
|
||
|
|
|
||
|
|
//sleep(300);
|
||
|
|
|
||
|
|
shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -movflags faststart -codec:v libx264 -preset fast -acodec aac -strict -2 -vf 'format=yuv420p, scale=".$width.":".$height."' ".$directory."video_".$row["video_id"].".mp4");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}/*
|
||
|
|
else{
|
||
|
|
if($row["twice"]==0){
|
||
|
|
if($row["video_duration_in_sec"]==NULL||$row["video_duration_in_sec"]==0)
|
||
|
|
{
|
||
|
|
unlink($directory."video_".$row["video_id"].".mp4");
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_group_videos SET video_is_converted='0', `twice`=1 WHERE video_id='".$row["video_id"]."'");
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
$database->database_query("UPDATE se_group_videos SET video_is_converted='1', video_admin_approved='1' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
elseif($row["twice"]==1){
|
||
|
|
if($row["video_duration_in_sec"]==NULL||$row["video_duration_in_sec"]==0)
|
||
|
|
{
|
||
|
|
unlink($directory."video_".$row["video_id"].".mp4");
|
||
|
|
$database->database_query("UPDATE se_group_videos SET video_is_converted='0', `twice`=2 WHERE video_id='".$row["video_id"]."'");
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
$database->database_query("UPDATE se_group_videos SET video_is_converted='1', video_admin_approved='1' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
unlink($directory."video_".$row["video_id"].".mp4");
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
$database->database_query("UPDATE se_group_videos SET rawfile='', video_duration_in_sec=0, video_uploaded='0' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
}
|
||
|
|
|
||
|
|
}*/
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// SET JOB COUNTER VAR
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function video_intro2()
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
return;
|
||
|
|
$query=$database->database_query("SELECT * FROM se_users WHERE video_is_converted='0' AND rawfile!='' AND attempt<5 ORDER BY introtime DESC LIMIT 1");
|
||
|
|
//$query=$database->database_query("SELECT * FROM se_users WHERE user_id=7653 AND video_is_converted='0' AND rawfile!='' ORDER BY introtime DESC LIMIT 1");
|
||
|
|
$job_counter = 0;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$getID3 = new getID3;
|
||
|
|
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query))
|
||
|
|
{
|
||
|
|
$database->database_query("UPDATE se_users SET attempt=attempt+1 WHERE user_id='".$row["user_id"]."'");
|
||
|
|
|
||
|
|
$directory=$url->url_userdir($row["user_id"]);
|
||
|
|
|
||
|
|
$file = $getID3->analyze($directory.$row["rawfile"]);
|
||
|
|
if(file_exists($directory."a12541a.mp4"))
|
||
|
|
{
|
||
|
|
@unlink($directory."a12541a.mp4");
|
||
|
|
}
|
||
|
|
//var_dump($file);
|
||
|
|
if($file['video']['resolution_x']>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
}
|
||
|
|
else{ $width=$file['video']['resolution_x'];}
|
||
|
|
if($file['video']['resolution_y']>1920)
|
||
|
|
{
|
||
|
|
$width=1080;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
//echo $width;
|
||
|
|
|
||
|
|
|
||
|
|
$duration=$file['playtime_seconds'];;
|
||
|
|
|
||
|
|
//echo "<br />".$duration."<br />";
|
||
|
|
$min_duration = 1;
|
||
|
|
|
||
|
|
// mail("leprakhauns@gmail.com", "Bateworld Video Cron", "Bateworld Cron");
|
||
|
|
// DELETE VIDEO IF ENCODING WAS SCREWED UP
|
||
|
|
if(empty($duration) || $duration <= $min_duration)
|
||
|
|
{
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Bateworld Video Cron Failed", "Bateworld Cron ".$video_id);
|
||
|
|
// GET USER ID
|
||
|
|
//$user_info = $database->database_fetch_assoc($database->database_query("SELECT video_user_id FROM se_group_videos WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_users SET introduration='-1', rawfile='', attempt=0 WHERE user_id='".htmlspecialchars(strip_tags($row["user_id"]))."'");
|
||
|
|
|
||
|
|
//$directory = getcwd().substr($video->video_dir($user_info[video_user_id]), 1);
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
//unlink($directory."video_".$row["video_id"].'_thumb.jpg');
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
echo $directory."a12541a.mp4";
|
||
|
|
if(!file_exists($directory."a12541a.mp4")){
|
||
|
|
|
||
|
|
$dir = opendir('uploads_video/encoding/queue/'); # This is the directory it will count from
|
||
|
|
$i = 0; # Integer starts at 0 before counting
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_users SET video_is_converted='2', introduration='".$duration."' WHERE user_id='".$row["user_id"]."'");
|
||
|
|
//echo "touch uploads_video/encoding/queue/".$row["video_id"];exit;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$output=shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -vf scale=".$width.":-2 -f image2 -ss 4.00 -vframes 1 {$directory}".$row["video_id"]."a12541a_thumb.jpg 2>&1 \n");
|
||
|
|
|
||
|
|
$image_info = getimagesize($directory.$row["video_id"]."a12541a_thumb.jpg");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if($image_info[0]>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
$height=-2;
|
||
|
|
}
|
||
|
|
else{ $width=$image_info[0]; $height=-2;}
|
||
|
|
if($image_info[1]>1920)
|
||
|
|
{
|
||
|
|
$width=-2;
|
||
|
|
$height=1920;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
if($height%2!=0){$height=$height-1;}
|
||
|
|
|
||
|
|
// $output=shell_exec("/bin/nice -n 10 {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -s ".$setting['setting_video_thumb_width']."x".$setting['setting_video_thumb_height']." -f image2 -ss 4.00 -vframes 1 {$directory}"."a12541a_thumb.jpg 2>&1 \n");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -movflags faststart -codec:v libx264 -preset fast -acodec aac -strict -2 -vf 'format=yuv420p, scale=".$width.":".$height."' ".$directory."a12541a.mp4");
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// SET JOB COUNTER VAR
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
function managetraining(){
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$getID3 = new getID3;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*echo("Duration: ".$file['playtime_string'].
|
||
|
|
" / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
|
||
|
|
" / Filesize: ".$file['filesize']." bytes<br />");*/
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM bateworldcom_zips.bator_training WHERE is_converted=0 AND rawfile!='' AND attempt<6 ORDER BY id LIMIT 1");
|
||
|
|
$job_counter = 0;
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done", $database->database_num_rows($query));
|
||
|
|
if($database->database_num_rows($query)==0){
|
||
|
|
manage_training_preview();
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
mail("leprakhauns@gmail.com", "Bator Training Started", "Bator Training Started");
|
||
|
|
//echo "SELECT * FROM bateworldcom_zips.bator_training WHERE video_is_converted=0 AND rawfile!='' AND video_user_id='7653' ORDER BY id LIMIT 1";
|
||
|
|
while($row=$database->database_fetch_array($query))
|
||
|
|
{
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bator_training SET attempt=attempt+1 WHERE id='".$row["id"]."'");
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done 2", $row["id"]);
|
||
|
|
$directory="./batortraining/";
|
||
|
|
|
||
|
|
$directory1="batortraining/";
|
||
|
|
$file = $getID3->analyze($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
//var_dump($file);
|
||
|
|
if($file['video']['resolution_x']>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
}
|
||
|
|
else{ $width=$file['video']['resolution_x'];}
|
||
|
|
if($file['video']['resolution_y']>1920)
|
||
|
|
{
|
||
|
|
$width=1080;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
//echo $width;
|
||
|
|
|
||
|
|
|
||
|
|
$duration=$file['playtime_seconds'];
|
||
|
|
$min_duration = 1;
|
||
|
|
|
||
|
|
|
||
|
|
if(empty($duration) || $duration <= $min_duration)
|
||
|
|
{
|
||
|
|
|
||
|
|
$user_info = $database->database_fetch_assoc($database->database_query("SELECT id FROM bateworldcom_zips.bator_training WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bator_training SET is_converted='-1' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."'");
|
||
|
|
|
||
|
|
$directory = getcwd().substr($video->video_dir($user_info["video_user_id"]), 1);
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
unlink($directory.$row["id"].'_thumb.jpg');
|
||
|
|
}
|
||
|
|
|
||
|
|
// VIDEO WAS ENCODED SUCCESSFULLY, UPDATE DATABASE
|
||
|
|
else
|
||
|
|
{
|
||
|
|
echo $row["id"];
|
||
|
|
if(!file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
//$dir = opendir('uploads_video/encoding/queue/'); # This is the directory it will count from
|
||
|
|
$i = 0; # Integer starts at 0 before counting
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bator_training SET is_converted='2', video_duration_in_sec='".$duration."' WHERE id='".$row["id"]."'");
|
||
|
|
// /usr/local/bin/ffmpeg -i testconversion.mp4 -f null /dev/null 2>&1
|
||
|
|
$a= exec("{$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]. " -f null /dev/null 2>&1", $o, $t);
|
||
|
|
//echo $o[30];
|
||
|
|
$o=implode("//", $o);
|
||
|
|
$o=str_replace(" ", "",$o);
|
||
|
|
$o=explode("rotate:",$o);
|
||
|
|
|
||
|
|
if($o[1]!=""){
|
||
|
|
|
||
|
|
$t=explode("//", $o[1]);
|
||
|
|
$rotate=$t[0];
|
||
|
|
if($rotate==180)
|
||
|
|
{
|
||
|
|
$vf='-vf "vflip,hflip"';
|
||
|
|
}
|
||
|
|
else{$vf="";}
|
||
|
|
}
|
||
|
|
else{$rotate="";}
|
||
|
|
|
||
|
|
//echo "touch uploads_video/encoding/queue/".$row["id"];exit;
|
||
|
|
//-vf scale=320:-1
|
||
|
|
|
||
|
|
$output=shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -vf scale=".$width.":-2 -f image2 -ss 4.00 -vframes 1 {$directory}".$row["id"]."_thumb.jpg 2>&1 \n");
|
||
|
|
|
||
|
|
$image_info = getimagesize($directory.$row["id"]."_thumb.jpg");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if($image_info[0]>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
$height=-2;
|
||
|
|
}
|
||
|
|
else{ $width=$image_info[0]; $height=-2;}
|
||
|
|
if($image_info[1]>1920)
|
||
|
|
{
|
||
|
|
$width=-2;
|
||
|
|
$height=1920;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
if($height%2!=0){$height=$height-1;}
|
||
|
|
//sleep(10);
|
||
|
|
|
||
|
|
//sleep(300);
|
||
|
|
|
||
|
|
//54038.original.mp4
|
||
|
|
///bin/nice /usr/local/bin/ffmpeg -i coachtyler.mp4 -movflags faststart -vcodec h264 -acodec aac -strict -2 -vf scale=1920:-1 coachtyler1.mp4
|
||
|
|
// /bin/nice /usr/local/bin/ffmpeg -i testconversion.mp4 -movflags faststart -codec:v libx264 -preset fast -acodec aac -strict -2 -vf scale=1920:-2 testconversion1.mp4
|
||
|
|
// /bin/nice /usr/local/bin/ffmpeg -i coachtyler.mp4 -movflags faststart -threads 3 -codec:v libx264 -preset fast -acodec aac -strict -2 -vf scale=1920:-2 coachtyler2.mp4
|
||
|
|
shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -movflags faststart -threads 3 -codec:v libx264 -preset fast -acodec aac -strict -2 -vf 'format=yuv420p, scale=".$width.":".$height."' ".$directory.$row["id"].".mp4");
|
||
|
|
|
||
|
|
//shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -y -vcodec libx264 -g 30 -vf scale=".$width.":-1 ".$directory.$row["id"].".mp4 2>&1 \n");
|
||
|
|
mail("leprakhauns@gmail.com", "Bator Training Ended", "Bator Training Ended");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function manage_training_preview()
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$getID3 = new getID3;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*echo("Duration: ".$file['playtime_string'].
|
||
|
|
" / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
|
||
|
|
" / Filesize: ".$file['filesize']." bytes<br />");*/
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM bateworldcom_zips.bator_training WHERE preview_is_converted=0 AND preview_rawfile!='' AND preview_attempt<6 ORDER BY id LIMIT 1");
|
||
|
|
$job_counter = 0;
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done", $database->database_num_rows($query));
|
||
|
|
if($database->database_num_rows($query)==0){
|
||
|
|
video_manage_jobs3();
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
|
||
|
|
//echo "SELECT * FROM bateworldcom_zips.bator_training WHERE video_is_converted=0 AND rawfile!='' AND video_user_id='7653' ORDER BY id LIMIT 1";
|
||
|
|
while($row=$database->database_fetch_array($query))
|
||
|
|
{
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bator_training SET preview_attempt=preview_attempt+1 WHERE id='".$row["id"]."'");
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done 2", $row["id"]);
|
||
|
|
$directory="./batortraining/";
|
||
|
|
$directory1="batortraining/";
|
||
|
|
|
||
|
|
$file = $getID3->analyze($directory.$row["preview_rawfile"]);
|
||
|
|
|
||
|
|
//var_dump($file);
|
||
|
|
if($file['video']['resolution_x']>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
}
|
||
|
|
else{ $width=$file['video']['resolution_x'];}
|
||
|
|
if($file['video']['resolution_y']>1920)
|
||
|
|
{
|
||
|
|
$width=1080;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
//echo $width;
|
||
|
|
|
||
|
|
|
||
|
|
$duration=$file['playtime_seconds'];
|
||
|
|
$min_duration = 1;
|
||
|
|
|
||
|
|
|
||
|
|
if(empty($duration) || $duration <= $min_duration)
|
||
|
|
{
|
||
|
|
|
||
|
|
$user_info = $database->database_fetch_assoc($database->database_query("SELECT id FROM bateworldcom_zips.bator_training WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bator_training SET preview_is_converted='-1' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."'");
|
||
|
|
|
||
|
|
$directory = getcwd().substr($video->video_dir($user_info["video_user_id"]), 1);
|
||
|
|
|
||
|
|
unlink($directory.$row["preview_rawfile"]);
|
||
|
|
unlink($directory.$row["id"].'_preview_thumb.jpg');
|
||
|
|
}
|
||
|
|
|
||
|
|
// VIDEO WAS ENCODED SUCCESSFULLY, UPDATE DATABASE
|
||
|
|
else
|
||
|
|
{
|
||
|
|
echo $row["id"];
|
||
|
|
if(!file_exists($directory."preview_".$row["id"].".mp4")){
|
||
|
|
error_log("UPDATE bateworldcom_zips.bator_training SET preview_is_converted='2', preview_duration_in_seconds='".$duration."' WHERE id='".$row["id"]."'");
|
||
|
|
//$dir = opendir('uploads_video/encoding/queue/'); # This is the directory it will count from
|
||
|
|
$i = 0; # Integer starts at 0 before counting
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bator_training SET preview_is_converted='2', preview_duration_in_seconds='".$duration."' WHERE id='".$row["id"]."'");
|
||
|
|
|
||
|
|
$a= exec("{$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["preview_rawfile"]. " -f null /dev/null 2>&1", $o, $t);
|
||
|
|
//echo $o[30];
|
||
|
|
$o=implode("//", $o);
|
||
|
|
$o=str_replace(" ", "",$o);
|
||
|
|
$o=explode("rotate:",$o);
|
||
|
|
|
||
|
|
if($o[1]!=""){
|
||
|
|
|
||
|
|
$t=explode("//", $o[1]);
|
||
|
|
$rotate=$t[0];
|
||
|
|
if($rotate==180)
|
||
|
|
{
|
||
|
|
$vf='-vf "vflip,hflip"';
|
||
|
|
}
|
||
|
|
else{$vf="";}
|
||
|
|
}
|
||
|
|
else{$rotate="";}
|
||
|
|
|
||
|
|
//echo "touch uploads_video/encoding/queue/".$row["id"];exit;
|
||
|
|
//-vf scale=320:-1
|
||
|
|
|
||
|
|
$output=shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["preview_rawfile"]." -threads 3 -vf scale=".$width.":-2 -f image2 -ss 4.00 -vframes 1 {$directory}".$row["id"]."_preview_thumb.jpg 2>&1 \n");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$image_info = getimagesize($directory.$row["id"]."_preview_thumb.jpg");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if($image_info[0]>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
$height=-2;
|
||
|
|
}
|
||
|
|
else{ $width=$image_info[0]; $height=-2;}
|
||
|
|
if($image_info[1]>1920)
|
||
|
|
{
|
||
|
|
$width=-2;
|
||
|
|
$height=1920;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
if($height%2!=0){$height=$height-1;}
|
||
|
|
//sleep(10);
|
||
|
|
|
||
|
|
//sleep(300);
|
||
|
|
|
||
|
|
//54038.original.mp4
|
||
|
|
///bin/nice /usr/local/bin/ffmpeg -i /home/bateworld/public_html/uploads_video/261000/260515/54038.original.mp4 -movflags faststart -vcodec h264 -acodec aac -strict -2 -vf scale=720:-1 /home/bateworld/public_html/uploads_video/261000/260515/abc123.mp4
|
||
|
|
|
||
|
|
shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["preview_rawfile"]." -movflags faststart -threads 3 -codec:v libx264 -preset fast -acodec aac -strict -2 -vf 'format=yuv420p, scale=".$width.":".$height."' ".$directory."preview_".$row["id"].".mp4");
|
||
|
|
|
||
|
|
//shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -y -vcodec libx264 -g 30 -vf scale=".$width.":-1 ".$directory.$row["id"].".mp4 2>&1 \n");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function video_manage_jobs_output($user="")
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$getID3 = new getID3;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*echo("Duration: ".$file['playtime_string'].
|
||
|
|
" / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
|
||
|
|
" / Filesize: ".$file['filesize']." bytes<br />");*/
|
||
|
|
if($user==""){
|
||
|
|
$query=$database->database_query("SELECT * FROM se_videos WHERE video_is_converted=0 AND rawfile!='' AND attempt<11 ORDER BY video_id LIMIT 1");
|
||
|
|
}else{
|
||
|
|
$query=$database->database_query("SELECT * FROM se_videos WHERE video_is_converted=0 AND rawfile!='' AND attempt<11 AND video_user_id='{$user}' ORDER BY video_id LIMIT 1");
|
||
|
|
}
|
||
|
|
$job_counter = 0;
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done", $database->database_num_rows($query));
|
||
|
|
$video = new se_video();
|
||
|
|
if($database->database_num_rows($query)==0){
|
||
|
|
//video_groupmanage_jobs3();
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
|
||
|
|
//echo "SELECT * FROM se_videos WHERE video_is_converted=0 AND rawfile!='' AND video_user_id='7653' ORDER BY video_id LIMIT 1";
|
||
|
|
while($row=$database->database_fetch_array($query))
|
||
|
|
{
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET attempt=attempt+1 WHERE video_id='".$row["video_id"]."'");
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done 2", $row["video_id"]);
|
||
|
|
$directory=video_dir($row["video_user_id"]);
|
||
|
|
|
||
|
|
|
||
|
|
$file = $getID3->analyze($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
//var_dump($file);
|
||
|
|
if($file['video']['resolution_x']>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
}
|
||
|
|
else{ $width=$file['video']['resolution_x'];}
|
||
|
|
if($file['video']['resolution_y']>1920)
|
||
|
|
{
|
||
|
|
$width=1080;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
//echo $width;
|
||
|
|
|
||
|
|
|
||
|
|
$duration=$file['playtime_seconds'];
|
||
|
|
$min_duration = 1;
|
||
|
|
|
||
|
|
|
||
|
|
if(empty($duration) || $duration <= $min_duration)
|
||
|
|
{
|
||
|
|
|
||
|
|
$user_info = $database->database_fetch_assoc($database->database_query("SELECT video_user_id FROM se_videos WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='-1' WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."'");
|
||
|
|
|
||
|
|
$directory = getcwd().substr($video->video_dir($user_info["video_user_id"]), 1);
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
unlink($directory.$row["video_id"].'_thumb.jpg');
|
||
|
|
}
|
||
|
|
|
||
|
|
// VIDEO WAS ENCODED SUCCESSFULLY, UPDATE DATABASE
|
||
|
|
else
|
||
|
|
{
|
||
|
|
echo $row["video_id"]."<br>
|
||
|
|
<br>
|
||
|
|
".$directory.$row["video_id"].".mp4";
|
||
|
|
if(!file_exists($directory.$row["video_id"].".mp4")){
|
||
|
|
|
||
|
|
echo "AAA";
|
||
|
|
|
||
|
|
//$dir = opendir('uploads_video/encoding/queue/'); # This is the directory it will count from
|
||
|
|
$i = 0; # Integer starts at 0 before counting
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='2', video_duration_in_sec='".$duration."', secondduration='".$duration."' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
|
||
|
|
$a= exec("{$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]. " -f null /dev/null 2>&1", $o, $t);
|
||
|
|
|
||
|
|
|
||
|
|
//echo $o[30];
|
||
|
|
$o=implode("//", $o);
|
||
|
|
$o=str_replace(" ", "",$o);
|
||
|
|
$o=explode("rotate:",$o);
|
||
|
|
|
||
|
|
if($o[1]!=""){
|
||
|
|
|
||
|
|
$t=explode("//", $o[1]);
|
||
|
|
$rotate=$t[0];
|
||
|
|
if($rotate==180)
|
||
|
|
{
|
||
|
|
$vf='-vf "vflip,hflip"';
|
||
|
|
}
|
||
|
|
else{$vf="";}
|
||
|
|
}
|
||
|
|
else{$rotate="";}
|
||
|
|
|
||
|
|
//echo "touch uploads_video/encoding/queue/".$row["video_id"];exit;
|
||
|
|
//-vf scale=320:-1
|
||
|
|
|
||
|
|
$output=shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -vf scale=".$width.":-2 -f image2 -ss 4.00 -vframes 1 {$directory}".$row["video_id"]."_thumb.jpg 2>&1 \n");
|
||
|
|
//sleep(10);
|
||
|
|
|
||
|
|
//sleep(300);
|
||
|
|
|
||
|
|
//54038.original.mp4
|
||
|
|
///bin/nice /usr/local/bin/ffmpeg -i /home/bateworld/public_html/uploads_video/261000/260515/54038.original.mp4 -movflags faststart -vcodec h264 -acodec aac -strict -2 -vf scale=720:-1 /home/bateworld/public_html/uploads_video/261000/260515/abc123.mp4
|
||
|
|
|
||
|
|
if($row["video_user_id"]==7653){
|
||
|
|
}
|
||
|
|
|
||
|
|
$output =shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -movflags faststart -threads 3 -codec:v libx264 -preset fast -acodec aac -strict -2 -vf scale=".$width.":-2 ".$directory.$row["video_id"].".mp4");
|
||
|
|
|
||
|
|
if($row["video_user_id"]==7653){
|
||
|
|
}
|
||
|
|
|
||
|
|
//shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -y -vcodec libx264 -g 30 -vf scale=".$width.":-1 ".$directory.$row["video_id"].".mp4 2>&1 \n");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function video_manage_jobs3($user="")
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$getID3 = new getID3;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*echo("Duration: ".$file['playtime_string'].
|
||
|
|
" / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
|
||
|
|
" / Filesize: ".$file['filesize']." bytes<br />");*/
|
||
|
|
if($user==""){
|
||
|
|
$query=$database->database_query("SELECT * FROM se_videos WHERE video_uploaded=1 AND video_is_converted=0 AND rawfile!='' AND attempt<11 AND video_user_id!=7653 ORDER BY video_id LIMIT 1");
|
||
|
|
}else{
|
||
|
|
$query=$database->database_query("SELECT * FROM se_videos WHERE video_uploaded=1 AND video_is_converted=0 AND rawfile!='' AND attempt<11 AND video_user_id='{$user}' ORDER BY video_id LIMIT 1");
|
||
|
|
}
|
||
|
|
$job_counter = 0;
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done", $database->database_num_rows($query));
|
||
|
|
$video = new se_video();
|
||
|
|
if($database->database_num_rows($query)==0){
|
||
|
|
//video_groupmanage_jobs3();
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
|
||
|
|
//echo "SELECT * FROM se_videos WHERE video_is_converted=0 AND rawfile!='' AND video_user_id='7653' ORDER BY video_id LIMIT 1";
|
||
|
|
while($row=$database->database_fetch_array($query))
|
||
|
|
{
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET attempt=attempt+1 WHERE video_id='".$row["video_id"]."'");
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done 2", $row["video_id"]);
|
||
|
|
$directory=video_dir($row["video_user_id"]);
|
||
|
|
|
||
|
|
|
||
|
|
$file = $getID3->analyze($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
//var_dump($file);
|
||
|
|
if($file['video']['resolution_x']>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
//mail("leprakhauns@gmail.com", "Big File", $directory.$row["rawfile"]." ".$file['video']['resolution_x']." ".$file['video']['resolution_y']);
|
||
|
|
}
|
||
|
|
else{ $width=$file['video']['resolution_x'];}
|
||
|
|
if($file['video']['resolution_y']>1920)
|
||
|
|
{
|
||
|
|
$width=1080;
|
||
|
|
//mail("leprakhauns@gmail.com", "Big File", $directory.$row["rawfile"]." ".$file['video']['resolution_x']." ".$file['video']['resolution_y']);
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
//echo $width;
|
||
|
|
|
||
|
|
|
||
|
|
$duration=$file['playtime_seconds'];
|
||
|
|
$min_duration = 1;
|
||
|
|
|
||
|
|
|
||
|
|
if(empty($duration) || $duration <= $min_duration)
|
||
|
|
{
|
||
|
|
|
||
|
|
$user_info = $database->database_fetch_assoc($database->database_query("SELECT video_user_id FROM se_videos WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='-1' WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."'");
|
||
|
|
|
||
|
|
$directory = getcwd().substr($video->video_dir($user_info["video_user_id"]), 1);
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
unlink($directory.$row["video_id"].'_thumb.jpg');
|
||
|
|
}
|
||
|
|
|
||
|
|
// VIDEO WAS ENCODED SUCCESSFULLY, UPDATE DATABASE
|
||
|
|
else
|
||
|
|
{
|
||
|
|
echo $row["video_id"];
|
||
|
|
if(!file_exists($directory.$row["video_id"].".mp4")){
|
||
|
|
|
||
|
|
//$dir = opendir('uploads_video/encoding/queue/'); # This is the directory it will count from
|
||
|
|
$i = 0; # Integer starts at 0 before counting
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='2', video_duration_in_sec='".$duration."', secondduration='".$duration."' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
|
||
|
|
$a= exec("{$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]. " -f null /dev/null 2>&1", $o, $t);
|
||
|
|
if($file['video']['resolution_x']>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
//mail("leprakhauns@gmail.com", "Big File 2", $directory.$row["rawfile"]." ".$file['video']['resolution_x']." ".$file['video']['resolution_y']);
|
||
|
|
}
|
||
|
|
else{ $width=$file['video']['resolution_x'];}
|
||
|
|
if($file['video']['resolution_y']>1920)
|
||
|
|
{
|
||
|
|
$width=1080;
|
||
|
|
//mail("leprakhauns@gmail.com", "Big File 2", $directory.$row["rawfile"]." ".$file['video']['resolution_x']." ".$file['video']['resolution_y']);
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
|
||
|
|
//echo $o[30];
|
||
|
|
$o=implode("//", $o);
|
||
|
|
$o=str_replace(" ", "",$o);
|
||
|
|
$o=explode("rotate:",$o);
|
||
|
|
|
||
|
|
if($o[1]!=""){
|
||
|
|
|
||
|
|
$t=explode("//", $o[1]);
|
||
|
|
$rotate=$t[0];
|
||
|
|
if($rotate==180)
|
||
|
|
{
|
||
|
|
$vf='-vf "vflip,hflip"';
|
||
|
|
}
|
||
|
|
else{$vf="";}
|
||
|
|
}
|
||
|
|
else{$rotate="";}
|
||
|
|
|
||
|
|
//echo "touch uploads_video/encoding/queue/".$row["video_id"];exit;
|
||
|
|
//-vf scale=320:-1
|
||
|
|
|
||
|
|
$output=shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -vf scale=".$width.":-2 -f image2 -ss 4.00 -vframes 1 {$directory}".$row["video_id"]."_thumb.jpg 2>&1 \n");
|
||
|
|
|
||
|
|
|
||
|
|
$image_info = getimagesize($directory.$row["video_id"]."_thumb.jpg");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if($image_info[0]>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
$height=-2;
|
||
|
|
}
|
||
|
|
else{ $width=$image_info[0]; $height=-2;}
|
||
|
|
if($image_info[1]>1920)
|
||
|
|
{
|
||
|
|
$width=-2;
|
||
|
|
$height=1920;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
if($height%2!=0){$height=$height-1;}
|
||
|
|
//sleep(10);
|
||
|
|
|
||
|
|
//sleep(300);
|
||
|
|
|
||
|
|
//54038.original.mp4
|
||
|
|
///bin/nice /usr/local/bin/ffmpeg -i /home/bateworld/public_html/uploads_video/261000/260515/54038.original.mp4 -movflags faststart -vcodec h264 -acodec aac -strict -2 -vf scale=720:-1 /home/bateworld/public_html/uploads_video/261000/260515/abc123.mp4
|
||
|
|
|
||
|
|
//if($row["video_user_id"]==7653){
|
||
|
|
$output =shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -movflags faststart -codec:v libx264 -preset fast -acodec aac -strict -2 -vf 'format=yuv420p, scale=".$width.":".$height."' ".$directory.$row["video_id"].".mp4&&/usr/bin/curl -s 'https://bateworld.com/video_checkconversion-new.php?type=video&video_id=".$row["video_id"]."'");
|
||
|
|
/*}
|
||
|
|
else{
|
||
|
|
|
||
|
|
$output =shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -movflags faststart -codec:v libx264 -preset fast -acodec aac -strict -2 -vf scale=".$width.":-2 ".$directory.$row["video_id"].".mp4");
|
||
|
|
}
|
||
|
|
|
||
|
|
if($row["video_user_id"]==7653){
|
||
|
|
}
|
||
|
|
*/
|
||
|
|
//shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -y -vcodec libx264 -g 30 -vf scale=".$width.":-1 ".$directory.$row["video_id"].".mp4 2>&1 \n");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function video_reencode()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$getID3 = new getID3;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*echo("Duration: ".$file['playtime_string'].
|
||
|
|
" / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
|
||
|
|
" / Filesize: ".$file['filesize']." bytes<br />");*/
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_videos WHERE video_is_converted=1 AND resize!=0 AND reattempt<11 ORDER BY video_id LIMIT 1");
|
||
|
|
$job_counter = 0;
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done", $database->database_num_rows($query));
|
||
|
|
$video = new se_video();
|
||
|
|
if($database->database_num_rows($query)==0){
|
||
|
|
//managetraining();
|
||
|
|
//manage_training_preview();
|
||
|
|
// video_manage_jobs3();
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
|
||
|
|
//echo "SELECT * FROM se_videos WHERE video_is_converted=0 AND rawfile!='' AND video_user_id='7653' ORDER BY video_id LIMIT 1";
|
||
|
|
while($row=$database->database_fetch_array($query))
|
||
|
|
{
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='6', reattempt=reattempt+1 WHERE video_id='".$row["video_id"]."'");
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done 2", $row["video_id"]);
|
||
|
|
$directory=video_dir($row["video_user_id"]);
|
||
|
|
|
||
|
|
|
||
|
|
$file = $getID3->analyze($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
//var_dump($file);
|
||
|
|
if($row['resize']==1)
|
||
|
|
{
|
||
|
|
$width=1280; $height=720;
|
||
|
|
}
|
||
|
|
else{ $width=720;$height=1280;}
|
||
|
|
//echo $width;
|
||
|
|
|
||
|
|
|
||
|
|
//$duration=$file['playtime_seconds'];
|
||
|
|
//$min_duration = 1;
|
||
|
|
if(file_exists($directory.$row["video_id"].".mp4"))
|
||
|
|
{
|
||
|
|
copy($directory.$row["video_id"].".mp4", $directory.$row["video_id"]."-old.mp4");
|
||
|
|
unlink($directory.$row["video_id"].".mp4");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
{
|
||
|
|
echo $row["video_id"];
|
||
|
|
|
||
|
|
if(!file_exists($directory.$row["video_id"].".mp4")){
|
||
|
|
|
||
|
|
//$dir = opendir('uploads_video/encoding/queue/'); # This is the directory it will count from
|
||
|
|
$i = 0; # Integer starts at 0 before counting
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='5' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
|
||
|
|
$a= exec("{$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["video_id"]. "-old.mp4 -f null /dev/null 2>&1", $o, $t);
|
||
|
|
//echo $o[30];
|
||
|
|
$o=implode("//", $o);
|
||
|
|
$o=str_replace(" ", "",$o);
|
||
|
|
$o=explode("rotate:",$o);
|
||
|
|
|
||
|
|
if($o[1]!=""){
|
||
|
|
|
||
|
|
$t=explode("//", $o[1]);
|
||
|
|
$rotate=$t[0];
|
||
|
|
if($rotate==180)
|
||
|
|
{
|
||
|
|
$vf='-vf "vflip,hflip"';
|
||
|
|
}
|
||
|
|
else{$vf="";}
|
||
|
|
}
|
||
|
|
else{$rotate="";}
|
||
|
|
|
||
|
|
//echo "touch uploads_video/encoding/queue/".$row["video_id"];exit;
|
||
|
|
//-vf scale=320:-1
|
||
|
|
|
||
|
|
//$output=shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -vf scale=".$width.":-2 -f image2 -ss 4.00 -vframes 1 {$directory}".$row["video_id"]."_thumb.jpg 2>&1 \n");
|
||
|
|
//sleep(10);
|
||
|
|
|
||
|
|
//sleep(300);
|
||
|
|
|
||
|
|
//54038.original.mp4
|
||
|
|
///bin/nice /usr/local/bin/ffmpeg -i /home/bateworld/public_html/uploads_video/261000/260515/54038.original.mp4 -movflags faststart -vcodec h264 -acodec aac -strict -2 -vf scale=720:-1 /home/bateworld/public_html/uploads_video/261000/260515/abc123.mp4
|
||
|
|
|
||
|
|
shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["video_id"]. "-old.mp4 -movflags faststart -codec:v libx264 -preset fast -acodec aac -strict -2 -vf scale=".$width.":-2 ".$directory.$row["video_id"].".mp4");
|
||
|
|
|
||
|
|
//shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -y -vcodec libx264 -g 30 -vf scale=".$width.":-1 ".$directory.$row["video_id"].".mp4 2>&1 \n");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function groupvideo_reencode()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$getID3 = new getID3;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*echo("Duration: ".$file['playtime_string'].
|
||
|
|
" / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
|
||
|
|
" / Filesize: ".$file['filesize']." bytes<br />");*/
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_group_videos WHERE video_is_converted=1 AND resize!=0 AND reattempt<11 ORDER BY video_id LIMIT 1");
|
||
|
|
$job_counter = 0;
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done", $database->database_num_rows($query));
|
||
|
|
$video = new se_video();
|
||
|
|
if($database->database_num_rows($query)==0){
|
||
|
|
video_reencode();
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
|
||
|
|
//echo "SELECT * FROM se_videos WHERE video_is_converted=0 AND rawfile!='' AND video_user_id='7653' ORDER BY video_id LIMIT 1";
|
||
|
|
while($row=$database->database_fetch_array($query))
|
||
|
|
{
|
||
|
|
$database->database_query("UPDATE se_group_videos SET video_is_converted='6', reattempt=reattempt+1 WHERE video_id='".$row["video_id"]."'");
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done 2", $row["video_id"]);
|
||
|
|
$directory=group_dir($row["video_group_id"]);
|
||
|
|
|
||
|
|
|
||
|
|
$file = $getID3->analyze($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
//var_dump($file);
|
||
|
|
if($row['resize']==1)
|
||
|
|
{
|
||
|
|
$width=1280; $height=720;
|
||
|
|
}
|
||
|
|
else{ $width=720;$height=1280;}
|
||
|
|
//echo $width;
|
||
|
|
|
||
|
|
|
||
|
|
//$duration=$file['playtime_seconds'];
|
||
|
|
//$min_duration = 1;
|
||
|
|
if(file_exists($directory."video_".$row["video_id"].".mp4"))
|
||
|
|
{
|
||
|
|
copy($directory."video_".$row["video_id"].".mp4", $directory."video_".$row["video_id"]."-old.mp4");
|
||
|
|
unlink($directory."video_".$row["video_id"].".mp4");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
{
|
||
|
|
echo $row["video_id"];
|
||
|
|
|
||
|
|
if(!file_exists($directory."video_".$row["video_id"].".mp4")){
|
||
|
|
|
||
|
|
//$dir = opendir('uploads_video/encoding/queue/'); # This is the directory it will count from
|
||
|
|
$i = 0; # Integer starts at 0 before counting
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_group_videos SET video_is_converted='5' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
|
||
|
|
$a= exec("{$setting['setting_video_ffmpeg_path']} -i ".$directory."video_".$row["video_id"]. "-old.mp4 -f null /dev/null 2>&1", $o, $t);
|
||
|
|
//echo $o[30];
|
||
|
|
$o=implode("//", $o);
|
||
|
|
$o=str_replace(" ", "",$o);
|
||
|
|
$o=explode("rotate:",$o);
|
||
|
|
|
||
|
|
if($o[1]!=""){
|
||
|
|
|
||
|
|
$t=explode("//", $o[1]);
|
||
|
|
$rotate=$t[0];
|
||
|
|
if($rotate==180)
|
||
|
|
{
|
||
|
|
$vf='-vf "vflip,hflip"';
|
||
|
|
}
|
||
|
|
else{$vf="";}
|
||
|
|
}
|
||
|
|
else{$rotate="";}
|
||
|
|
|
||
|
|
//echo "touch uploads_video/encoding/queue/".$row["video_id"];exit;
|
||
|
|
//-vf scale=320:-1
|
||
|
|
|
||
|
|
//$output=shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -vf scale=".$width.":-2 -f image2 -ss 4.00 -vframes 1 {$directory}".$row["video_id"]."_thumb.jpg 2>&1 \n");
|
||
|
|
//sleep(10);
|
||
|
|
|
||
|
|
//sleep(300);
|
||
|
|
|
||
|
|
//54038.original.mp4
|
||
|
|
///bin/nice /usr/local/bin/ffmpeg -i /home/bateworld/public_html/uploads_video/261000/260515/54038.original.mp4 -movflags faststart -vcodec h264 -acodec aac -strict -2 -vf scale=720:-1 /home/bateworld/public_html/uploads_video/261000/260515/abc123.mp4
|
||
|
|
|
||
|
|
shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory."video_".$row["video_id"]. "-old.mp4 -movflags faststart -codec:v libx264 -preset fast -acodec aac -strict -2 -vf scale=".$width.":-2 ".$directory."video_".$row["video_id"].".mp4");
|
||
|
|
|
||
|
|
//shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -y -vcodec libx264 -g 30 -vf scale=".$width.":-1 ".$directory.$row["video_id"].".mp4 2>&1 \n");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function checkgroupreencode()
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_group_videos WHERE video_is_converted=5 AND resize!='0'");
|
||
|
|
$video = new se_video();
|
||
|
|
echo "R";
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
echo "A";
|
||
|
|
$directory=group_dir($row["video_group_id"]);
|
||
|
|
|
||
|
|
if(file_exists($directory."video_".$row["video_id"].".mp4")){
|
||
|
|
|
||
|
|
echo $row["video_id"];
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_group_videos SET video_is_converted='1', video_admin_approved='1', resize='0', reattempt=0 WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$video_info = $database->database_fetch_assoc($database->database_query("SELECT user_id, user_username, user_fname, user_lname, user_privacy, video_id, video_title FROM se_group_videos LEFT JOIN se_users ON se_videos.video_user_id=se_users.user_id WHERE se_videos.video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$author = new se_user();
|
||
|
|
$author->user_exists = 1;
|
||
|
|
$author->user_info['user_id'] = $video_info['user_id'];
|
||
|
|
$author->user_info['user_username'] = $video_info['user_username'];
|
||
|
|
$author->user_info['user_fname'] = $video_info['user_fname'];
|
||
|
|
$author->user_info['user_lname'] = $video_info['user_lname'];
|
||
|
|
$author->user_info['user_privacy'] = $video_info['user_privacy'];
|
||
|
|
$author->user_displayname();
|
||
|
|
|
||
|
|
$action_media = array();
|
||
|
|
$thumb_path = str_replace('./', '', $directory.$video_info['video_id']."_thumb.jpg");
|
||
|
|
$media_link = str_replace($url->url_base, '', $url->url_create('video', $author->user_info['user_username'], $video_info['video_id']));
|
||
|
|
|
||
|
|
if( file_exists($thumb_path) )
|
||
|
|
{
|
||
|
|
$media_width = $misc->photo_size($thumb_path, "100", "100", "w");
|
||
|
|
$media_height = $misc->photo_size($thumb_path, "100", "100", "h");
|
||
|
|
$action_media[] = array(
|
||
|
|
'media_link' => $media_link,
|
||
|
|
'media_path' => $thumb_path,
|
||
|
|
'media_width' => $media_width,
|
||
|
|
'media_height' => $media_height
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
// INSERT ACTION
|
||
|
|
//if(strlen($video_info[video_title]) > 100) { $video_info[video_title] = substr($video_info['video_title'], 0, 97); $video_info['video_title'] .= "..."; }
|
||
|
|
|
||
|
|
# $actions->actions_add($author, "newvideo", array($author->user_info['user_username'], $author->user_displayname, $video_info['video_id'], $video_info['video_title']), $action_media, 0, false, "user", $author->user_info['user_id'], $author->user_info['user_privacy']);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
unlink($directory."video_".$row["video_id"]."-old.mp4");
|
||
|
|
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
//$database->database_query("UPDATE se_videos SET video_is_converted='0' WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1");
|
||
|
|
}
|
||
|
|
}}
|
||
|
|
|
||
|
|
function checkreencode()
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_videos WHERE video_is_converted=5 AND resize!='0'");
|
||
|
|
$video = new se_video();
|
||
|
|
echo "R";
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
echo "A";
|
||
|
|
$directory=video_dir($row["video_user_id"]);
|
||
|
|
|
||
|
|
if(file_exists($directory.$row["video_id"].".mp4")){
|
||
|
|
|
||
|
|
echo $row["video_id"];
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='1', video_admin_approved='1', resize='0', reattempt=0 WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$video_info = $database->database_fetch_assoc($database->database_query("SELECT user_id, user_username, user_fname, user_lname, user_privacy, video_id, video_title FROM se_videos LEFT JOIN se_users ON se_videos.video_user_id=se_users.user_id WHERE se_videos.video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$author = new se_user();
|
||
|
|
$author->user_exists = 1;
|
||
|
|
$author->user_info['user_id'] = $video_info['user_id'];
|
||
|
|
$author->user_info['user_username'] = $video_info['user_username'];
|
||
|
|
$author->user_info['user_fname'] = $video_info['user_fname'];
|
||
|
|
$author->user_info['user_lname'] = $video_info['user_lname'];
|
||
|
|
$author->user_info['user_privacy'] = $video_info['user_privacy'];
|
||
|
|
$author->user_displayname();
|
||
|
|
|
||
|
|
$action_media = array();
|
||
|
|
$thumb_path = str_replace('./', '', $video->video_dir($video_info['user_id']).$video_info['video_id']."_thumb.jpg");
|
||
|
|
$media_link = str_replace($url->url_base, '', $url->url_create('video', $author->user_info['user_username'], $video_info['video_id']));
|
||
|
|
|
||
|
|
if( file_exists($thumb_path) )
|
||
|
|
{
|
||
|
|
$media_width = $misc->photo_size($thumb_path, "100", "100", "w");
|
||
|
|
$media_height = $misc->photo_size($thumb_path, "100", "100", "h");
|
||
|
|
$action_media[] = array(
|
||
|
|
'media_link' => $media_link,
|
||
|
|
'media_path' => $thumb_path,
|
||
|
|
'media_width' => $media_width,
|
||
|
|
'media_height' => $media_height
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
// INSERT ACTION
|
||
|
|
//if(strlen($video_info[video_title]) > 100) { $video_info[video_title] = substr($video_info['video_title'], 0, 97); $video_info['video_title'] .= "..."; }
|
||
|
|
|
||
|
|
# $actions->actions_add($author, "newvideo", array($author->user_info['user_username'], $author->user_displayname, $video_info['video_id'], $video_info['video_title']), $action_media, 0, false, "user", $author->user_info['user_id'], $author->user_info['user_privacy']);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
unlink($directory.$row["video_id"]."-old.mp4");
|
||
|
|
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
//$database->database_query("UPDATE se_videos SET video_is_converted='0' WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1");
|
||
|
|
}
|
||
|
|
}}
|
||
|
|
|
||
|
|
function checkconnection(){
|
||
|
|
global $database, $database_host, $database_username, $database_password, $database_name;
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
//echo "RRR";
|
||
|
|
$database =NULL;
|
||
|
|
$database = new SEDatabase($database_host, $database_username, $database_password, $database_name);
|
||
|
|
// SET DATABASE CONSTANTS
|
||
|
|
$database->database_query("SET @SE_PRIVACY_SELF = 1, @SE_PRIVACY_FRIEND = 2, @SE_PRIVACY_FRIEND2 = 4, @SE_PRIVACY_SUBNET = 8, @SE_PRIVACY_REGISTERED = 16, @SE_PRIVACY_ANONYMOUS = 32");
|
||
|
|
// SET LANGUAGE CHARSET
|
||
|
|
$database->database_set_charset("utf8");
|
||
|
|
|
||
|
|
//echo "AAA";
|
||
|
|
}
|
||
|
|
|
||
|
|
return;
|
||
|
|
|
||
|
|
}
|
||
|
|
function check_batetube(){
|
||
|
|
global $database, $setting, $actions, $misc, $url, $database_host, $database_username, $database_password, $database_name;;
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media started", "");
|
||
|
|
if($setting["toserver"]==1){return;}
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Started?", "UPDATE bate_videos SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM bate_videos WHERE is_converted=6");
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
//$database->database_query("UPDATE se_settings SET toserver=1 WHERE setting_id=1");
|
||
|
|
echo $row["id"]." ";
|
||
|
|
$directory="./bate_videos/";
|
||
|
|
$directory1="bate_videos/";
|
||
|
|
//if(file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
echo $row["1080"];
|
||
|
|
//mail("leprakhauns@gmail.com", "Running?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting thumb", "");
|
||
|
|
|
||
|
|
unlink($_SERVER["DOCUMENT_ROOT"]."/bate_videos/".$row["rawfile"]);
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Still going?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
$database->database_query("UPDATE bate_videos SET is_converted='1',rawfile='', picture='./bate_videos/".$row["id"]."_thumb.jpg' WHERE id='".$row["id"]."' LIMIT 1");
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Ended?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"].".mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1.$row["id"].".mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1.$row["id"].".mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"].".jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1.$row["id"].".jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1.$row["id"].".jpg");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//mail("leprakhauns@gmail.com", "huh?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=0 WHERE setting_id=1");
|
||
|
|
$database->database_query("UPDATE bate_videos SET del='1' WHERE id='".$row["id"]."'");
|
||
|
|
|
||
|
|
//unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
/*}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bator_training SET is_converted='0' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
function check_resized()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url, $database_host, $database_username, $database_password, $database_name;;
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media started", "");
|
||
|
|
if($setting["toserver"]==1){return;}
|
||
|
|
echo "A";
|
||
|
|
//mail("leprakhauns@gmail.com", "Started?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//mail("leprakhauns@gmail.com", "SSS","");
|
||
|
|
$query=$database->database_query("SELECT * FROM se_videos WHERE resizeconverted=6 limit 1");
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=1 WHERE setting_id=1");
|
||
|
|
echo $row["video_id"]." ";
|
||
|
|
$directory=video_dir($row["video_user_id"]);
|
||
|
|
//mail("leprakhauns@gmail.com", "aaa","");
|
||
|
|
//if(file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
echo $row["1080"];
|
||
|
|
//mail("leprakhauns@gmail.com", "Running?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting thumb", "");
|
||
|
|
exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory."".$row["video_id"].".mp4 https://media.bateworld.com/videos/user_videos/".$row["video_id"].".mp4");
|
||
|
|
//mail("leprakhauns@gmail.com", "ttt","");
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Still going?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET resizeconverted=1, del=1, testdate=0 WHERE video_id='".$row["video_id"]."' LIMIT 1");
|
||
|
|
echo "UPDATE se_videos SET resizeconverted=1, del=1, testdate=0 WHERE video_id='".$row["video_id"]."' LIMIT 1";
|
||
|
|
//mail("leprakhauns@gmail.com", "Ended?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
$ex=explode("./", $directory);
|
||
|
|
echo "<br>
|
||
|
|
<br>
|
||
|
|
".IMAGECDN.$ex[1].$row["video_id"].".mp4";
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$ex[1].$row["video_id"].".mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$ex[1].$row["video_id"].".mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$ex[1].$row["video_id"].".mp4");
|
||
|
|
|
||
|
|
// if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//mail("leprakhauns@gmail.com", "huh?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=0 WHERE setting_id=1");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bateoff SET is_converted='0' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function check_intro()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url, $database_host, $database_username, $database_password, $database_name;;
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media started", "");
|
||
|
|
if($setting["toserver"]==1){return;}
|
||
|
|
echo "A";
|
||
|
|
//mail("leprakhauns@gmail.com", "Started?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_users WHERE video_is_converted=6");
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=1 WHERE setting_id=1");
|
||
|
|
echo $row["id"]." ";
|
||
|
|
$directory=get_userdir($row["user_id"], true);
|
||
|
|
$directory1=substr(get_userdir($row["user_id"], true),2);
|
||
|
|
//if(file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
//echo $row["1080"];
|
||
|
|
//mail("leprakhauns@gmail.com", "Running?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting thumb", "");
|
||
|
|
exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."a12541a_thumb.jpg https://media.bateworld.com/".$directory1."a12541a_thumb.jpg");
|
||
|
|
|
||
|
|
if($row["intro-1080"]==1){
|
||
|
|
//echo " wget -O /home/bateworld/public_html/videos/bateoff/".$row["id"]."-1080.mp4 https://media.bateworld.com/videos/bateoff/".$row["id"]."-1080.mp4 ";
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting 1080", "");
|
||
|
|
$s=exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."a12541a-1080.mp4 https://media.bateworld.com/".$directory1."a12541a-1080.mp4", $a, $o);
|
||
|
|
var_dump($a);
|
||
|
|
var_dump($s);
|
||
|
|
var_dump($o);
|
||
|
|
}
|
||
|
|
if($row["intro-720"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."a12541a-720.mp4 https://media.bateworld.com/".$directory1."a12541a-720.mp4");}
|
||
|
|
if($row["intro-480"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."a12541a-480.mp4 https://media.bateworld.com/".$directory1."a12541a-480.mp4");}
|
||
|
|
if($row["intro-240"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."a12541a-240.mp4 https://media.bateworld.com/".$directory1."a12541a-240.mp4");}
|
||
|
|
if($row["intro-otherres"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."a12541a.mp4 https://media.bateworld.com/".$directory1."a12541a.mp4");}
|
||
|
|
//mail("leprakhauns@gmail.com", "Still going?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//echo "UPDATE se_users SET is_converted='1',rawfile='' WHERE user_id='".$row["user_id"]."' LIMIT 1";
|
||
|
|
$database->database_query("UPDATE se_users SET video_is_converted='1', introapproved='1', attempt=0, rawfile='' WHERE user_id='".$row["user_id"]."' LIMIT 1");
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Ended?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."a12541a.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."a12541a.mp4");
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."a12541a-1080.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."a12541a-1080.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."a12541a-720.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."a12541a-720.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."a12541a-480.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."a12541a-480.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."a12541a-240.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."a12541a-240.mp4");
|
||
|
|
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."a12541a_thumb.jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."a12541a_thumb.jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."a12541a_thumb.jpg");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//mail("leprakhauns@gmail.com", "huh?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=0 WHERE setting_id=1");
|
||
|
|
$database->database_query("UPDATE se_users SET del='1' WHERE user_id='".$row["user_id"]."'");
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
/*}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bateoff SET is_converted='0' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function check_uservideos()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url, $database_host, $database_username, $database_password, $database_name;;
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media started", "");
|
||
|
|
//if($setting["toserver"]==1){return;}
|
||
|
|
echo "P";
|
||
|
|
//mail("leprakhauns@gmail.com", "Started?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//echo "<br>"."SELECT se_videos.*, se_users.user_username FROM se_videos, se_users WHERE video_is_converted=6 AND video_user_id=user_id";
|
||
|
|
$query=$database->database_query("SELECT se_videos.*, se_users.user_username FROM se_videos, se_users WHERE se_videos.video_is_converted=1 and se_videos.rawfile!='' AND se_videos.video_admin_approved='0' AND video_user_id=user_id");
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
//$database->database_query("UPDATE se_settings SET toserver=1 WHERE setting_id=1");
|
||
|
|
echo $row["id"]." ";
|
||
|
|
$directory=video_dir($row["video_user_id"], true);
|
||
|
|
$directory1=str_replace("./", "/", video_dir($row["video_user_id"], true));
|
||
|
|
//if(file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
//echo $row["1080"];
|
||
|
|
//mail("leprakhauns@gmail.com", "Running?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting thumb", "");
|
||
|
|
|
||
|
|
if($_SERVER["REMOTE_ADDR"]=="76.111.155.21"){
|
||
|
|
echo "wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."".$row["video_id"]."_thumb.jpg https://media.bateworld.com/".$directory1."".$row["video_id"]."_thumb.jpg";
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
/*exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."".$row["video_id"]."_thumb.jpg https://media.bateworld.com/".$directory1."".$row["video_id"]."_thumb.jpg");
|
||
|
|
|
||
|
|
if($row["1080"]==1){
|
||
|
|
//echo " wget -O /home/bateworld/public_html/videos/bateoff/".$row["id"]."-1080.mp4 https://media.bateworld.com/videos/bateoff/".$row["id"]."-1080.mp4 ";
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting 1080", "");
|
||
|
|
$s=exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."".$row["video_id"]."-1080.mp4 https://media.bateworld.com/".$directory1."".$row["video_id"]."-1080.mp4", $a, $o);
|
||
|
|
var_dump($a);
|
||
|
|
var_dump($s);
|
||
|
|
var_dump($o);
|
||
|
|
}
|
||
|
|
if($row["720"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."".$row["video_id"]."-720.mp4 https://media.bateworld.com/".$directory1."".$row["video_id"]."-720.mp4");}
|
||
|
|
if($row["480"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."".$row["video_id"]."-480.mp4 https://media.bateworld.com/".$directory1."".$row["video_id"]."-480.mp4");}
|
||
|
|
if($row["240"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."".$row["video_id"]."-240.mp4 https://media.bateworld.com/".$directory1."".$row["video_id"]."-240.mp4");}
|
||
|
|
if($row["otherres"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."".$row["video_id"].".mp4 https://media.bateworld.com/".$directory1."".$row["video_id"].".mp4");}*/
|
||
|
|
//mail("leprakhauns@gmail.com", "Still going?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
$owner = new SEUser(Array($row["video_user_id"], $row["user_username"]));
|
||
|
|
|
||
|
|
$action_media = array();
|
||
|
|
$thumb_path = str_replace('./', '/', $directory1.$row["video_id"].".jpg");
|
||
|
|
$media_link = str_replace($url->url_base, '', $url->url_create('video', $owner->user_info['user_username'], $row['video_id']));
|
||
|
|
|
||
|
|
//if( file_exists($thumb_path) )
|
||
|
|
{
|
||
|
|
//$media_width = $misc->photo_size($thumb_path, "100", "100", "w");
|
||
|
|
//$media_height = $misc->photo_size($thumb_path, "100", "100", "h");
|
||
|
|
$action_media[] = array(
|
||
|
|
'media_link' => $media_link,
|
||
|
|
'media_path' => $thumb_path,
|
||
|
|
'media_width' => 100,
|
||
|
|
'media_height' => 100
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
//echo "UPDATE se_users SET is_converted='1',rawfile='' WHERE user_id='".$row["user_id"]."' LIMIT 1";
|
||
|
|
if($owner->user_info["staff"]==0){
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='1', video_admin_approved='1', rawfile='' WHERE video_id='".$row["video_id"]."' LIMIT 1");
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='1', video_admin_approved='1', rawfile='', approved=1 WHERE video_id='".$row["video_id"]."' LIMIT 1");
|
||
|
|
$actions->actions_add($owner, "newvideo", array($owner->user_info['user_username'], $owner->user_displayname, $row["video_id"], $row["video_title"]), $action_media, 0, FALSE, "user", $row["video_id"], $owner->user_info['user_privacy']);
|
||
|
|
}
|
||
|
|
//$actions->actions_add($owner, "newvideo", array($owner->user_info['user_username'], $owner->user_displayname, $row["video_id"], $row["video_title"]), $action_media, 0, FALSE, "user", $row["video_id"], $owner->user_info['user_privacy']);
|
||
|
|
|
||
|
|
//$actions->actions_add($author, "newvideo", array($author->user_info['user_username'], $author->user_displayname, $video_info['video_id'], $video_info['video_title']), $action_media, 0, false, "user", $author->user_info['user_id'], $author->user_info['user_privacy']);
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Ended?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
highwindsdelete($directory1."".$row["video_id"].".mp4");
|
||
|
|
|
||
|
|
highwindsdelete($directory1."".$row["video_id"]."-1080.mp4");
|
||
|
|
highwindsdelete($directory1."".$row["video_id"]."-720.mp4");
|
||
|
|
highwindsdelete($directory1."".$row["video_id"]."-480.mp4");
|
||
|
|
highwindsdelete($directory1."".$row["video_id"]."-240.mp4");
|
||
|
|
|
||
|
|
|
||
|
|
highwindsdelete($directory1."".$row["video_id"]."_thumb.jpg");
|
||
|
|
highwindsdelete($directory1."".$row["video_id"]."_thumb.jpg");
|
||
|
|
// if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//mail("leprakhauns@gmail.com", "huh?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=0 WHERE setting_id=1");
|
||
|
|
$database->database_query("UPDATE se_videos SET del='1' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
@unlink($_SERVER["DOCUMENT_ROOT"]."/video_uploads/".$row["rawfile"]);
|
||
|
|
|
||
|
|
|
||
|
|
/*}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bateoff SET is_converted='0' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT se_videos.*, se_users.user_username FROM se_videos, se_users WHERE se_videos.video_is_converted=-1 AND se_videos.rawfile!='' AND video_user_id=user_id LIMIT 1");
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
echo $row["id"]." ";
|
||
|
|
//$directory=video_dir($row["video_user_id"], true);
|
||
|
|
|
||
|
|
@unlink($_SERVER["DOCUMENT_ROOT"]."/video_uploads/".$row["rawfile"]);
|
||
|
|
$database->database_query("UPDATE se_videos SET rawfile='' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
//send_admin("sean@bateworld.com", "Delete files 2", $_SERVER["DOCUMENT_ROOT"]."/".$directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
function check_clubvideos()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url, $database_host, $database_username, $database_password, $database_name;;
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media started", "");
|
||
|
|
if($setting["toserver"]==1){return;}
|
||
|
|
echo "A";
|
||
|
|
//mail("leprakhauns@gmail.com", "Started?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_club_videos WHERE video_is_converted=1 and rawfile!='' AND video_admin_approved='0'");
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=1 WHERE setting_id=1");
|
||
|
|
echo $row["id"]." ";
|
||
|
|
$directory=get_clubdir($row["video_club_id"], true);
|
||
|
|
$directory1=substr(get_clubdir($row["video_club_id"], true),2);
|
||
|
|
//if(file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
//echo $row["1080"];
|
||
|
|
//mail("leprakhauns@gmail.com", "Running?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting thumb", "");
|
||
|
|
//exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."_thumb.jpg https://media.bateworld.com/".$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
|
||
|
|
/*if($row["intro-1080"]==1){
|
||
|
|
//echo " wget -O /home/bateworld/public_html/videos/bateoff/".$row["id"]."-1080.mp4 https://media.bateworld.com/videos/bateoff/".$row["id"]."-1080.mp4 ";
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting 1080", "");
|
||
|
|
$s=exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-1080.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-1080.mp4", $a, $o);
|
||
|
|
var_dump($a);
|
||
|
|
var_dump($s);
|
||
|
|
var_dump($o);
|
||
|
|
}
|
||
|
|
if($row["720"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-720.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-720.mp4");}
|
||
|
|
if($row["480"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-480.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-480.mp4");}
|
||
|
|
if($row["240"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-240.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-240.mp4");}
|
||
|
|
if($row["otherres"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"].".mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"].".mp4");}*/
|
||
|
|
//mail("leprakhauns@gmail.com", "Still going?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//echo "UPDATE se_users SET is_converted='1',rawfile='' WHERE user_id='".$row["user_id"]."' LIMIT 1";
|
||
|
|
$database->database_query("UPDATE se_club_videos SET video_is_converted='1', video_admin_approved='1', rawfile='' WHERE video_id='".$row["video_id"]."' LIMIT 1");
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Ended?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."video_".$row["video_id"].".mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"].".mp4");
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."video_".$row["video_id"]."-1080.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-1080.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["video_id"]."-720.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-720.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["video_id"]."-480.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-480.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["video_id"]."-240.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-240.mp4");
|
||
|
|
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//mail("leprakhauns@gmail.com", "huh?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=0 WHERE setting_id=1");
|
||
|
|
$database->database_query("UPDATE se_club_videos SET del='1' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
@unlink($_SERVER["DOCUMENT_ROOT"]."/video_club_uploads/".$row["rawfile"]);
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
/*}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bateoff SET is_converted='0' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
function check_groupvideos()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url, $database_host, $database_username, $database_password, $database_name;;
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media started", "");
|
||
|
|
if($setting["toserver"]==1){return;}
|
||
|
|
echo "A";
|
||
|
|
//mail("leprakhauns@gmail.com", "Started?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_group_videos WHERE video_is_converted=1 and rawfile!='' AND video_admin_approved='0'");
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=1 WHERE setting_id=1");
|
||
|
|
echo $row["id"]." ";
|
||
|
|
$directory=get_groupdir($row["video_group_id"], true);
|
||
|
|
$directory1=substr(get_groupdir($row["video_group_id"], true),2);
|
||
|
|
//if(file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
//echo $row["1080"];
|
||
|
|
//mail("leprakhauns@gmail.com", "Running?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting thumb", "");
|
||
|
|
//exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."_thumb.jpg https://media.bateworld.com/".$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
|
||
|
|
/*if($row["intro-1080"]==1){
|
||
|
|
//echo " wget -O /home/bateworld/public_html/videos/bateoff/".$row["id"]."-1080.mp4 https://media.bateworld.com/videos/bateoff/".$row["id"]."-1080.mp4 ";
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting 1080", "");
|
||
|
|
$s=exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-1080.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-1080.mp4", $a, $o);
|
||
|
|
var_dump($a);
|
||
|
|
var_dump($s);
|
||
|
|
var_dump($o);
|
||
|
|
}
|
||
|
|
if($row["720"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-720.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-720.mp4");}
|
||
|
|
if($row["480"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-480.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-480.mp4");}
|
||
|
|
if($row["240"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-240.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-240.mp4");}
|
||
|
|
if($row["otherres"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"].".mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"].".mp4");}*/
|
||
|
|
//mail("leprakhauns@gmail.com", "Still going?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//echo "UPDATE se_users SET is_converted='1',rawfile='' WHERE user_id='".$row["user_id"]."' LIMIT 1";
|
||
|
|
$database->database_query("UPDATE se_group_videos SET video_is_converted='1', video_admin_approved='1', rawfile='' WHERE video_id='".$row["video_id"]."' LIMIT 1");
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Ended?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."video_".$row["video_id"].".mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"].".mp4");
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."video_".$row["video_id"]."-1080.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-1080.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["video_id"]."-720.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-720.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["video_id"]."-480.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-480.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["video_id"]."-240.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-240.mp4");
|
||
|
|
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//mail("leprakhauns@gmail.com", "huh?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=0 WHERE setting_id=1");
|
||
|
|
$database->database_query("UPDATE se_group_videos SET del='1' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
@unlink($_SERVER["DOCUMENT_ROOT"]."/video_group_uploads/".$row["rawfile"]);
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
/*}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bateoff SET is_converted='0' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
function check_eventvideos()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url, $database_host, $database_username, $database_password, $database_name;;
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media started", "");
|
||
|
|
if($setting["toserver"]==1){return;}
|
||
|
|
echo "A";
|
||
|
|
//mail("leprakhauns@gmail.com", "Started?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_event_videos WHERE video_is_converted=1 and rawfile!='' AND video_admin_approved='0'");
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=1 WHERE setting_id=1");
|
||
|
|
echo $row["id"]." ";
|
||
|
|
$directory=get_eventdir($row["video_event_id"], true);
|
||
|
|
$directory1=substr(get_eventdir($row["video_event_id"], true),2);
|
||
|
|
//if(file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
//echo $row["1080"];
|
||
|
|
//mail("leprakhauns@gmail.com", "Running?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting thumb", "");
|
||
|
|
//exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."_thumb.jpg https://media.bateworld.com/".$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
|
||
|
|
/*if($row["intro-1080"]==1){
|
||
|
|
//echo " wget -O /home/bateworld/public_html/videos/bateoff/".$row["id"]."-1080.mp4 https://media.bateworld.com/videos/bateoff/".$row["id"]."-1080.mp4 ";
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting 1080", "");
|
||
|
|
$s=exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-1080.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-1080.mp4", $a, $o);
|
||
|
|
var_dump($a);
|
||
|
|
var_dump($s);
|
||
|
|
var_dump($o);
|
||
|
|
}
|
||
|
|
if($row["720"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-720.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-720.mp4");}
|
||
|
|
if($row["480"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-480.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-480.mp4");}
|
||
|
|
if($row["240"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"]."-240.mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"]."-240.mp4");}
|
||
|
|
if($row["otherres"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/".$directory1."video_".$row["video_id"].".mp4 https://media.bateworld.com/".$directory1."video_".$row["video_id"].".mp4");}*/
|
||
|
|
//mail("leprakhauns@gmail.com", "Still going?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//echo "UPDATE se_users SET is_converted='1',rawfile='' WHERE user_id='".$row["user_id"]."' LIMIT 1";
|
||
|
|
$database->database_query("UPDATE se_event_videos SET video_is_converted='1', video_admin_approved='1', rawfile='' WHERE video_id='".$row["video_id"]."' LIMIT 1");
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Ended?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."video_".$row["video_id"].".mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"].".mp4");
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."video_".$row["video_id"]."-1080.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-1080.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["video_id"]."-720.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-720.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["video_id"]."-480.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-480.mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["video_id"]."-240.mp4");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."-240.mp4");
|
||
|
|
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
highwindsdelete(IMAGECDN.$directory1."video_".$row["video_id"]."_thumb.jpg");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//mail("leprakhauns@gmail.com", "huh?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_settings SET toserver=0 WHERE setting_id=1");
|
||
|
|
$database->database_query("UPDATE se_event_videos SET del='1' WHERE video_id='".$row["video_id"]."'");
|
||
|
|
@unlink($_SERVER["DOCUMENT_ROOT"]."/video_event_uploads/".$row["rawfile"]);
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
/*}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bateoff SET is_converted='0' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function check_bateoff()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url, $database_host, $database_username, $database_password, $database_name;;
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media started", "");
|
||
|
|
//if($setting["toserver"]==1){return;}
|
||
|
|
echo "A";
|
||
|
|
//mail("leprakhauns@gmail.com", "Started?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM bateworldcom_zips.bateoff WHERE is_converted=6");
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
//$database->database_query("UPDATE se_settings SET toserver=1 WHERE setting_id=1");
|
||
|
|
echo $row["id"]." ";
|
||
|
|
$directory="./videos/bateoff/";
|
||
|
|
$directory1="videos/bateoff/";
|
||
|
|
//if(file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
echo $row["1080"];
|
||
|
|
//mail("leprakhauns@gmail.com", "Running?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting thumb", "");
|
||
|
|
//exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/videos/bateoff/".$row["id"]."_thumb.jpg https://media.bateworld.com/videos/bateoff/".$row["id"]."_thumb.jpg");
|
||
|
|
|
||
|
|
if($row["1080"]==1){
|
||
|
|
//echo " wget -O /home/bateworld/public_html/videos/bateoff/".$row["id"]."-1080.mp4 https://media.bateworld.com/videos/bateoff/".$row["id"]."-1080.mp4 ";
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting 1080", "");
|
||
|
|
//$s=exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/videos/bateoff/".$row["id"]."-1080.mp4 https://media.bateworld.com/videos/bateoff/".$row["id"]."-1080.mp4", $a, $o);
|
||
|
|
var_dump($a);
|
||
|
|
var_dump($s);
|
||
|
|
var_dump($o);
|
||
|
|
}
|
||
|
|
//if($row["720"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/videos/bateoff/".$row["id"]."-720.mp4 https://media.bateworld.com/videos/bateoff/".$row["id"]."-720.mp4");}
|
||
|
|
//if($row["480"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/videos/bateoff/".$row["id"]."-480.mp4 https://media.bateworld.com/videos/bateoff/".$row["id"]."-480.mp4");}
|
||
|
|
//if($row["240"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/videos/bateoff/".$row["id"]."-240.mp4 https://media.bateworld.com/videos/bateoff/".$row["id"]."-240.mp4");}
|
||
|
|
//if($row["otherres"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/videos/bateoff/".$row["id"].".mp4 https://media.bateworld.com/videos/bateoff/".$row["id"].".mp4");}
|
||
|
|
//mail("leprakhauns@gmail.com", "Still going?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".$row["id"]."' LIMIT 1");
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Ended?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"].".mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"].".mp4");
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-1080.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"].".mp4");
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-720.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"].".mp4");
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-480.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"].".mp4");
|
||
|
|
|
||
|
|
// $res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-240.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"].".mp4");
|
||
|
|
//highwindsdelete(IMAGECDN.$directory1.$row["id"].".mp4");
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"].".jpg");
|
||
|
|
highwindsdelete($directory1.$row["id"].".jpg");
|
||
|
|
highwindsdelete($directory1.$row["id"].".jpg");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//mail("leprakhauns@gmail.com", "huh?", "UPDATE bateworldcom_zips.bateoff SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
//$database->database_query("UPDATE se_settings SET toserver=0 WHERE setting_id=1");
|
||
|
|
//$database->database_query("UPDATE bateworldcom_zips.bateoff SET del='1' WHERE id='".$row["id"]."'");
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
/*}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bateoff SET is_converted='0' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function check_training_pull_from_media()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url, $database_host, $database_username, $database_password, $database_name;;
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media started", "");
|
||
|
|
//if($setting["toserver"]==1){return;}
|
||
|
|
echo "A";
|
||
|
|
//mail("leprakhauns@gmail.com", "Started?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM bateworldcom_zips.bator_training WHERE is_converted=6");
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
//$database->database_query("UPDATE se_settings SET toserver=1 WHERE setting_id=1");
|
||
|
|
echo $row["id"]." ";
|
||
|
|
$directory="./batortraining/";
|
||
|
|
$directory1="batortraining/";
|
||
|
|
//if(file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
echo $row["1080"];
|
||
|
|
//mail("leprakhauns@gmail.com", "Running?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting thumb", "");
|
||
|
|
//exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"]."_thumb.jpg https://media.bateworld.com/batortraining/".$row["id"]."_thumb.jpg");
|
||
|
|
|
||
|
|
if($row["1080"]==1){
|
||
|
|
//echo " wget -O /home/bateworld/public_html/batortraining/".$row["id"]."-1080.mp4 https://media.bateworld.com/batortraining/".$row["id"]."-1080.mp4 ";
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting 1080", "");
|
||
|
|
//$s=exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"]."-1080.mp4 https://media.bateworld.com/batortraining/".$row["id"]."-1080.mp4", $a, $o);
|
||
|
|
var_dump($a);
|
||
|
|
var_dump($s);
|
||
|
|
var_dump($o);
|
||
|
|
}
|
||
|
|
//if($row["720"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"]."-720.mp4 https://media.bateworld.com/batortraining/".$row["id"]."-720.mp4");}
|
||
|
|
//if($row["480"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"]."-480.mp4 https://media.bateworld.com/batortraining/".$row["id"]."-480.mp4");}
|
||
|
|
//if($row["240"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"]."-240.mp4 https://media.bateworld.com/batortraining/".$row["id"]."-240.mp4");}
|
||
|
|
//if($row["otherres"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"].".mp4 https://media.bateworld.com/batortraining/".$row["id"].".mp4");}
|
||
|
|
//mail("leprakhauns@gmail.com", "Still going?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".$row["id"]."' LIMIT 1");
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Ended?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"].".mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"].".mp4");
|
||
|
|
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-1080.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"]."-1080.mp4");
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-720.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"]."-720.mp4");
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-480.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"]."-480.mp4");
|
||
|
|
|
||
|
|
// $res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-240.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"]."-240.mp4");
|
||
|
|
|
||
|
|
//highwindsdelete(IMAGECDN.$directory1.$row["id"].".mp4");
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"].".jpg");
|
||
|
|
highwindsdelete($directory1.$row["id"].".jpg");
|
||
|
|
highwindsdelete($directory1.$row["id"].".jpg");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//mail("leprakhauns@gmail.com", "huh?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
//$database->database_query("UPDATE se_settings SET toserver=0 WHERE setting_id=1");
|
||
|
|
//$database->database_query("UPDATE bateworldcom_zips.bator_training SET del='1' WHERE id='".$row["id"]."'");
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
/*}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bator_training SET is_converted='0' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
function check_training_preview_pull_from_media()
|
||
|
|
{
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url, $database_host, $database_username, $database_password, $database_name;;
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media started", "");
|
||
|
|
//if($setting["toserver"]==1){return;}
|
||
|
|
echo "A";
|
||
|
|
//mail("leprakhauns@gmail.com", "Started?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM bateworldcom_zips.bator_training WHERE preview_is_converted=6");
|
||
|
|
$video = new se_video();
|
||
|
|
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
//$database->database_query("UPDATE se_settings SET toserver=1 WHERE setting_id=1");
|
||
|
|
echo $row["id"]." ";
|
||
|
|
$directory="./batortraining/";
|
||
|
|
$directory1="batortraining/";
|
||
|
|
//if(file_exists($directory.$row["id"].".mp4")){
|
||
|
|
|
||
|
|
echo $row["1080_preview"];
|
||
|
|
//mail("leprakhauns@gmail.com", "Running?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting thumb", "");
|
||
|
|
//exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"]."_preview_thumb.jpg https://media.bateworld.com/batortraining/".$row["id"]."_preview_thumb.jpg");
|
||
|
|
|
||
|
|
if($row["1080_preview"]==1){
|
||
|
|
//echo " wget -O /home/bateworld/public_html/batortraining/".$row["id"]."-1080.mp4 https://media.bateworld.com/batortraining/".$row["id"]."-1080.mp4 ";
|
||
|
|
//mail("leprakhauns@gmail.com", "Pull from Media getting 1080", "");
|
||
|
|
//$s=exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"]."-1080.mp4 https://media.bateworld.com/batortraining/".$row["id"]."-preview-1080.mp4", $a, $o);
|
||
|
|
var_dump($a);
|
||
|
|
var_dump($s);
|
||
|
|
var_dump($o);
|
||
|
|
}
|
||
|
|
//if($row["720_preview"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"]."-720.mp4 https://media.bateworld.com/batortraining/".$row["id"]."-720.mp4");}
|
||
|
|
//if($row["480_preview"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"]."-480.mp4 https://media.bateworld.com/batortraining/".$row["id"]."-480.mp4");}
|
||
|
|
// if($row["240_preview"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"]."-240.mp4 https://media.bateworld.com/batortraining/".$row["id"]."-240.mp4");}
|
||
|
|
//if($row["otherres_preview"]==1){exec("wget -O ".$_SERVER['DOCUMENT_ROOT']."/batortraining/".$row["id"].".mp4 https://media.bateworld.com/batortraining/".$row["id"].".mp4");}
|
||
|
|
//mail("leprakhauns@gmail.com", "Still going?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bator_training SET preview_is_converted='1',preview_rawfile='' WHERE id='".$row["id"]."' LIMIT 1");
|
||
|
|
|
||
|
|
//mail("leprakhauns@gmail.com", "Ended?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"].".mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"].".mp4");
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-1080.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"]."-1080.mp4");
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-720.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"]."-720.mp4");
|
||
|
|
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-480.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"]."-480.mp4");
|
||
|
|
|
||
|
|
// $res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"]."-240.mp4");
|
||
|
|
highwindsdelete($directory1.$row["id"]."-240.mp4");
|
||
|
|
|
||
|
|
|
||
|
|
//highwindsdelete(IMAGECDN.$directory1.$row["id"].".mp4");
|
||
|
|
//$res = $cf_cache_v1->purge_file("https://bateworld.com/".$directory1.$row["id"].".jpg");
|
||
|
|
highwindsdelete($directory1.$row["id"].".jpg");
|
||
|
|
highwindsdelete($directory1.$row["id"].".jpg");
|
||
|
|
//if(!$database->database_ping())
|
||
|
|
if (!is_object($database) && !$database instanceof mysqli)
|
||
|
|
{
|
||
|
|
|
||
|
|
checkconnection();
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
//mail("leprakhauns@gmail.com", "huh?", "UPDATE bateworldcom_zips.bator_training SET is_converted='1',rawfile='' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
//$database->database_query("UPDATE se_settings SET toserver=0 WHERE setting_id=1");
|
||
|
|
//$database->database_query("UPDATE bateworldcom_zips.bator_training SET preview_del='1' WHERE id='".$row["id"]."'");
|
||
|
|
|
||
|
|
unlink($directory.$row["preview_rawfile"]);
|
||
|
|
|
||
|
|
/*}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE bateworldcom_zips.bator_training SET is_converted='0' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1");
|
||
|
|
}*/
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function videocheckconversion2()
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_videos WHERE video_id='".$_GET["video_id"]."'");
|
||
|
|
$video = new se_video();
|
||
|
|
echo "R";
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
echo "A";
|
||
|
|
$directory=video_dir($row["video_user_id"]);
|
||
|
|
|
||
|
|
if(file_exists($directory.$row["video_id"].".mp4")){
|
||
|
|
|
||
|
|
echo $row["video_id"];
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='1', video_admin_approved='1' WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$video_info = $database->database_fetch_assoc($database->database_query("SELECT user_id, user_username, user_fname, user_lname, user_privacy, video_id, video_title FROM se_videos LEFT JOIN se_users ON se_videos.video_user_id=se_users.user_id WHERE se_videos.video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$author = new se_user();
|
||
|
|
$author->user_exists = 1;
|
||
|
|
$author->user_info['user_id'] = $video_info['user_id'];
|
||
|
|
$author->user_info['user_username'] = $video_info['user_username'];
|
||
|
|
$author->user_info['user_fname'] = $video_info['user_fname'];
|
||
|
|
$author->user_info['user_lname'] = $video_info['user_lname'];
|
||
|
|
$author->user_info['user_privacy'] = $video_info['user_privacy'];
|
||
|
|
$author->user_displayname();
|
||
|
|
|
||
|
|
$action_media = array();
|
||
|
|
$thumb_path = str_replace('./', '', $video->video_dir($video_info['user_id']).$video_info['video_id']."_thumb.jpg");
|
||
|
|
$media_link = str_replace($url->url_base, '', $url->url_create('video', $author->user_info['user_username'], $video_info['video_id']));
|
||
|
|
|
||
|
|
if( file_exists($thumb_path) )
|
||
|
|
{
|
||
|
|
$media_width = $misc->photo_size($thumb_path, "100", "100", "w");
|
||
|
|
$media_height = $misc->photo_size($thumb_path, "100", "100", "h");
|
||
|
|
$action_media[] = array(
|
||
|
|
'media_link' => $media_link,
|
||
|
|
'media_path' => $thumb_path,
|
||
|
|
'media_width' => $media_width,
|
||
|
|
'media_height' => $media_height
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
// INSERT ACTION
|
||
|
|
if(strlen($video_info["video_title"]) > 100) { $video_info["video_title"] = substr($video_info['video_title'], 0, 97); $video_info['video_title'] .= "..."; }
|
||
|
|
|
||
|
|
# $actions->actions_add($author, "newvideo", array($author->user_info['user_username'], $author->user_displayname, $video_info['video_id'], $video_info['video_title']), $action_media, 0, false, "user", $author->user_info['user_id'], $author->user_info['user_privacy']);
|
||
|
|
|
||
|
|
$cf_cache_v1 = new cloudflare_cache(
|
||
|
|
array(
|
||
|
|
"tkn" => "b4fafa93f2bcd7ce518553d2df2793edd06e8",
|
||
|
|
"email" => "lepslair@gmail.com",
|
||
|
|
"z" => "bateworld.com"
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
$res = $cf_cache_v1->purge_file("https://bateworld.com/".$video->video_dir($video_info['user_id']).$row["id"].".mp4");
|
||
|
|
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='0' WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1");
|
||
|
|
}
|
||
|
|
}}
|
||
|
|
|
||
|
|
// END video_manage_jobs() FUNCTION
|
||
|
|
|
||
|
|
function videocheckconversion1()
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_videos WHERE video_is_converted=2 AND rawfile!='' AND video_id<80874");
|
||
|
|
$video = new se_video();
|
||
|
|
echo "R";
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
echo "A";
|
||
|
|
$directory=video_dir($row["video_user_id"]);
|
||
|
|
|
||
|
|
if(file_exists($directory.$row["video_id"].".mp4")){
|
||
|
|
|
||
|
|
echo $row["video_id"];
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='1', video_admin_approved='1' WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$video_info = $database->database_fetch_assoc($database->database_query("SELECT user_id, user_username, user_fname, user_lname, user_privacy, video_id, video_title FROM se_videos LEFT JOIN se_users ON se_videos.video_user_id=se_users.user_id WHERE se_videos.video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$author = new se_user();
|
||
|
|
$author->user_exists = 1;
|
||
|
|
$author->user_info['user_id'] = $video_info['user_id'];
|
||
|
|
$author->user_info['user_username'] = $video_info['user_username'];
|
||
|
|
$author->user_info['user_fname'] = $video_info['user_fname'];
|
||
|
|
$author->user_info['user_lname'] = $video_info['user_lname'];
|
||
|
|
$author->user_info['user_privacy'] = $video_info['user_privacy'];
|
||
|
|
$author->user_displayname();
|
||
|
|
|
||
|
|
$action_media = array();
|
||
|
|
$thumb_path = str_replace('./', '', $video->video_dir($video_info['user_id']).$video_info['video_id']."_thumb.jpg");
|
||
|
|
$media_link = str_replace($url->url_base, '', $url->url_create('video', $author->user_info['user_username'], $video_info['video_id']));
|
||
|
|
|
||
|
|
if( file_exists($thumb_path) )
|
||
|
|
{
|
||
|
|
$media_width = $misc->photo_size($thumb_path, "100", "100", "w");
|
||
|
|
$media_height = $misc->photo_size($thumb_path, "100", "100", "h");
|
||
|
|
$action_media[] = array(
|
||
|
|
'media_link' => $media_link,
|
||
|
|
'media_path' => $thumb_path,
|
||
|
|
'media_width' => $media_width,
|
||
|
|
'media_height' => $media_height
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
// INSERT ACTION
|
||
|
|
if(strlen($video_info["video_title"]) > 100) { $video_info["video_title"] = substr($video_info['video_title'], 0, 97); $video_info['video_title'] .= "..."; }
|
||
|
|
|
||
|
|
# $actions->actions_add($author, "newvideo", array($author->user_info['user_username'], $author->user_displayname, $video_info['video_id'], $video_info['video_title']), $action_media, 0, false, "user", $author->user_info['user_id'], $author->user_info['user_privacy']);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
echo $row["video_id"];
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='0' WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1");
|
||
|
|
}
|
||
|
|
}}
|
||
|
|
function videocheckconversion()
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_videos WHERE video_is_converted=2 AND rawfile!=''");
|
||
|
|
$video = new se_video();
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
|
||
|
|
$directory=video_dir($row["video_user_id"]);
|
||
|
|
|
||
|
|
if(file_exists($directory.$row["video_id"].".mp4")&&file_exists($directory.$row["video_id"].".flv")){
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_videos SET video_is_converted='1', video_admin_approved='1' WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$video_info = $database->database_fetch_assoc($database->database_query("SELECT user_id, user_username, user_fname, user_lname, user_privacy, video_id, video_title FROM se_videos LEFT JOIN se_users ON se_videos.video_user_id=se_users.user_id WHERE se_videos.video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$author = new se_user();
|
||
|
|
$author->user_exists = 1;
|
||
|
|
$author->user_info['user_id'] = $video_info['user_id'];
|
||
|
|
$author->user_info['user_username'] = $video_info['user_username'];
|
||
|
|
$author->user_info['user_fname'] = $video_info['user_fname'];
|
||
|
|
$author->user_info['user_lname'] = $video_info['user_lname'];
|
||
|
|
$author->user_info['user_privacy'] = $video_info['user_privacy'];
|
||
|
|
$author->user_displayname();
|
||
|
|
|
||
|
|
$action_media = array();
|
||
|
|
$thumb_path = str_replace('./', '', $video->video_dir($video_info['user_id']).$video_info['video_id']."_thumb.jpg");
|
||
|
|
$media_link = str_replace($url->url_base, '', $url->url_create('video', $author->user_info['user_username'], $video_info['video_id']));
|
||
|
|
|
||
|
|
if( file_exists($thumb_path) )
|
||
|
|
{
|
||
|
|
$media_width = $misc->photo_size($thumb_path, "100", "100", "w");
|
||
|
|
$media_height = $misc->photo_size($thumb_path, "100", "100", "h");
|
||
|
|
$action_media[] = array(
|
||
|
|
'media_link' => $media_link,
|
||
|
|
'media_path' => $thumb_path,
|
||
|
|
'media_width' => $media_width,
|
||
|
|
'media_height' => $media_height
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
// INSERT ACTION
|
||
|
|
if(strlen($video_info["video_title"]) > 100) { $video_info["video_title"] = substr($video_info['video_title'], 0, 97); $video_info['video_title'] .= "..."; }
|
||
|
|
|
||
|
|
# $actions->actions_add($author, "newvideo", array($author->user_info['user_username'], $author->user_displayname, $video_info['video_id'], $video_info['video_title']), $action_media, 0, false, "user", $author->user_info['user_id'], $author->user_info['user_privacy']);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
}
|
||
|
|
elseif(file_exists($directory.$row["video_id"].".flv")&&!file_exists($directory.$row["video_id"].".mp4")){
|
||
|
|
shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["video_id"].".flv -threads 3 -ar 22050 -y -vcodec libx264 -g 30 -s ".$setting['setting_video_width']."x".$setting['setting_video_height']." ".$directory.$row["video_id"].".mp4 2>&1 \n");
|
||
|
|
}
|
||
|
|
}}
|
||
|
|
|
||
|
|
function groupvideocheckconversion()
|
||
|
|
{
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
|
||
|
|
|
||
|
|
$query=$database->database_query("SELECT * FROM se_group_videos WHERE video_is_converted=2 AND rawfile!=''");
|
||
|
|
$video = new se_video();
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
|
||
|
|
$directory=group_dir($row["video_group_id"]);
|
||
|
|
|
||
|
|
if(file_exists($directory."video_".$row["video_id"].".mp4")){
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$database->database_query("UPDATE se_group_videos SET video_is_converted='1', video_admin_approved='1' WHERE video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1");
|
||
|
|
|
||
|
|
$video_info = $database->database_fetch_assoc($database->database_query("SELECT user_id, user_username, user_fname, user_lname, user_privacy, video_id, video_title FROM se_group_videos LEFT JOIN se_group_videos ON se_group_videos.video_user_id=se_users.user_id WHERE se_videos.video_id='".htmlspecialchars(strip_tags($row["video_id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
$author = new se_user();
|
||
|
|
$author->user_exists = 1;
|
||
|
|
$author->user_info['user_id'] = $video_info['user_id'];
|
||
|
|
$author->user_info['user_username'] = $video_info['user_username'];
|
||
|
|
$author->user_info['user_fname'] = $video_info['user_fname'];
|
||
|
|
$author->user_info['user_lname'] = $video_info['user_lname'];
|
||
|
|
$author->user_info['user_privacy'] = $video_info['user_privacy'];
|
||
|
|
$author->user_displayname();
|
||
|
|
|
||
|
|
$action_media = array();
|
||
|
|
$thumb_path = str_replace('./', '', group_dir($row["video_group_id"])."video_".$video_info['video_id']."_thumb.jpg");
|
||
|
|
$media_link = str_replace($url->url_base, '', $url->url_create('video', $author->user_info['user_username'], $video_info['video_id']));
|
||
|
|
|
||
|
|
if( file_exists($thumb_path) )
|
||
|
|
{
|
||
|
|
$media_width = $misc->photo_size($thumb_path, "100", "100", "w");
|
||
|
|
$media_height = $misc->photo_size($thumb_path, "100", "100", "h");
|
||
|
|
$action_media[] = array(
|
||
|
|
'media_link' => $media_link,
|
||
|
|
'media_path' => $thumb_path,
|
||
|
|
'media_width' => $media_width,
|
||
|
|
'media_height' => $media_height
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
// INSERT ACTION
|
||
|
|
//if(strlen($video_info[video_title]) > 100) { $video_info[video_title] = substr($video_info['video_title'], 0, 97); $video_info['video_title'] .= "..."; }
|
||
|
|
|
||
|
|
# $actions->actions_add($author, "newvideo", array($author->user_info['user_username'], $author->user_displayname, $video_info['video_id'], $video_info['video_title']), $action_media, 0, false, "user", $author->user_info['user_id'], $author->user_info['user_privacy']);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//unlink($directory.$row["rawfile"]);
|
||
|
|
|
||
|
|
}
|
||
|
|
elseif(!file_exists($directory."video_".$row["video_id"].".mp4")){
|
||
|
|
|
||
|
|
//shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -movflags faststart -vcodec h264 -acodec aac -strict -2 -vf scale=".$width.":-1 ".$directory.$row["video_id"].".mp4");
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}}
|
||
|
|
|
||
|
|
|
||
|
|
// THIS FUNCTION IS RUN DURING THE SEARCH PROCESS TO SEARCH THROUGH VIDEOS
|
||
|
|
// INPUT:
|
||
|
|
// OUTPUT:
|
||
|
|
function search_video($vidsonly="")
|
||
|
|
{
|
||
|
|
global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;
|
||
|
|
if($vidsonly==1){
|
||
|
|
// CONSTRUCT QUERY
|
||
|
|
$video_query = "SELECT
|
||
|
|
se_videos.*,
|
||
|
|
se_users.user_id,
|
||
|
|
se_users.user_username,
|
||
|
|
se_users.user_photo,
|
||
|
|
se_users.user_fname,
|
||
|
|
se_users.user_lname
|
||
|
|
FROM
|
||
|
|
se_videos,
|
||
|
|
se_users,
|
||
|
|
se_levels
|
||
|
|
WHERE
|
||
|
|
se_videos.approved=1 AND
|
||
|
|
se_videos.video_user_id=se_users.user_id AND
|
||
|
|
se_users.user_enabled=1 AND
|
||
|
|
se_users.user_level_id=se_levels.level_id AND
|
||
|
|
(
|
||
|
|
se_videos.video_search='1' OR
|
||
|
|
se_levels.level_video_search='0'
|
||
|
|
)
|
||
|
|
AND
|
||
|
|
(
|
||
|
|
(se_videos.video_title LIKE '%$search_text%' OR
|
||
|
|
se_videos.video_desc LIKE '%$search_text%')
|
||
|
|
OR (se_users.user_username LIKE '%$search_text%')
|
||
|
|
) AND se_videos.video_admin_approved=1";
|
||
|
|
}else{
|
||
|
|
$video_query = "SELECT
|
||
|
|
se_videos.*,
|
||
|
|
se_users.user_id,
|
||
|
|
se_users.user_username,
|
||
|
|
se_users.user_photo,
|
||
|
|
se_users.user_fname,
|
||
|
|
se_users.user_lname
|
||
|
|
FROM
|
||
|
|
se_videos,
|
||
|
|
se_users,
|
||
|
|
se_levels
|
||
|
|
WHERE
|
||
|
|
se_videos.approved=1 AND
|
||
|
|
se_videos.video_user_id=se_users.user_id AND
|
||
|
|
se_users.user_enabled=1 AND
|
||
|
|
se_users.user_level_id=se_levels.level_id AND
|
||
|
|
(
|
||
|
|
se_videos.video_search='1' OR
|
||
|
|
se_levels.level_video_search='0'
|
||
|
|
)
|
||
|
|
AND
|
||
|
|
(
|
||
|
|
se_videos.video_title LIKE '%$search_text%' OR
|
||
|
|
se_videos.video_desc LIKE '%$search_text%'
|
||
|
|
) AND se_videos.video_admin_approved=1";
|
||
|
|
}
|
||
|
|
|
||
|
|
// GET TOTAL RESULTS
|
||
|
|
$total_videos = $database->database_num_rows($database->database_query($video_query." LIMIT 201"));
|
||
|
|
|
||
|
|
// IF NOT TOTAL ONLY
|
||
|
|
if($t == "video") {
|
||
|
|
|
||
|
|
// MAKE VIDEO PAGES
|
||
|
|
$start = ($p - 1) * $results_per_page;
|
||
|
|
$limit = $results_per_page+1;
|
||
|
|
|
||
|
|
// SEARCH VIDEOS
|
||
|
|
$video = new se_video();
|
||
|
|
$videos = $database->database_query($video_query." ORDER BY video_id DESC LIMIT $start, $limit");
|
||
|
|
while($video_info = $database->database_fetch_assoc($videos)) {
|
||
|
|
|
||
|
|
// CREATE AN OBJECT FOR USER
|
||
|
|
$profile = new se_user();
|
||
|
|
$profile->user_info["user_id"] = $video_info["user_id"];
|
||
|
|
$profile->user_info["user_username"] = $video_info["user_username"];
|
||
|
|
$profile->user_info["user_fname"] = $video_info["user_fname"];
|
||
|
|
$profile->user_info["user_lname"] = $video_info["user_lname"];
|
||
|
|
$profile->user_info["user_photo"] = $video_info["user_photo"];
|
||
|
|
$profile->user_displayname();
|
||
|
|
|
||
|
|
// SET RESULT VARS
|
||
|
|
$result_url = $url->url_create("video", $video_info["user_username"], $video_info["video_id"]);
|
||
|
|
$result_name = 5500141;
|
||
|
|
$result_desc = 5500142;
|
||
|
|
|
||
|
|
// SET DIRECTORY
|
||
|
|
$video_info["video_dir"] = $video->video_dir($video_info["user_id"]);
|
||
|
|
|
||
|
|
// CHECK FOR THUMBNAIL
|
||
|
|
$thumb_path = IMAGECDN1.$video_info["video_dir"].$video_info["video_id"]."_thumb.jpg";
|
||
|
|
//if(!file_exists($thumb_path)) { $video_info[video_thumb] = "./images/video_placeholder.gif"; }
|
||
|
|
|
||
|
|
// IF NO TITLE
|
||
|
|
if($video_info["video_title"] == "") { $video_info["video_title"] = SE_Language::get(589); }
|
||
|
|
|
||
|
|
// IF DESCRIPTION IS LONG
|
||
|
|
if(strlen($video_info["video_desc"]) > 150) { $video_info["video_desc"] = substr($video_info["video_desc"], 0, 147)."..."; }
|
||
|
|
|
||
|
|
$results[] = Array('result_url' => $result_url,
|
||
|
|
'result_icon' => $thumb_path,
|
||
|
|
'result_name' => $result_name,
|
||
|
|
'result_name_1' => $video_info["video_title"],
|
||
|
|
'time' => $video_info["video_datecreated"],
|
||
|
|
'result_desc' => $result_desc,
|
||
|
|
'result_desc_1' => $url->url_create('profile', $video_info["user_username"]),
|
||
|
|
'result_desc_2' => $profile->user_displayname,
|
||
|
|
'result_desc_3' => $video_info["video_desc"]);
|
||
|
|
}
|
||
|
|
|
||
|
|
// SET TOTAL RESULTS
|
||
|
|
$total_results = $total_videos;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// SET ARRAY VALUES
|
||
|
|
SE_Language::_preload_multi(5500141, 5500142, 5500143);
|
||
|
|
if($total_videos > 200) { $total_videos = "200+"; }
|
||
|
|
$search_objects[] = Array('search_type' => 'video',
|
||
|
|
'search_lang' => 5500143,
|
||
|
|
'search_total' => $total_videos);
|
||
|
|
|
||
|
|
|
||
|
|
} // END search_video() FUNCTION
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// THIS FUNCTION IS RUN WHEN A USER IS DELETED
|
||
|
|
// INPUT: $user_id REPRESENTING THE USER ID OF THE USER BEING DELETED
|
||
|
|
// OUTPUT:
|
||
|
|
|
||
|
|
function deleteuser_video($user_id)
|
||
|
|
{
|
||
|
|
global $database;
|
||
|
|
$database->database_query("INSERT INTO bateworldcom_wall.admin_log SET user_id='{$user_id}', time='".time()."', action='deleteuser_video function has been run'");
|
||
|
|
$query=$database->database_query("SELECT * FROM se_videos, se_users WHERE video_user_id=user_id AND user_id='".$database->database_real_escape_string($user_id)."'");
|
||
|
|
while($media_info=$database->database_fetch_array($query)){
|
||
|
|
$media_path = video_dir($user_id).$media_info["video_id"].".mp4";
|
||
|
|
$thumb_path = video_dir($user_id).$media_info["video_id"]."_thumb.jpg";
|
||
|
|
{
|
||
|
|
|
||
|
|
@unlink("../".$media_path);
|
||
|
|
@unlink("../".$thumb_path);
|
||
|
|
@unlink("../".video_dir($user_id).$media_info["video_id"]."-1080.mp4");
|
||
|
|
@unlink("../".video_dir($user_id).$media_info["video_id"]."-720.mp4");
|
||
|
|
@unlink("../".video_dir($user_id).$media_info["video_id"]."-480.mp4");
|
||
|
|
@unlink("../".video_dir($user_id).$media_info["video_id"]."-240.mp4");
|
||
|
|
$client = new MyS3Wrapper([
|
||
|
|
'region' => 'us-north-1',
|
||
|
|
'version' => 'latest',
|
||
|
|
'endpoint' => ENDPOINT,
|
||
|
|
'credentials' => [
|
||
|
|
'key' => AWS_KEY,
|
||
|
|
'secret' => AWS_SECRET_KEY
|
||
|
|
],
|
||
|
|
|
||
|
|
// Set the S3 class to use objects.dreamhost.com/bucket
|
||
|
|
// instead of bucket.objects.dreamhost.com
|
||
|
|
'use_path_style_endpoint' => true
|
||
|
|
]);
|
||
|
|
|
||
|
|
try {
|
||
|
|
$client->deleteObject(array(
|
||
|
|
'Bucket'=>'bateworld',
|
||
|
|
'Key' => str_replace("./", "", $media_path),
|
||
|
|
|
||
|
|
));
|
||
|
|
}catch (Exception $e) {echo $e;}
|
||
|
|
|
||
|
|
try {
|
||
|
|
$client->deleteObject(array(
|
||
|
|
'Bucket'=>'bateworld',
|
||
|
|
'Key' => str_replace("./", "", $thumb_path),
|
||
|
|
|
||
|
|
));
|
||
|
|
}catch (Exception $e) {echo $e;}
|
||
|
|
try {
|
||
|
|
$client->deleteObject(array(
|
||
|
|
'Bucket'=>'bateworld',
|
||
|
|
'Key' => str_replace("./", "", video_dir($user_id).$media_info["video_id"]."-1080.mp4"),
|
||
|
|
|
||
|
|
));
|
||
|
|
}catch (Exception $e) {echo $e;}
|
||
|
|
|
||
|
|
try {
|
||
|
|
$client->deleteObject(array(
|
||
|
|
'Bucket'=>'bateworld',
|
||
|
|
'Key' => str_replace("./", "", video_dir($user_id).$media_info["video_id"]."-720.mp4"),
|
||
|
|
|
||
|
|
));
|
||
|
|
}catch (Exception $e) {echo $e;}
|
||
|
|
try {
|
||
|
|
$client->deleteObject(array(
|
||
|
|
'Bucket'=>'bateworld',
|
||
|
|
'Key' => str_replace("./", "", video_dir($user_id).$media_info["video_id"]."-480.mp4"),
|
||
|
|
|
||
|
|
));
|
||
|
|
}catch (Exception $e) {echo $e;}
|
||
|
|
|
||
|
|
try {
|
||
|
|
$client->deleteObject(array(
|
||
|
|
'Bucket'=>'bateworld',
|
||
|
|
'Key' => str_replace("./", "", video_dir($user_id).$media_info["video_id"]."-240.mp4"),
|
||
|
|
|
||
|
|
));
|
||
|
|
}catch (Exception $e) {echo $e;}
|
||
|
|
highwindsdelete(str_replace("./", "", $media_path));
|
||
|
|
@unlink("../".$thumb_path);
|
||
|
|
highwindsdelete(str_replace("./", "", $thumb_path));
|
||
|
|
//if(file_exists($media_path)) { unlink($media_path); }
|
||
|
|
//if(file_exists($media_path)) { echo "ERROR";}
|
||
|
|
}
|
||
|
|
|
||
|
|
if(file_exists($thumb_path)) { @unlink($thumb_path);
|
||
|
|
@unlink($media_path);
|
||
|
|
@unlink(video_dir($user_id).$media_info["video_id"]."-1080.mp4");
|
||
|
|
@unlink(video_dir($user_id).$media_info["video_id"]."-720.mp4");
|
||
|
|
@unlink(video_dir($user_id).$media_info["video_id"]."-480.mp4");
|
||
|
|
@unlink(video_dir($user_id).$media_info["video_id"]."-240.mp4");
|
||
|
|
|
||
|
|
highwindsdelete(str_replace("./", "", video_dir($user_id).$media_info["video_id"]."-1080.mp4"));
|
||
|
|
highwindsdelete(str_replace("./", "", video_dir($user_id).$media_info["video_id"]."-720.mp4"));
|
||
|
|
highwindsdelete(str_replace("./", "", video_dir($user_id).$media_info["video_id"]."-480.mp4"));
|
||
|
|
highwindsdelete(str_replace("./", "", video_dir($user_id).$media_info["video_id"]."-240.mp4"));
|
||
|
|
highwindsdelete(str_replace("./", "", $thumb_path));
|
||
|
|
//if(file_exists($thumb_path)) { unlink($thumb_path); }
|
||
|
|
//if(file_exists($thumb_path)) { echo "ERROR";}
|
||
|
|
}
|
||
|
|
$action_thumb_path = $url->url_userdir($row1["video_user_id"]).$pic."_thumb.".$media_info['media_ext'];
|
||
|
|
}
|
||
|
|
// GET VIDEO OBJECT
|
||
|
|
$video = new se_video($user_id);
|
||
|
|
|
||
|
|
// DELETE VIDEOS, COMMENTS, AND RATINGS
|
||
|
|
$database->database_query("DELETE FROM se_videos, se_videocomments, se_videoratings USING se_videos LEFT JOIN se_videocomments ON se_videos.video_id=se_videocomments.videocomments_video_id LEFT JOIN se_videoratings ON se_videos.video_id=se_videoratings.videorating_video_id WHERE se_videos.video_user_id='$user_id'");
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// DELETE USER'S FILES
|
||
|
|
if(is_dir($video->video_dir())) {
|
||
|
|
$dir = $video->video_dir();
|
||
|
|
} else {
|
||
|
|
$dir = ".".$video->video_dir();
|
||
|
|
}
|
||
|
|
|
||
|
|
if($dh = @opendir($dir))
|
||
|
|
{
|
||
|
|
while( ($file = @readdir($dh)) !== false )
|
||
|
|
{
|
||
|
|
if( $file != "." && $file != ".." )
|
||
|
|
{
|
||
|
|
@unlink($dir.$file);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
@closedir($dh);
|
||
|
|
}
|
||
|
|
@rmdir($dir);
|
||
|
|
}
|
||
|
|
|
||
|
|
// END deleteuser_video() FUNCTION
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// THIS FUNCTION IS RUN WHEN GENERATING SITE STATISTICS
|
||
|
|
// INPUT:
|
||
|
|
// OUTPUT:
|
||
|
|
function site_statistics_video(&$args)
|
||
|
|
{
|
||
|
|
global $database;
|
||
|
|
|
||
|
|
$statistics =& $args['statistics'];
|
||
|
|
|
||
|
|
// NOTE: CACHING WILL BE HANDLED BY THE FUNCTION THAT CALLS THIS
|
||
|
|
|
||
|
|
$total = $database->database_fetch_assoc($database->database_query("SELECT COUNT(video_id) AS total FROM se_videos WHERE video_is_converted=1"));
|
||
|
|
$statistics['videos'] = array(
|
||
|
|
'title' => 5500175,
|
||
|
|
'stat' => (int) ( isset($total['total']) ? $total['total'] : 0 )
|
||
|
|
);
|
||
|
|
|
||
|
|
/*
|
||
|
|
$total = $database->database_fetch_assoc($database->database_query("SELECT COUNT(videocomment_id) AS total FROM se_videocomments"));
|
||
|
|
$statistics['videocomments'] = array(
|
||
|
|
'title' => 5500176,
|
||
|
|
'stat' => (int) ( isset($total['total']) ? $total['total'] : 0 )
|
||
|
|
);
|
||
|
|
|
||
|
|
$total = $database->database_fetch_assoc($database->database_query("SELECT COUNT(videorating_id) AS total FROM se_videoratings"));
|
||
|
|
$statistics['videoratings'] = array(
|
||
|
|
'title' => 5500177,
|
||
|
|
'stat' => (int) ( isset($total['total']) ? $total['total'] : 0 )
|
||
|
|
);
|
||
|
|
*/
|
||
|
|
}
|
||
|
|
|
||
|
|
// END site_statistics_video() FUNCTION
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function extract_youtube_code($video_url)
|
||
|
|
{
|
||
|
|
$video_code_start = strpos($video_url, "v=");
|
||
|
|
if ($video_code_start === FALSE) {
|
||
|
|
$is_error = 5500189;
|
||
|
|
return FALSE;
|
||
|
|
}
|
||
|
|
$video_code = substr($video_url, $video_code_start + 2);
|
||
|
|
if (empty($video_code))
|
||
|
|
{
|
||
|
|
return FALSE;
|
||
|
|
}
|
||
|
|
$video_code_end = strpos($video_code, '&');
|
||
|
|
if ($video_code_end) {
|
||
|
|
$video_code = substr($video_code, 0, $video_code_end);
|
||
|
|
}
|
||
|
|
|
||
|
|
return $video_code;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function video_dir($user_id = 0, $create_if_missing = false)
|
||
|
|
{
|
||
|
|
/*if( !$user_id && $this->user_id )
|
||
|
|
$user_id = $this->user_id;
|
||
|
|
*/
|
||
|
|
if( !$user_id && !is_numeric($user_id) )
|
||
|
|
return FALSE;
|
||
|
|
|
||
|
|
$subdir = $user_id + 999 - ( ( $user_id - 1 ) % 1000 );
|
||
|
|
$videodir = "./uploads_video/{$subdir}/{$user_id}/";
|
||
|
|
|
||
|
|
if( $create_if_missing )
|
||
|
|
{
|
||
|
|
|
||
|
|
// IN ADMIN DIRECTORY, ABORT
|
||
|
|
if( !is_dir('./uploads_video') )
|
||
|
|
return FALSE;
|
||
|
|
|
||
|
|
$video_path_array = explode("/", $videodir);
|
||
|
|
array_pop($video_path_array);
|
||
|
|
array_pop($video_path_array);
|
||
|
|
$subdir = implode("/", $video_path_array)."/";
|
||
|
|
if( !is_dir($subdir) )
|
||
|
|
{
|
||
|
|
@mkdir($subdir, 0777);
|
||
|
|
@chmod($subdir, 0777);
|
||
|
|
$handle = @fopen($subdir."index.php", 'x+');
|
||
|
|
@fclose($handle);
|
||
|
|
}
|
||
|
|
if( !is_dir($videodir) )
|
||
|
|
{
|
||
|
|
@mkdir($videodir, 0777);
|
||
|
|
@chmod($videodir, 0777);
|
||
|
|
$handle = @fopen($videodir."/index.php", 'x+');
|
||
|
|
@fclose($handle);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return $videodir;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function group_dir($group_id = 0) {
|
||
|
|
|
||
|
|
if($group_id != 0 ) {
|
||
|
|
$group=new se_group("", $group_id);
|
||
|
|
//if($group->group_exists){
|
||
|
|
|
||
|
|
$subdir = $group_id+999-(($group_id-1)%1000);
|
||
|
|
$groupdir = "./uploads_group/{$subdir}/{$group_id}/";
|
||
|
|
}//}
|
||
|
|
return $groupdir;
|
||
|
|
|
||
|
|
}
|
||
|
|
function event_dir($group_id = 0) {
|
||
|
|
|
||
|
|
if($group_id != 0 ) {
|
||
|
|
$group=new se_event("", $group_id);
|
||
|
|
//if($group->event_exists){
|
||
|
|
|
||
|
|
$subdir = $group_id+999-(($group_id-1)%1000);
|
||
|
|
$groupdir = "./uploads_event/{$subdir}/{$group_id}/";
|
||
|
|
}//}
|
||
|
|
return $groupdir;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function testmanagetraining(){
|
||
|
|
|
||
|
|
global $database, $setting, $actions, $misc, $url;
|
||
|
|
mail("leprakhauns@gmail.com", "Bator Training Started", "Bator Training Started");
|
||
|
|
echo time()."<br>";
|
||
|
|
|
||
|
|
|
||
|
|
$getID3 = new getID3;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*echo("Duration: ".$file['playtime_string'].
|
||
|
|
" / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
|
||
|
|
" / Filesize: ".$file['filesize']." bytes<br />");*/
|
||
|
|
|
||
|
|
/*$query=$database->database_query("SELECT * FROM bateworldcom_zips.bator_training WHERE is_converted=0 AND rawfile!='' AND attempt<6 ORDER BY id LIMIT 1");
|
||
|
|
$job_counter = 0;
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done", $database->database_num_rows($query));
|
||
|
|
if($database->database_num_rows($query)==0){
|
||
|
|
manage_training_preview();
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
*/
|
||
|
|
//echo "SELECT * FROM bateworldcom_zips.bator_training WHERE video_is_converted=0 AND rawfile!='' AND video_user_id='7653' ORDER BY id LIMIT 1";
|
||
|
|
//while($row=$database->database_fetch_array($query))
|
||
|
|
{
|
||
|
|
// $database->database_query("UPDATE bateworldcom_zips.bator_training SET attempt=attempt+1 WHERE id='".$row["id"]."'");
|
||
|
|
//mail("leprakhauns@gmail.com", "Video conversion done 2", $row["id"]);
|
||
|
|
$directory="./uploads_user/8000/7653/";;
|
||
|
|
|
||
|
|
|
||
|
|
$file = $getID3->analyze($directory."testconversion.mp4");
|
||
|
|
|
||
|
|
//var_dump($file);
|
||
|
|
if($file['video']['resolution_x']>1920)
|
||
|
|
{
|
||
|
|
$width=1920;
|
||
|
|
}
|
||
|
|
else{ $width=$file['video']['resolution_x'];}
|
||
|
|
if($file['video']['resolution_y']>1920)
|
||
|
|
{
|
||
|
|
$width=1080;
|
||
|
|
}
|
||
|
|
if($width%2!=0){$width=$width-1;}
|
||
|
|
//echo $width;
|
||
|
|
|
||
|
|
|
||
|
|
$duration=$file['playtime_seconds'];
|
||
|
|
$min_duration = 1;
|
||
|
|
echo time()."<br>";
|
||
|
|
|
||
|
|
if(1==2)
|
||
|
|
{
|
||
|
|
|
||
|
|
//$user_info = $database->database_fetch_assoc($database->database_query("SELECT id FROM bateworldcom_zips.bator_training WHERE id='".htmlspecialchars(strip_tags($row["id"]))."' LIMIT 1"));
|
||
|
|
|
||
|
|
//$database->database_query("UPDATE bateworldcom_zips.bator_training SET is_converted='-1' WHERE id='".htmlspecialchars(strip_tags($row["id"]))."'");
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// VIDEO WAS ENCODED SUCCESSFULLY, UPDATE DATABASE
|
||
|
|
else
|
||
|
|
{
|
||
|
|
echo time()."<br>";
|
||
|
|
if(!file_exists($directory."testconversion2.mp4")){
|
||
|
|
|
||
|
|
//$dir = opendir('uploads_video/encoding/queue/'); # This is the directory it will count from
|
||
|
|
$i = 0; # Integer starts at 0 before counting
|
||
|
|
|
||
|
|
echo time()."<br>";
|
||
|
|
//$database->database_query("UPDATE bateworldcom_zips.bator_training SET is_converted='2', video_duration_in_sec='".$duration."' WHERE id='".$row["id"]."'");
|
||
|
|
// /usr/local/bin/ffmpeg -i testconversion.mp4 -f null /dev/null 2>&1
|
||
|
|
$a= exec("{$setting['setting_video_ffmpeg_path']} -i ".$directory."testconversion.mp4 -f null /dev/null 2>&1", $o, $t);
|
||
|
|
//echo $o[30];
|
||
|
|
$o=implode("//", $o);
|
||
|
|
$o=str_replace(" ", "",$o);
|
||
|
|
$o=explode("rotate:",$o);
|
||
|
|
|
||
|
|
if($o[1]!=""){
|
||
|
|
|
||
|
|
$t=explode("//", $o[1]);
|
||
|
|
$rotate=$t[0];
|
||
|
|
if($rotate==180)
|
||
|
|
{
|
||
|
|
$vf='-vf "vflip,hflip"';
|
||
|
|
}
|
||
|
|
else{$vf="";}
|
||
|
|
}
|
||
|
|
else{$rotate="";}
|
||
|
|
|
||
|
|
//echo "touch uploads_video/encoding/queue/".$row["id"];exit;
|
||
|
|
//-vf scale=320:-1
|
||
|
|
|
||
|
|
$output=shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory."testconversion.mp4 -threads 3 -vf scale=".$width.":-2 -f image2 -ss 4.00 -vframes 1 {$directory}"."testconversion_thumb.jpg 2>&1 \n");
|
||
|
|
//sleep(10);
|
||
|
|
|
||
|
|
//sleep(300);
|
||
|
|
|
||
|
|
//54038.original.mp4
|
||
|
|
///bin/nice /usr/local/bin/ffmpeg -i /home/bateworld/public_html/uploads_video/261000/260515/54038.original.mp4 -movflags faststart -vcodec h264 -acodec aac -strict -2 -vf scale=720:-1 /home/bateworld/public_html/uploads_video/261000/260515/abc123.mp4
|
||
|
|
// /bin/nice /usr/local/bin/ffmpeg -i testconversion.mp4 -movflags faststart -codec:v libx264 -preset fast -acodec aac -strict -2 -vf scale=1920:-2 testconversion1.mp4
|
||
|
|
shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory."testconversion.mp4 -threads 3 -movflags faststart -codec:v libx264 -preset fast -acodec aac -strict -2 -vf scale=".$width.":-2 ".$directory."testconversion2.mp4");
|
||
|
|
mail("leprakhauns@gmail.com", "Bator Training Ended", "Bator Training Ended");
|
||
|
|
//shell_exec("/bin/nice {$setting['setting_video_ffmpeg_path']} -i ".$directory.$row["rawfile"]." -threads 3 -y -vcodec libx264 -g 30 -vf scale=".$width.":-1 ".$directory.$row["id"].".mp4 2>&1 \n");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function club_dir($club_id = 0) {
|
||
|
|
|
||
|
|
if($club_id != 0 ) {
|
||
|
|
$group=new se_club("", $club_id);
|
||
|
|
//if($group->group_exists){
|
||
|
|
|
||
|
|
$subdir = $club_id+999-(($club_id-1)%1000);
|
||
|
|
$groupdir = "./uploads_club/{$subdir}/{$club_id}/";
|
||
|
|
}//}
|
||
|
|
return $groupdir;
|
||
|
|
|
||
|
|
}
|
||
|
|
function user_dir($user_id = 0) {
|
||
|
|
|
||
|
|
if($user_id != 0 ) {
|
||
|
|
//$group=new se_club("", $club_id);
|
||
|
|
//if($group->group_exists){
|
||
|
|
|
||
|
|
$subdir = $user_id+999-(($user_id-1)%1000);
|
||
|
|
$groupdir = "./uploads_user/{$subdir}/{$user_id}/";
|
||
|
|
}//}
|
||
|
|
return $groupdir;
|
||
|
|
|
||
|
|
}
|
||
|
|
?>
|