修复因城市下载种子时302,导致下载器添加失败的bug

This commit is contained in:
iyuu.cn
2019-12-28 04:45:02 +08:00
parent b54695f084
commit fb74a22e88
2 changed files with 19 additions and 2 deletions

View File

@ -238,7 +238,11 @@ class iyuuAutoReseed
{
try
{
$result = self::$links[$rpcKey]['rpc']->add( $torrent, $save_path, $extra_options ); // 种子URL添加下载任务
if( (strpos($torrent,'http://')===0) || (strpos($torrent,'https://')===0) ){
$result = self::$links[$rpcKey]['rpc']->add( $torrent, $save_path, $extra_options ); // 种子URL添加下载任务
} else{
$result = self::$links[$rpcKey]['rpc']->add_metainfo( $torrent, $save_path, $extra_options ); // 种子元数据添加下载任务
}
// 调试
#p($result);
// 下载服务器类型 判断
@ -254,7 +258,9 @@ class iyuuAutoReseed
$name = $result->arguments->torrent_added->name;
}
print "********RPC添加下载任务成功 [{$result->result}] (id=$id) \n";
print "种子:".$torrent. "\n";
if( (strpos($torrent,'http://')===0) || (strpos($torrent,'https://')===0) ){
print "种子:".$torrent. "\n";
}
print "名字:".$name."\n\n";
return true;
}else{
@ -393,7 +399,12 @@ class iyuuAutoReseed
// case 'hdchina':
// break;
case 'hdcity':
print "种子:".$_url. "\n";
$url = $_url."&cuhash=". $configALL[$sites[$sitesID]['site']]['passkey'];
$cookie = isset($configALL[$sites[$sitesID]['site']]['cookie']) ? $configALL[$sites[$sitesID]['site']]['cookie'] : '';
$userAgent = $configALL['default']['userAgent'];
// 城市下载种子时会302转向
$url = download($url, $cookie, $userAgent);
break;
default:
$url = $_url."&passkey=". $configALL[$sites[$sitesID]['site']]['passkey'];

View File

@ -40,6 +40,12 @@
),
```
#### 问为何HDCITY站点配置了密钥自动辅种一直提示失败
安全设定里面的key密钥是上报Tracker专用下载种子的密钥是cuhash参数获取方法为打开种子列表在下载种子的图标上面点击"右键" - "复制链接地址",粘贴到别处后,仅复制`cuhash=`后面的字符串即可;
例如:`https://xxx.xxx/download?id=38982&cuhash=0b00000000000000000000000c9`,仅复制`0b00000000000000000000000c9`
#### 问:如何升级到最新版本?
从github或码云仓库下载最新的源码覆盖到本地即可。