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

master
IYUU 5 years ago
parent bf65f7039d
commit 3b3289274b
  1. 14
      app/AutoReseed.php
  2. 1
      config/config.sample.php

@ -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);

@ -33,6 +33,7 @@ return array(
'host' => 'http://127.0.0.1:9091/transmission/rpc', // 警告!注意:transmission/rpc这段别动,你只需要修改 127.0.0.1:9091
'username' => '',
'password' => '',
#'move' => 0, // 0不移动,1移动并辅种,2移动仅辅种自身,3未定义,4未定义
),
# 结束
# 开始

Loading…
Cancel
Save