mirror of
https://gitee.com/ledc/IYUUAutoReseed
synced 2025-08-25 15:34:52 +00:00
Compare commits
2 Commits
v0.1.0-202
...
v0.1.1
Author | SHA1 | Date | |
---|---|---|---|
|
64523cc05d | ||
|
d7485be259 |
@@ -147,32 +147,52 @@ class Rpc
|
|||||||
case 1: //负载均衡模式
|
case 1: //负载均衡模式
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$rpcKey = self::$RPC_Key;
|
$is_url = false;
|
||||||
$type = self::$links[$rpcKey]['type'];
|
if( (strpos($torrent,'http://')===0) || (strpos($torrent,'https://')===0) || (strpos($torrent,'magnet:?xt=urn:btih:')===0) ){
|
||||||
echo '选中:负载均衡'.$rpcKey."\n";
|
$is_url = true;
|
||||||
if( (strpos($torrent,'http://')===0) || (strpos($torrent,'https://')===0) ){
|
|
||||||
echo 'add';
|
|
||||||
$result = self::$links[$rpcKey]['rpc']->add( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子URL添加下载任务
|
|
||||||
}else{
|
|
||||||
echo 'add_metainfo';
|
|
||||||
$result = self::$links[$rpcKey]['rpc']->add_metainfo( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子文件添加下载任务
|
|
||||||
}
|
}
|
||||||
// 负载均衡
|
// 负载均衡
|
||||||
|
$rpcKey = self::$RPC_Key;
|
||||||
|
echo '选中:负载均衡'.$rpcKey."\n";
|
||||||
self::rpcSelect();
|
self::rpcSelect();
|
||||||
// 调试
|
// 调试
|
||||||
#p($result);
|
#p($result);
|
||||||
// 下载服务器类型 判断
|
// 下载服务器类型 判断
|
||||||
|
$type = self::$links[$rpcKey]['type'];
|
||||||
switch($type){
|
switch($type){
|
||||||
case 'transmission':
|
case 'transmission':
|
||||||
$id = $result->arguments->torrent_added->id;
|
if( $is_url ){
|
||||||
|
echo 'add';
|
||||||
|
$result = self::$links[$rpcKey]['rpc']->add( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子URL添加下载任务
|
||||||
|
}else{
|
||||||
|
echo 'add_metainfo';
|
||||||
|
$result = self::$links[$rpcKey]['rpc']->add_metainfo( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子文件添加下载任务
|
||||||
|
}
|
||||||
|
$id = $name = '';
|
||||||
|
if( isset($result->arguments->torrent_duplicate) ){
|
||||||
|
$id = $result->arguments->torrent_duplicate->id;
|
||||||
|
$name = $result->arguments->torrent_duplicate->name;
|
||||||
|
}elseif( isset($result->arguments->torrent_added) ){
|
||||||
|
$id = $result->arguments->torrent_added->id;
|
||||||
|
$name = $result->arguments->torrent_added->name;
|
||||||
|
}
|
||||||
if(!$id){
|
if(!$id){
|
||||||
print "-----RPC添加种子任务,失败 [{$result->result}] \n\n";
|
print "-----RPC添加种子任务,失败 [{$result->result}] \n\n";
|
||||||
}else{
|
}else{
|
||||||
print "********RPC添加下载任务成功 [{$result->result}] (id=$id) \n\n";
|
print "********RPC添加下载任务成功 [{$result->result}] (id=$id) \n\n";
|
||||||
|
// 新添加的任务,开始
|
||||||
|
self::$links[$rpcKey]['rpc']->start( $id );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'qBittorrent':
|
case 'qBittorrent':
|
||||||
|
if( $is_url ){
|
||||||
|
echo 'add';
|
||||||
|
$result = self::$links[$rpcKey]['rpc']->add( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子URL添加下载任务
|
||||||
|
}else{
|
||||||
|
echo 'add_metainfo';
|
||||||
|
$result = self::$links[$rpcKey]['rpc']->add_metainfo( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子文件添加下载任务
|
||||||
|
}
|
||||||
if ($result === 'Ok.') {
|
if ($result === 'Ok.') {
|
||||||
print "********RPC添加下载任务成功 [{$result}] \n\n";
|
print "********RPC添加下载任务成功 [{$result}] \n\n";
|
||||||
return true;
|
return true;
|
||||||
|
@@ -348,7 +348,6 @@ class iyuuAutoReseed
|
|||||||
// 发起请求
|
// 发起请求
|
||||||
echo "正在提交辅种信息…… \n";
|
echo "正在提交辅种信息…… \n";
|
||||||
$res = $curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray);
|
$res = $curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray);
|
||||||
|
|
||||||
$resArray = json_decode($res->response, true);
|
$resArray = json_decode($res->response, true);
|
||||||
// 写日志
|
// 写日志
|
||||||
if(true){
|
if(true){
|
||||||
@@ -441,7 +440,6 @@ class iyuuAutoReseed
|
|||||||
$_url = 'https://' .$sites[$sitesID]['base_url']. '/' . $_url;
|
$_url = 'https://' .$sites[$sitesID]['base_url']. '/' . $_url;
|
||||||
print "种子下载页:".$_url. "\n";
|
print "种子下载页:".$_url. "\n";
|
||||||
$url = download($_url, $cookie, $userAgent);
|
$url = download($_url, $cookie, $userAgent);
|
||||||
#$torrentArray = Bencode::decode($url);
|
|
||||||
break;
|
break;
|
||||||
case 'hdcity':
|
case 'hdcity':
|
||||||
if ( empty($configALL[$sites[$sitesID]['site']]['cookie']) ) {
|
if ( empty($configALL[$sites[$sitesID]['site']]['cookie']) ) {
|
||||||
@@ -453,6 +451,7 @@ class iyuuAutoReseed
|
|||||||
$userAgent = $configALL['default']['userAgent'];
|
$userAgent = $configALL['default']['userAgent'];
|
||||||
print "种子:".$_url. "\n";
|
print "种子:".$_url. "\n";
|
||||||
if ( isset($configALL[$sites[$sitesID]['site']]['cuhash']) ) {
|
if ( isset($configALL[$sites[$sitesID]['site']]['cuhash']) ) {
|
||||||
|
// 已获取cuhash
|
||||||
# code...
|
# code...
|
||||||
}else {
|
}else {
|
||||||
// 获取cuhash
|
// 获取cuhash
|
||||||
@@ -577,7 +576,8 @@ function filterStatus( $v ){
|
|||||||
* qBittorrent过滤函数,只保留正常做种
|
* qBittorrent过滤函数,只保留正常做种
|
||||||
*/
|
*/
|
||||||
function qbfilterStatus( $v ){
|
function qbfilterStatus( $v ){
|
||||||
if( isset($v['status']) && in_array($v['state'], array('uploading','stalledUP','pausedUP','queuedUP','checkingUP','forcedUP')) ){
|
if( isset($v['state']) && in_array($v['state'], array('uploading','stalledUP','pausedUP','queuedUP','checkingUP','forcedUP')) ){
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@@ -69,6 +69,10 @@
|
|||||||
|
|
||||||
答:为减轻服务器压力,推荐间隔3小时以上(太频繁的调用接口,可能被封禁)。
|
答:为减轻服务器压力,推荐间隔3小时以上(太频繁的调用接口,可能被封禁)。
|
||||||
|
|
||||||
|
#### 问:猫站的Tracker为啥是http,而不是https?
|
||||||
|
|
||||||
|
答:请退出登录,在登录时勾选下面两个SSL的选项,登录后复制cookie,重新配置。
|
||||||
|
|
||||||
#### 问:如何反馈问题?
|
#### 问:如何反馈问题?
|
||||||
|
|
||||||
答:1、点击链接加入群聊【IYUU自动辅种交流】:[https://jq.qq.com/?_wv=1027&k=5JOfOlM][1]
|
答:1、点击链接加入群聊【IYUU自动辅种交流】:[https://jq.qq.com/?_wv=1027&k=5JOfOlM][1]
|
||||||
|
Reference in New Issue
Block a user