Compare commits

...

15 Commits

Author SHA1 Message Date
iyuu.cn
7d638eba40 新增hdhome流控参数 2020-07-19 17:20:27 +08:00
iyuu.cn
c35c23583c 新增Ourbits、SSD、hdchina、hdsky、moecat、pt等站点的流控规则 2020-07-18 14:34:07 +08:00
iyuu.cn
b2b9000a86 优化代码结构 2020-07-17 23:02:21 +08:00
iyuu.cn
b80a5b89cc 更新Readme.md 2020-07-17 20:39:45 +08:00
iyuu.cn
c2e5b4d00b 新增移动做种微信报告 2020-07-17 19:55:53 +08:00
iyuu.cn
207320ede7 fix 2020-07-16 20:59:41 +08:00
iyuu.cn
6e1653fc1e fix 2020-07-14 16:44:28 +08:00
iyuu.cn
32ec80d552 提高对旧配置的兼容性 2020-07-14 02:13:20 +08:00
iyuu.cn
2b989f9e0e 新增瓷器、城市cookie过期微信通知 2020-07-13 10:19:36 +08:00
iyuu.cn
ff16781da9 fix 2020-07-13 08:47:00 +08:00
iyuu.cn
6a01b492ce 更新公告栏 2020-07-13 07:58:39 +08:00
iyuu.cn
de41bc0131 1.优化App.Api.Sites接口带版本号请求;2.新增异步间隔流控算法:各站独立、执行时间最优;3.config.sample.php各站点新增url_replace、url_join、limitRule参数。 2020-07-13 07:32:15 +08:00
iyuu.cn
6b83e9081b fix:优化代码 2020-07-12 21:29:41 +08:00
iyuu.cn
87f06ec5c4 接口域名部署SSL证书,支持双协议http/https。如:https://api.iyuu.cn 2020-07-12 19:39:19 +08:00
iyuu.cn
8a051d4d1f fix:优化转移做种时过滤器、选择器提示顺序。 2020-07-11 20:39:09 +08:00
12 changed files with 330 additions and 93 deletions

View File

@@ -1,17 +1,19 @@
<?php
namespace IYUU;
use Curl\Curl;
use IYUU\Client\AbstractClient;
use IYUU\Library\IFile;
use IYUU\Library\Oauth;
use IYUU\Library\Table;
/**
* IYUUAutoReseed自动辅种类
*/
class AutoReseed
{
// 版本号
const VER = '1.9.0';
const VER = '1.9.5';
// RPC连接
private static $links = [];
// 客户端配置
@@ -20,8 +22,6 @@ class AutoReseed
private static $sites = [];
// 不辅种的站点 'pt','hdchina'
private static $noReseed = [];
// 不转移的站点 'hdarea','hdbd'
private static $noMove = [];
// cookie检查
private static $cookieCheck = ['hdchina','hdcity'];
// 缓存路径
@@ -35,7 +35,6 @@ class AutoReseed
'sites' => '/api/sites',
'infohash'=> '/api/infohash',
'notify' => '/api/notify',
'alike' => '/api/alike',
'hash' => '/api/hash',
);
// curl
@@ -54,6 +53,8 @@ class AutoReseed
'reseedRepeat' => 0, // 重复:客户端已做种
'reseedSkip' => 0, // 跳过因未设置passkey而跳过
'reseedPass' => 0, // 忽略:因上次成功添加、存在缓存,而跳过
'MoveSuccess' => 0, // 移动成功
'MoveError' => 0, // 移动失败
);
// 错误通知消息体
private static $errNotify = array(
@@ -74,12 +75,15 @@ class AutoReseed
self::$curl->setOpt(CURLOPT_SSL_VERIFYPEER, false);
self::$curl->setOpt(CURLOPT_SSL_VERIFYHOST, 2);
// 合作站点自动鉴权绑定
// 合作站点鉴权绑定
Oauth::login(self::$apiUrl . self::$endpoints['login']);
// 显示支持站点列表
self::ShowTableSites();
self::$clients = isset($configALL['default']['clients']) && $configALL['default']['clients'] ? $configALL['default']['clients'] : array();
if (empty(self::$clients)){
die('全局客户端为空!');
}
// 递归删除上次历史记录
IFile::rmdir(self::$cacheDir, true);
@@ -106,7 +110,7 @@ class AutoReseed
foreach ($list as $value) {
echo $value.PHP_EOL;
}
$res = self::$curl->get(self::$apiUrl.self::$endpoints['sites'].'?sign='.Oauth::getSign());
$res = self::$curl->get(self::$apiUrl.self::$endpoints['sites'].'?sign='.Oauth::getSign().'&version='.self::VER);
$rs = json_decode($res->response, true);
$sites = isset($rs['data']['sites']) && $rs['data']['sites'] ? $rs['data']['sites'] : false;
// 数据写入本地
@@ -123,9 +127,6 @@ class AutoReseed
if (isset($rs['msg']) && $rs['msg']) {
die($rs['msg'].PHP_EOL);
}
if (isset($rs['errmsg']) && $rs['errmsg']) {
die($rs['errmsg'].PHP_EOL);
}
die('远端服务器无响应,请稍后再试!!!');
}
$data = [];
@@ -216,8 +217,6 @@ class AutoReseed
$errmsg = isset($result['result']) ? $result['result'] : '未知错误,请稍后重试!';
if (strpos($errmsg, 'http error 404: Not Found') !== false) {
self::sendNotify('404');
} elseif (strpos($errmsg, 'http error 403: Forbidden') !== false) {
self::sendNotify('403');
}
print "-----RPC添加种子任务失败 [{$errmsg}]" . PHP_EOL.PHP_EOL;
}
@@ -267,6 +266,7 @@ class AutoReseed
}
self::reseed();
self::wechatMessage();
exit(self::$ExitCode);
}
/**
* IYUUAutoReseed辅种
@@ -277,7 +277,7 @@ class AutoReseed
// 支持站点数量
self::$wechatMsg['sitesCount'] = count(self::$sites);
$sites = self::$sites;
// 客户端循环辅种 开始
// 遍历客户端 开始
foreach (self::$links as $k => $v) {
if (empty($v)) {
echo "clients_".$k." 用户名或密码未配置,已跳过".PHP_EOL.PHP_EOL;
@@ -331,13 +331,11 @@ class AutoReseed
echo '-----辅种失败,原因:' .$errmsg.PHP_EOL.PHP_EOL;
continue;
}
// 当前客户端可辅种数据
// 遍历当前客户端可辅种数据
foreach ($reseed as $info_hash => $vv) {
// 当前种子哈希对应的目录
$downloadDir = $infohash_Dir[$info_hash];
foreach ($vv['torrent'] as $id => $value) {
$_url = $url = '';
$download_page = $details_url = '';
// 匹配的辅种数据累加
self::$wechatMsg['reseedCount']++;
// 站点id
@@ -355,13 +353,15 @@ class AutoReseed
self::setNotify($siteName, $sid, $torrent_id);
// 页面规则
$download_page = str_replace('{}', $torrent_id, $sites[$sid]['download_page']);
$_url = 'https://' .$sites[$sid]['base_url']. '/' .$download_page;
// 协议
$protocol = $sites[$sid]['is_https'] == 0 ? 'http://' : 'https://';
$_url = $protocol . $sites[$sid]['base_url']. '/' .$download_page;
/**
* 前置检测
*/
// passkey检测
if (empty($configALL[$siteName]['passkey'])) {
// 配置与passkey检测
if (empty($configALL[$siteName]) || empty($configALL[$siteName]['passkey'])) {
//echo '-------因当前' .$siteName. "站点未设置passkey已跳过".PHP_EOL.PHP_EOL;
self::$wechatMsg['reseedSkip']++;
continue;
@@ -406,22 +406,51 @@ class AutoReseed
wlog('clients_'.$k.PHP_EOL.$downloadDir.PHP_EOL.$_url.PHP_EOL.PHP_EOL, $siteName);
continue;
}
// 操作站点流控的配置
if (isset($configALL[$siteName]['limitRule']) && $configALL[$siteName]['limitRule']) {
$limitRule = $configALL[$siteName]['limitRule'];
if (isset($limitRule['count']) && isset($limitRule['sleep'])) {
if ($limitRule['count'] <= 0) {
echo '-------当前站点辅种数量已满足规则,保障账号安全已跳过:'.$_url.PHP_EOL.PHP_EOL;
self::$wechatMsg['reseedPass']++;
continue;
} else {
// 异步间隔流控算法:各站独立、执行时间最优
$lastTime = isset($limitRule['time']) ? $limitRule['time'] : 0; // 最近一次辅种成功的时间
if ($lastTime) {
$interval = time() - $lastTime; // 间隔时间
if ($interval < $limitRule['sleep']) {
$t = $limitRule['sleep'] - $interval + mt_rand(1, 5);
do {
echo microtime(true)." 为账号安全,辅种进程休眠 {$t} 秒后继续...".PHP_EOL;
sleep(1);
} while (--$t > 0);
}
}
}
} else {
echo '-------当前站点流控规则错误缺少count或sleep参数请重新配置'.$_url.PHP_EOL.PHP_EOL;
self::$wechatMsg['reseedPass']++;
continue;
}
}
/**
* 种子URL组合方式区分
*/
$url = self::getTorrentUrl($siteName, $_url);
$reseedPass = false;
$reseedPass = false; // 标志:跳过辅种
// 特殊站点:种子元数据推送给下载器
switch ($siteName) {
case 'hdchina':
$cookie = isset($configALL[$siteName]['cookie']) ? $configALL[$siteName]['cookie'] : '';
$cookie = $configALL[$siteName]['cookie'];
$userAgent = $configALL['default']['userAgent'];
// 拼接URL
$details_page = str_replace('{}', $value['torrent_id'], 'details.php?id={}&hit=1');
$details_url = 'https://' .$sites[$sid]['base_url']. '/' .$details_page;
$details_url = $protocol .$sites[$sid]['base_url']. '/' .$details_page;
print "种子详情页:".$details_url.PHP_EOL;
$details_html = download($details_url, $cookie, $userAgent);
if (empty($details_html)) {
ff($siteName. '站点cookie已过期请更新后重新辅种');
echo 'cookie已过期请更新后重新辅种已加入排除列表'.PHP_EOL;
$t = 30;
do {
@@ -429,30 +458,33 @@ class AutoReseed
sleep(1);
} while (--$t > 0);
$configALL[$siteName]['cookie'] = '';
// 标志:跳过辅种
$reseedPass = true;
break;
}
if (strpos($details_html, '没有该ID的种子') != false) {
echo '种子已被删除!'.PHP_EOL;
self::sendNotify('404');
// 标志:跳过辅种
$reseedPass = true;
break;
}
// 提取种子下载地址
$download_page = str_replace('{}', '', $sites[$sid]['download_page']);
$offset = strpos($details_html, $download_page);
$urlTemp = substr($details_html, $offset, 50);
// 种子地址
$_url = substr($urlTemp, 0, strpos($urlTemp, '">'));
if (empty($_url)) {
echo '未知错误未提取到种子URL请联系脚本作者'.PHP_EOL;
// 标志:跳过辅种
$offset = strpos($details_html, str_replace('{hash}', '', $sites[$sid]['download_page']));
if ($offset === false) {
ff($siteName. '站点cookie已过期请更新后重新辅种');
echo 'cookie已过期请更新后重新辅种'.PHP_EOL;
$configALL[$siteName]['cookie'] = '';
$reseedPass = true;
break;
}
$_url = 'https://' .$sites[$sid]['base_url']. '/' . $_url;
$urlTemp = substr($details_html, $offset, 50);
// 种子地址
$download_page = substr($urlTemp, 0, strpos($urlTemp, '">'));
if (empty($download_page)) {
echo '未知错误未提取到种子URL请联系脚本作者'.PHP_EOL;
$reseedPass = true;
break;
}
$_url = $protocol . $sites[$sid]['base_url']. '/' . $download_page;
print "种子下载页:".$_url.PHP_EOL;
$url = download($_url, $cookie, $userAgent);
#p($url);
@@ -466,7 +498,6 @@ class AutoReseed
} while (--$t > 0);
ff($siteName. '站点,辅种时触发第一次下载提示!');
self::$noReseed[] = 'hdchina';
// 标志:跳过辅种
$reseedPass = true;
}
if (strpos($url, '系统检测到过多的种子下载请求') != false) {
@@ -474,12 +505,11 @@ class AutoReseed
ff($siteName. '站点,辅种时触发人机验证!');
$configALL[$siteName]['limit'] = 1;
self::$noReseed[] = 'hdchina';
// 标志:跳过辅种
$reseedPass = true;
}
break;
case 'hdcity':
$cookie = isset($configALL[$siteName]['cookie']) ? $configALL[$siteName]['cookie'] : '';
$cookie = $configALL[$siteName]['cookie'];
$userAgent = $configALL['default']['userAgent'];
print "种子:".$_url.PHP_EOL;
if (isset($configALL[$siteName]['cuhash'])) {
@@ -487,14 +517,21 @@ class AutoReseed
# code...
} else {
// 获取cuhash
$html = download('https://' .$sites[$sid]['base_url']. '/pt', $cookie, $userAgent);
$html = download($protocol .$sites[$sid]['base_url']. '/pt', $cookie, $userAgent);
// 提取种子下载地址
$offset = strpos($html, 'cuhash=');
if ($offset === false) {
ff($siteName. '站点cookie已过期请更新后重新辅种');
echo 'cookie已过期请更新后重新辅种'.PHP_EOL;
$configALL[$siteName]['cookie'] = '';
$reseedPass = true;
break;
}
$len = strlen('cuhash=');
$cuhashTemp = substr($html, $offset+$len, 40);
$configALL[$siteName]['cuhash'] = substr($cuhashTemp, 0, strpos($cuhashTemp, '"'));
}
$url = $_url."&cuhash=". $configALL[$siteName]['cuhash'];
$url = str_replace('{cuhash}', $configALL[$siteName]['cuhash'], $_url);
// 城市下载种子时会302转向
$url = download($url, $cookie, $userAgent);
if (strpos($url, 'Non-exist torrent id!') != false) {
@@ -533,6 +570,14 @@ class AutoReseed
$log = 'clients_'.$k.PHP_EOL.$downloadDir.PHP_EOL.$url.PHP_EOL.PHP_EOL;
if ($ret) {
// 成功的种子
// 操作流控参数
if (isset($configALL[$siteName]['limitRule']) && $configALL[$siteName]['limitRule']) {
$limitRule = $configALL[$siteName]['limitRule'];
if ($limitRule['count']) {
$configALL[$siteName]['limitRule']['count']--;
$configALL[$siteName]['limitRule']['time'] = time();
}
}
wlog($log, $value['info_hash'], self::$cacheHash);
wlog($log, 'reseedSuccess');
// 成功累加
@@ -556,6 +601,7 @@ class AutoReseed
private static function move()
{
global $configALL;
//遍历客户端
foreach (self::$links as $k => $v) {
if (self::$move[0] == $k) {
echo "clients_".$k."是目标转移客户端,避免冲突,已跳过!".PHP_EOL.PHP_EOL;
@@ -578,18 +624,16 @@ class AutoReseed
echo "clients_".$k." 全部转移成功,本次无需转移!".PHP_EOL.PHP_EOL;
continue;
}
// 循环转移做种客户端
//遍历当前客户端种子
foreach ($infohash_Dir as $info_hash => $downloadDir) {
// 做种实际路径与相对路径之间互转
echo '转换前:'.$downloadDir.PHP_EOL;
// 调用路径过滤
if (self::pathFilter($downloadDir)) {
echo $downloadDir;
continue;
}
// 调用路径转换
// 做种实际路径与相对路径之间互转
echo '转换前:'.$downloadDir.PHP_EOL;
$downloadDir = self::pathReplace($downloadDir);
echo '转换后:'.$downloadDir.PHP_EOL;
echo '转换后:'.$downloadDir.PHP_EOL;
if (is_null($downloadDir)) {
echo 'IYUU自动转移做种客户端--使用教程 https://www.iyuu.cn/archives/351/'.PHP_EOL;
die("全局配置的move数组内路径转换参数配置错误请重新配置".PHP_EOL);
@@ -658,9 +702,11 @@ class AutoReseed
// 转移成功的种子以infohash为文件名写入缓存
wlog($log, $info_hash, self::$cacheMove);
wlog($log, 'MoveSuccess'.$k);
self::$wechatMsg['MoveSuccess']++;
} else {
// 失败的种子
wlog($log, 'MoveError'.$k);
self::$wechatMsg['MoveError']++;
}
}
}
@@ -686,7 +732,7 @@ class AutoReseed
global $configALL;
$type = $configALL['default']['move']['type'];
$pathArray = $configALL['default']['move']['path'];
$path = rtrim($path, DIRECTORY_SEPARATOR); // 提高Windows转移兼容性
$path = rtrim($path, DIRECTORY_SEPARATOR); // 提高Windows转移兼容性
switch ($type) {
case 1: // 减
foreach ($pathArray as $key => $val) {
@@ -723,13 +769,12 @@ class AutoReseed
{
global $configALL;
$path = rtrim($path, DIRECTORY_SEPARATOR); // 提高Windows转移兼容性
// 转移过滤器、选择器 David/2020年7月11日
// 转移过滤器、选择器 David/2020年7月11日
$path_filter = isset($configALL['default']['move']['path_filter']) && !empty($configALL['default']['move']['path_filter']) ? $configALL['default']['move']['path_filter'] : null;
$path_selector = isset($configALL['default']['move']['path_selector']) && !empty($configALL['default']['move']['path_selector']) ? $configALL['default']['move']['path_selector'] : null;
if (\is_null($path_filter) && \is_null($path_selector)) {
return false;
}
elseif (\is_null($path_filter)) {
} elseif (\is_null($path_filter)) {
//选择器
if (\is_array($path_selector)) {
foreach ($path_selector as $pathName) {
@@ -737,16 +782,15 @@ class AutoReseed
return false;
}
}
echo '已跳过转移选择器未匹配到:'.$path.PHP_EOL;
echo '已跳过转移选择器未匹配到:'.$path.PHP_EOL;
return true;
}
}
elseif (\is_null($path_selector)) {
} elseif (\is_null($path_selector)) {
//过滤器
if (\is_array($path_filter)) {
foreach ($path_filter as $pathName) {
if (strpos($path, $pathName)===0) { // 没用$path == $key判断是为了提高兼容性
echo '已跳过转移过滤器匹配到:'.$path.PHP_EOL;
echo '已跳过转移过滤器匹配到:'.$path.PHP_EOL;
return true;
}
}
@@ -758,7 +802,7 @@ class AutoReseed
//先过滤器
foreach ($path_filter as $pathName) {
if (strpos($path, $pathName)===0) {
echo '已跳过转移过滤器匹配到:'.$path.PHP_EOL;
echo '已跳过转移过滤器匹配到:'.$path.PHP_EOL;
return true;
}
}
@@ -768,42 +812,44 @@ class AutoReseed
return false;
}
}
echo '已跳过转移选择器未匹配到:'.$path.PHP_EOL;
echo '已跳过转移选择器未匹配到:'.$path.PHP_EOL;
return true;
}
}
return false;
}
/**
* 获取站点种子的URL
* @param string $site
* @param string $url
* @return string
*/
private static function getTorrentUrl($site = '', $_url = '')
private static function getTorrentUrl($site = '', $url = '')
{
global $configALL;
switch ($site) {
case 'ttg':
$url = $_url."/". $configALL[$site]['passkey'];
break;
case 'm-team':
case 'moecat':
case 'hdbd':
$ip_type = '';
if (isset($configALL[$site]['ip_type'])) {
$ip_type = $configALL[$site]['ip_type'] == 'ipv6' ? '&ipv6=1' : '';
// 兼容旧配置
if (isset($configALL[$site]['passkey']) && $configALL[$site]['passkey']) {
if (empty($configALL[$site]['url_replace'])) {
$configALL[$site]['url_replace'] = array('{passkey}' => $configALL[$site]['passkey']);
}
if (empty($configALL[$site]['url_join'])) {
$configALL[$site]['url_join'] = array();
if (in_array($site, array('m-team','mocat','hdbd'))) {
if (isset($configALL[$site]['ip_type'])) {
$configALL[$site]['url_join'][] = $configALL[$site]['ip_type'].'=1';
}
$configALL[$site]['url_join'][] = 'https=1';
}
$url = $_url."&passkey=". $configALL[$site]['passkey'] . $ip_type. "&https=1";
break;
case 'dicmusic':
$_url = str_replace('{torrent_pass}', $configALL[$site]['passkey'], $_url);
$url = str_replace('{authkey}', $configALL[$site]['authkey'], $_url);
break;
default:
if (strpos($_url,'{passkey}') !== false) {
$url = str_replace('{passkey}', $configALL[$site]['passkey'], $_url);
} else {
$url = $_url."&passkey=". $configALL[$site]['passkey'];
}
break;
}
}
// 通用操作:替换
if (isset($configALL[$site]['url_replace']) && $configALL[$site]['url_replace']) {
$url = strtr($url, $configALL[$site]['url_replace']);
}
// 通用操作:拼接
if (isset($configALL[$site]['url_join']) && $configALL[$site]['url_join']) {
$url = $url.(strpos($url, '?') === false ? '?' : '&').implode('&', $configALL[$site]['url_join']);
}
return $url;
}
@@ -817,14 +863,21 @@ class AutoReseed
$desp = '### 版本号:'. self::VER . $br;
$desp .= '**支持站点:'.self::$wechatMsg['sitesCount']. '** [当前支持自动辅种的站点数量]' .$br;
$desp .= '**总做种:'.self::$wechatMsg['hashCount'] . '** [客户端做种的hash总数]' .$br;
$desp .= '**返回数据:'.self::$wechatMsg['reseedCount']. '** [服务器返回的可辅种数据]' .$br;
$desp .= '**成功:'.self::$wechatMsg['reseedSuccess']. '** [辅种成功,会把hash加入缓存]' .$br;
$desp .= '**返回数据:'.self::$wechatMsg['reseedCount']. '** [服务器返回的可辅种数据]' .$br;
$desp .= '**成功:'.self::$wechatMsg['reseedSuccess']. '** [会把hash加入辅种缓存]' .$br;
$desp .= '**失败:'.self::$wechatMsg['reseedError']. '** [种子下载失败或网络超时引起]' .$br;
$desp .= '**重复:'.self::$wechatMsg['reseedRepeat']. '** [客户端已做种]' .$br;
$desp .= '**跳过:'.self::$wechatMsg['reseedSkip']. '** [未设置passkey]' .$br;
$desp .= '**忽略:'.self::$wechatMsg['reseedPass']. '** [成功添加存在缓存]' .$br;
$desp .= $br.'**如需重新辅种,请删除 ./torrent/cachehash 内的所有辅种缓存。**'.$br;
$desp .= '*此消息将在3天后过期*。';
$desp .= '**如需重新辅种,请删除 ./torrent/cachehash 辅种缓存。**'.$br;
// 移动做种
if (self::$wechatMsg['MoveSuccess'] || self::$wechatMsg['MoveError']) {
$desp .= $br.'----------'.$br;
$desp .= '**移动成功:'.self::$wechatMsg['MoveSuccess']. '** [会把hash加入移动缓存]' .$br;
$desp .= '**移动失败:'.self::$wechatMsg['MoveError']. '** [解决错误提示,可以重试]' .$br;
$desp .= '**如需重新移动,请删除 ./torrent/cachemove 移动缓存。**'.$br;
}
$desp .= $br.'*此消息将在3天后过期*。';
return ff($text, $desp);
}
/**

View File

@@ -1,5 +1,6 @@
<?php
namespace IYUU\Library;
/**
* @class IFile
* @brief IFile 文件处理类

View File

@@ -1,6 +1,8 @@
<?php
namespace IYUU\Library;
use Curl\Curl;
/**
* IYUU用户注册、认证
*/

View File

@@ -1,5 +1,6 @@
<?php
namespace IYUU\Library;
/**
* Created by PhpStorm.
* User: 大卫

View File

@@ -1,6 +1,7 @@
<?php
use IYUU\Library\IFile;
use IYUU\Library\Table;
/**
* 调试函数
* @param $data

View File

@@ -103,6 +103,15 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
'id' => 0, // 用户ID(不是用户名)
'url_replace' => array(),
'url_join' => array(
//'ipv6=1', // 种子Tracker的IP地址选择 可选ipv4ipv6
//'https=1',
),
'limitRule' => array(
'count' => 20, // 每次辅种20个
'sleep' => 15, // 最少休眠15秒
),
'workingMode' => 0,
'watch' => '/root/downloads',
'filter' => array(
@@ -111,6 +120,7 @@ return array(
'max' => '280GB',
),
),
),
// hddolby
'hddolby' => array(
@@ -119,6 +129,8 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
'id' => 0, // 用户ID(不是用户名)
'url_replace' => array(),
'url_join' => array(),
),
// hdhome
'hdhome' => array(
@@ -127,6 +139,12 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
'id' => 0, // 用户ID(不是用户名)
'url_replace' => array(),
'url_join' => array(),
'limitRule' => array(
'count' => 20, // 每次辅种20个
'sleep' => 5, // 最少休眠5秒
),
),
// PTHome
'pthome' => array(
@@ -135,6 +153,8 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
'id' => 0, // 用户ID(不是用户名)
'url_replace' => array(),
'url_join' => array(),
),
// MoeCat
'moecat' => array(
@@ -143,8 +163,15 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
'id' => 0, // 用户ID(不是用户名)
// 种子Tracker的IP地址选择 可选ipv4ipv6
'ip_type' => 'ipv4',
'url_replace' => array(),
'url_join' => array(
//'ipv6=1', // 种子Tracker的IP地址选择 可选ipv4ipv6
'https=1',
),
'limitRule' => array(
'count' => 20, // 每次辅种20个
'sleep' => 15, // 最少休眠15秒
),
),
// m-team
'm-team' => array(
@@ -152,8 +179,11 @@ return array(
'cookie' => 'tp=',
// 15.m-team的passkey 【必须配置】
'passkey' => '',
// 种子Tracker的IP地址选择 可选ipv4ipv6
'ip_type' => 'ipv4',
'url_replace' => array(),
'url_join' => array(
//'ipv6=1', // 种子Tracker的IP地址选择 可选ipv4ipv6
'https=1',
),
'clients' => array(
array(
'type' => 'transmission', // 支持transmission、qBittorrent
@@ -178,6 +208,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
'workingMode' => 1,
'watch' => '',
'filter' => array(
@@ -193,6 +225,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// tjupt
'tjupt' => array(
@@ -200,6 +234,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// btschool
'btschool' => array(
@@ -207,6 +243,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// HDSky
'hdsky' => array(
@@ -214,6 +252,12 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'limitRule' => array(
'count' => 50, // 每次辅种50个
'sleep' => 15, // 最少休眠15秒
),
'url_replace' => array(),
'url_join' => array(),
),
// TorrentCCF
'torrentccf' => array(
@@ -221,6 +265,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// PTMSG
'ptmsg' => array(
@@ -228,6 +274,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// totheglory
'ttg' => array(
@@ -236,6 +284,8 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
// 如果需要rss订阅必须配置
'url_replace' => array(),
'url_join' => array(),
'rss' => '',
),
// nanyangpt
@@ -244,6 +294,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// springsunday.net
'ssd' => array(
@@ -251,6 +303,12 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
'limitRule' => array(
'count' => 20, // 每次辅种20个
'sleep' => 15, // 最少休眠15秒
),
),
// yingk
'yingk' => array(
@@ -258,6 +316,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// hdcity
'hdcity' => array(
@@ -265,6 +325,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种必须配置cuhash
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// 52pt.site
'52pt' => array(
@@ -272,6 +334,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// brobits
'brobits' => array(
@@ -279,6 +343,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// beitai
'beitai' => array(
@@ -286,6 +352,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// eastgame
'eastgame' => array(
@@ -293,6 +361,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// soulvoice
'soulvoice' => array(
@@ -300,6 +370,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// chdbits
'chdbits' => array(
@@ -307,6 +379,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// leaguehd
'leaguehd' => array(
@@ -314,6 +388,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// ptsbao
'ptsbao' => array(
@@ -321,6 +397,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// hdchina
'hdchina' => array(
@@ -328,6 +406,12 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
'limitRule' => array(
'count' => 10, // 每次辅种10个
'sleep' => 5, // 最少休眠15秒
),
),
// hdarea
'hdarea' => array(
@@ -335,6 +419,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// hdtime
'hdtime' => array(
@@ -342,6 +428,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// 1ptba
'1ptba' => array(
@@ -349,6 +437,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// hd4fans
'hd4fans' => array(
@@ -356,6 +446,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// hddisk.life
'hdbug' => array(
@@ -363,6 +455,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// opencd皇后
'opencd' => array(
@@ -370,6 +464,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// hdstreet
'hdstreet' => array(
@@ -377,6 +473,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// joyhd
'joyhd' => array(
@@ -384,6 +482,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// dmhy幼儿园
'dmhy' => array(
@@ -391,6 +491,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// hdu
'upxin' => array(
@@ -398,6 +500,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// oshen
'oshen' => array(
@@ -405,6 +509,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// discfan港知堂
'discfan' => array(
@@ -412,6 +518,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// hdzone
'hdzone' => array(
@@ -419,6 +527,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// nicept老师
'nicept' => array(
@@ -426,6 +536,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// hdbd伊甸园
'hdbd' => array(
@@ -433,6 +545,11 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(
//'ipv6=1', // 种子Tracker的IP地址选择 可选ipv4ipv6
//'https=1',
),
),
// byr北邮
'byr' => array(
@@ -440,6 +557,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// CCFBits
'ccfbits' => array(
@@ -447,6 +566,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// hdbits
'hdbits' => array(
@@ -454,6 +575,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// PTPBD
'ptpbd' => array(
@@ -461,6 +584,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// HD-T
'hd-torrents' => array(
@@ -468,6 +593,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// skyeysnow天雪
'skyeysnow' => array(
@@ -475,6 +602,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// pt.sjtu葡萄
'pt' => array(
@@ -482,6 +611,12 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
'limitRule' => array(
'count' => 20, // 每次辅种20个
'sleep' => 20, // 最少休眠20秒
),
),
// hdroute
'hdroute' => array(
@@ -489,6 +624,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// haidan
'haidan' => array(
@@ -496,6 +633,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// hdfans
'hdfans' => array(
@@ -503,6 +642,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'url_replace' => array(),
'url_join' => array(),
),
// 配置结束,后面的一行不能删除,必须保留!!!
);

View File

@@ -26,6 +26,6 @@
require_once __DIR__ . '/init.php';
echo '当前脚本路径:'.__FILE__.PHP_EOL;
use IYUU\AutoReseed;
AutoReseed::init();
AutoReseed::call();
exit(0);

View File

@@ -73,8 +73,12 @@ IYUU自动辅种工具英文名IYUUAutoReseed是一款PHP语言编
实时更新的接口文档http://api.iyuu.cn/docs.php
## 相关项目
#todo...
## 需求提交/错误反馈
- QQ群859882209[2000人.入门群]931954050[1000人.进阶群]
- 问答社区http://wenda.iyuu.cn
- 博客https://www.iyuu.cn/

View File

@@ -1,5 +1,38 @@
# 公告栏
### 2020年7月13日08:00:00
【更新提醒】v1.9.1
优化App.Api.Sites接口请求时携带版本号版本为空或低于v1.9.1会返回旧数据);
新增:异步间隔流控算法,适用所有站点;各站独立、执行时间最优;
【升级方法】
1.异步间隔流控使用方法参考v1.9.1版本的config.sample.php[第242-245行]把他复制到你想应用流控的站点配置项内解释count表示每次辅种的最大数量sleep表示当前站点每次下载种子最小间隔多少秒。
2.url_replace和url_join是为了最大化兼容未来各种类型站点提前准备的可以自定义URL
解释url_replace是替换下载链接时使用让下载链接支持替换任意参数。举例'url_replace'=>array('{passkey}'=>'123456789'), 下载链接https://pt.baidu.com/download.php?id={}&passkey={passkey}替换后变为https://pt.baidu.com/download.php?id={}&passkey=123456789
解释url_join是拼接下载链接是使用让下载链接支持任意自定义参数。举例
'url_join' => array('ipv6=1','https=1'), 下载链接https://pt.baidu.com/download.php?id={}&passkey=123456789拼接后变为https://pt.baidu.com/download.php?id={}&passkey=123456789&ipv6=1&https=1
### 2020年7月12日19:34:03
【新增功能】v1.9.0
转移过滤器、选择器;可以只转移指定路径的种子,也可以排除指定路径的种子,按需转移。
【升级方法】
1.主脚本可以通过git pull或覆盖更新
2.然后对照最新config.sample.php把59行60行手动加入到你的config.php对应位置。
【重要提醒】域名部署SSL证书接口域名支持双协议访问http/https如下
https://api.iyuu.cn
http://api.iyuu.cn
### 2020年4月10日17:43:50
针对多合作站点绑定的优化!

View File

@@ -1,5 +1,5 @@
## 支持用户验证的合作站点:`ourbits`,`hddolby`,`hdhome`,`pthome`
截止2020年3月15日13:25:30【文档更新有延迟最终以gitee、github为准】
## 支持用户验证的合作站点:`ourbits`,`hddolby`,`hdhome`,`pthome`,`moecat`
截止2020年7月17日20:30:53【文档更新有延迟最终以gitee、github为准】
----------

View File

@@ -85,9 +85,11 @@
#### 问:如何反馈问题?
1、点击链接加入群聊【IYUU自动辅种交流】[https://jq.qq.com/?_wv=1027&k=5JOfOlM][1]
1、QQ群859882209[2000人.入门群]931954050[1000人.进阶群]
2、QQ群859882209
2、问答社区http://wenda.iyuu.cn
3、issues https://gitee.com/ledc/IYUUAutoReseed/issues
3、博客https://www.iyuu.cn
4、issues https://gitee.com/ledc/IYUUAutoReseed/issues

View File

@@ -13,8 +13,7 @@
| Google身份验证器谷歌动态口令 | 开发中 | 2020年2月21日 | |
| 自动更新 | 开发中 | 2020年2月21日 | |
| WEB页面生成配置 | 开发中 | 2020年2月21日 | |
| 种子删除自动同步 | 开发中 | 2020年2月21日 | 2020年5月6日 |
| 种子删除自动同步 | 已完成 | 2020年2月21日 | 2020年5月6日 |
| 脚本docker容器化测试版 | 已完成 | 2020年2月21日 | 2020年2月21日 |
| 自动配置(简化配置) | 开发中 | 2020年4月10日 | |
| 浏览器插件 | 暂未开始 | | |
| 合集自动拆包辅种 | 暂未开始 | | |