File: //home/httpd/mech_ftp/baretube.com/admin/cli/checkForMissingVideoFiles.php
<?
//this script deletes local copies of hotlinked videos.
require("../../mb.php");
$result = mysqli_query($dbconn,"SELECT filename,record_num FROM content WHERE embed = '' AND hotlinked = '' AND plug_url = ''");
while($row = mysqli_fetch_assoc($result)) {
$first = $row['filename'][0];
$second = $row['filename'][1];
$third = $row['filename'][2];
$forth = $row['filename'][3];
$fifth = $row['filename'][4];
$subdir = $first.'/'.$second.'/'.$third.'/'.$forth.'/'.$fifth;
$filename = "$basepath/media/videos/$subdir/$row[filename]";
if(!file_exists($filename)) {
echo str_replace($basepath."/","",$filename)."\r\n";
}
}
?>