完善转移功能:当启用转移功能时,可以设置是否辅种被转移客户端。

This commit is contained in:
IYUU
2020-01-30 11:32:59 +08:00
parent bf65f7039d
commit 3b3289274b
2 changed files with 12 additions and 3 deletions

View File

@ -194,7 +194,7 @@ class AutoReseed
$client = new qBittorrent($v['host'], $v['username'], $v['password']);
break;
default:
echo '[ERROR] '.$v['type'];
echo '[Links ERROR] '.$v['type'];
exit(1);
break;
}
@ -205,10 +205,10 @@ class AutoReseed
print $v['type'].''.$v['host']." Rpc连接 [{$result}] \n";
// 检查是否转移种子的做种客户端?
if (isset($v['move']) && $v['move'] && is_null(self::$move)) {
self::$move = array($k,$v['type']);
self::$move = array($k,$v['move']);
}
} catch (\Exception $e) {
echo '[ERROR] ' . $e->getMessage() . PHP_EOL;
echo '[Links ERROR] ' . $e->getMessage() . PHP_EOL;
exit(1);
}
}
@ -416,6 +416,14 @@ class AutoReseed
public static function reseed($hashArray = array()){
global $configALL;
$sites = array();
// 前置过滤
if ( self::$move!==null && self::$move[1]===2 ) {
foreach ($hashArray['hash'] as $key => $json) {
if ($key!==self::$move[0]) {
$hashArray['hash'][$key] = '[]';
}
}
}
// 发起请求
echo "正在提交辅种信息…… \n";
$res = self::$curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray);