mirror of
https://gitee.com/ledc/IYUUAutoReseed
synced 2025-06-13 04:08:57 +00:00
完善转移功能:当启用转移功能时,可以设置是否辅种被转移客户端。
This commit is contained in:
@ -194,7 +194,7 @@ class AutoReseed
|
|||||||
$client = new qBittorrent($v['host'], $v['username'], $v['password']);
|
$client = new qBittorrent($v['host'], $v['username'], $v['password']);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
echo '[ERROR] '.$v['type'];
|
echo '[Links ERROR] '.$v['type'];
|
||||||
exit(1);
|
exit(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -205,10 +205,10 @@ class AutoReseed
|
|||||||
print $v['type'].':'.$v['host']." Rpc连接 [{$result}] \n";
|
print $v['type'].':'.$v['host']." Rpc连接 [{$result}] \n";
|
||||||
// 检查是否转移种子的做种客户端?
|
// 检查是否转移种子的做种客户端?
|
||||||
if (isset($v['move']) && $v['move'] && is_null(self::$move)) {
|
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) {
|
} catch (\Exception $e) {
|
||||||
echo '[ERROR] ' . $e->getMessage() . PHP_EOL;
|
echo '[Links ERROR] ' . $e->getMessage() . PHP_EOL;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -416,6 +416,14 @@ class AutoReseed
|
|||||||
public static function reseed($hashArray = array()){
|
public static function reseed($hashArray = array()){
|
||||||
global $configALL;
|
global $configALL;
|
||||||
$sites = array();
|
$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";
|
echo "正在提交辅种信息…… \n";
|
||||||
$res = self::$curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray);
|
$res = self::$curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray);
|
||||||
|
@ -33,6 +33,7 @@ return array(
|
|||||||
'host' => 'http://127.0.0.1:9091/transmission/rpc', // 警告!注意:transmission/rpc这段别动,你只需要修改 127.0.0.1:9091
|
'host' => 'http://127.0.0.1:9091/transmission/rpc', // 警告!注意:transmission/rpc这段别动,你只需要修改 127.0.0.1:9091
|
||||||
'username' => '',
|
'username' => '',
|
||||||
'password' => '',
|
'password' => '',
|
||||||
|
#'move' => 0, // 0不移动,1移动并辅种,2移动仅辅种自身,3未定义,4未定义
|
||||||
),
|
),
|
||||||
# 结束
|
# 结束
|
||||||
# 开始
|
# 开始
|
||||||
|
Reference in New Issue
Block a user