QUOTE (Maiku_Ando @ Jul 04 2015, 08:58 AM)I agree with you, its the very reason I'm still here and want to get FTV working again.
Anyway, a little update for everyone, Daft has given me access to the main server and its code, and said I can try to get it doing something else / updates from another location such as matv's source.
The bad news is I've been ill, and still am at the moment, and not really been able to do much other than look around, and note how complex the code is, although I can kinda see how parts of it are working. I haven't made any progress on actually writing anything for FTV yet, and one of the first jobs is to fix a problem with it, so I might have to actually break it a little more first to prevent the problem upsetting the server it runs on.
I wrote some code to retrieve new torrents from Nyaa, extract info from the torrent name so you can add it to a database. It won't work properly for 100% of the torrent names since there isn't really a standard on how to name torrents, but with the names horriblesubs uses it works pretty good
CODE function load_XML($url)
{
$XML = simplexml_load_file($url);
if(count(libxml_get_errors()) > 0)
{
return false;
}
else
{
return $XML;
}
}
CODE <?php
function getAnimeInfo($str)
{
$anime = array();
$anime['TN'] = (string)$str; //Turn object into a string for a cleaner array (removing SimpleXMLElement Object)
$str = str_replace(array('(', ')', '_', '.mkv', '.mp4'), array('[', ']', ' ', '', ''), $str);
preg_match_all('/\[([^\]]+)\]/', $str, $arr);
if(count($arr) != 0)
{
$str = str_replace($arr[0], '', $str);
$anime['T'] = $arr[1];
if(preg_match('/[^A-Za-z]/', $arr[0][0]))
{
$anime['FG'] = $arr[1][0];
}
}
if(in_array('ova', explode(' ', strtolower($str))))
{
$str = ucwords(implode(' ', array_replace(explode(' ', strtolower($str)), array(array_search('ova', explode(' ', strtolower($str))) => ''))));
$anime['ova'] = 'true';
}
$anime['CTN'] = trim($str);
$arr = array_map('trim', explode('-', $anime['CTN']));
switch(count($arr))
{
case 1:
$anime['C'] = 1;
$arr = array_map('trim', explode(' ', $anime['CTN']));
$anime['episode'] = array_pop($arr);
if(!is_numeric($anime['episode']))
{
unset($anime['episode']);
}
$anime['name'] = implode(' ', $arr);
break;
case 2:
$anime['C'] = 2;
$anime['name'] = $arr[0];
if(is_numeric($arr[1]))
{
$anime['episode'] = intval($arr[1]);
}
break;
default:
$anime['C'] = 3;
$anime['episode'] = array_pop($arr);
if(!is_numeric($anime['episode']))
{
unset($anime['episode']);
}
$anime['name'] = implode(' - ', $arr);
}
return $anime;
}
//print_r(getAnimeInfo('[HorribleSubs] Shounen Hollywood - 2 - 11 ova[1080p].mkv'));
?>
Use it if you want, or if you are interested I can work out a better script