2020-12-26 01:42:23 +08:00
|
|
|
<?php
|
2021-01-13 19:32:26 +08:00
|
|
|
require_once("../include/bittorrent.php");
|
2020-12-26 01:42:23 +08:00
|
|
|
dbconn();
|
|
|
|
|
loggedinorreturn();
|
2022-08-20 19:11:28 +08:00
|
|
|
user_can('updateextinfo', true);
|
2021-01-06 01:31:21 +08:00
|
|
|
$id = intval($_GET["id"] ?? 0);
|
|
|
|
|
$type = intval($_GET["type"] ?? 0);
|
2021-01-18 00:41:35 +08:00
|
|
|
$siteid = $_GET["siteid"] ?? 0; // 1 for IMDb
|
2020-12-26 01:42:23 +08:00
|
|
|
|
2021-01-18 00:41:35 +08:00
|
|
|
if (!isset($id) || !$id || !is_numeric($id) || !isset($type) || !$type || !is_numeric($type) || !isset($siteid) || !$siteid)
|
2020-12-26 01:42:23 +08:00
|
|
|
die();
|
|
|
|
|
|
2022-04-14 00:52:28 +08:00
|
|
|
$r = sql_query("SELECT * from torrents WHERE id = " . sqlesc($id)) or sqlerr(__FILE__, __LINE__);
|
2020-12-26 01:42:23 +08:00
|
|
|
if(mysql_num_rows($r) != 1)
|
|
|
|
|
die();
|
|
|
|
|
|
|
|
|
|
$row = mysql_fetch_assoc($r);
|
|
|
|
|
|
|
|
|
|
switch ($siteid)
|
|
|
|
|
{
|
2022-04-14 00:52:28 +08:00
|
|
|
case 1 :
|
2020-12-26 01:42:23 +08:00
|
|
|
{
|
|
|
|
|
$imdb_id = parse_imdb_id($row["url"]);
|
|
|
|
|
if ($imdb_id)
|
|
|
|
|
{
|
|
|
|
|
$thenumbers = $imdb_id;
|
2021-01-18 19:45:33 +08:00
|
|
|
$imdb = new \Nexus\Imdb\Imdb();
|
2020-12-26 01:42:23 +08:00
|
|
|
set_cachetimestamp($id,"cache_stamp");
|
2021-01-19 00:55:34 +08:00
|
|
|
|
|
|
|
|
$imdb->purgeSingle($imdb_id);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$imdb->updateCache($imdb_id);
|
|
|
|
|
$Cache->delete_value('imdb_id_'.$thenumbers.'_movie_name');
|
|
|
|
|
$Cache->delete_value('imdb_id_'.$thenumbers.'_large', true);
|
|
|
|
|
$Cache->delete_value('imdb_id_'.$thenumbers.'_median', true);
|
|
|
|
|
$Cache->delete_value('imdb_id_'.$thenumbers.'_minor', true);
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
$log = $e->getMessage() . ", trace: " . $e->getTraceAsString();
|
|
|
|
|
do_log($log, 'error');
|
|
|
|
|
}
|
2022-04-14 00:52:28 +08:00
|
|
|
nexus_redirect(getSchemeAndHttpHost() . "/details.php?id=$id");
|
2020-12-26 01:42:23 +08:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-01-18 00:41:35 +08:00
|
|
|
case \Nexus\PTGen\PTGen::SITE_IMDB:
|
|
|
|
|
case \Nexus\PTGen\PTGen::SITE_DOUBAN:
|
|
|
|
|
case \Nexus\PTGen\PTGen::SITE_BANGUMI:
|
|
|
|
|
{
|
|
|
|
|
$ptGen = new \Nexus\PTGen\PTGen();
|
2021-01-19 00:55:34 +08:00
|
|
|
try {
|
2022-04-14 00:52:28 +08:00
|
|
|
$ptGen->updateTorrentPtGen($row, $siteid);
|
2021-01-19 00:55:34 +08:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
$log = $e->getMessage() . ", trace: " . $e->getTraceAsString();
|
|
|
|
|
do_log($log, 'error');
|
|
|
|
|
}
|
2022-04-14 00:52:28 +08:00
|
|
|
nexus_redirect(getSchemeAndHttpHost() . "/details.php?id=$id");
|
2021-01-18 00:41:35 +08:00
|
|
|
break;
|
|
|
|
|
}
|
2020-12-26 01:42:23 +08:00
|
|
|
default :
|
|
|
|
|
{
|
|
|
|
|
die("Error!");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|