mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
takeupload.php check torrent exists or not
This commit is contained in:
@@ -27,9 +27,13 @@ try {
|
|||||||
} else {
|
} else {
|
||||||
$result = autoclean();
|
$result = autoclean();
|
||||||
}
|
}
|
||||||
do_log("[CLEANUP_CLI DONE!] $result");
|
$log = "[CLEANUP_CLI DONE!] $result";
|
||||||
|
do_log($log);
|
||||||
|
printProgress($log);
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
do_log("ERROR: " . $exception->getMessage());
|
$log = "ERROR: " . $exception->getMessage();
|
||||||
|
do_log($log);
|
||||||
|
printProgress($log);
|
||||||
throw new \RuntimeException($exception->getMessage());
|
throw new \RuntimeException($exception->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,6 +166,10 @@ unset ($dict['nodes']); // remove cached peers (Bitcomet & Azareus)
|
|||||||
|
|
||||||
$infohash = pack("H*", sha1(\Rhilip\Bencode\Bencode::encode($dict['info']))); // double up on the becoding solves the occassional misgenerated infohash
|
$infohash = pack("H*", sha1(\Rhilip\Bencode\Bencode::encode($dict['info']))); // double up on the becoding solves the occassional misgenerated infohash
|
||||||
|
|
||||||
|
if (\App\Models\Torrent::query()->where('info_hash', $infohash)->exists()) {
|
||||||
|
bark($lang_takeupload['std_torrent_existed']);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------- start: check upload authority ------------------//
|
// ------------- start: check upload authority ------------------//
|
||||||
$allowtorrents = user_can_upload("torrents");
|
$allowtorrents = user_can_upload("torrents");
|
||||||
$allowspecial = user_can_upload("music");
|
$allowspecial = user_can_upload("music");
|
||||||
|
|||||||
Reference in New Issue
Block a user