优化代码结构

This commit is contained in:
iyuu.cn 2020-07-17 23:01:57 +08:00
parent b80a5b89cc
commit b2b9000a86
3 changed files with 6 additions and 9 deletions

View File

@ -22,8 +22,6 @@ class AutoReseed
private static $sites = []; private static $sites = [];
// 不辅种的站点 'pt','hdchina' // 不辅种的站点 'pt','hdchina'
private static $noReseed = []; private static $noReseed = [];
// 不转移的站点 'hdarea','hdbd'
private static $noMove = [];
// cookie检查 // cookie检查
private static $cookieCheck = ['hdchina','hdcity']; private static $cookieCheck = ['hdchina','hdcity'];
// 缓存路径 // 缓存路径
@ -37,7 +35,6 @@ class AutoReseed
'sites' => '/api/sites', 'sites' => '/api/sites',
'infohash'=> '/api/infohash', 'infohash'=> '/api/infohash',
'notify' => '/api/notify', 'notify' => '/api/notify',
'alike' => '/api/alike',
'hash' => '/api/hash', 'hash' => '/api/hash',
); );
// curl // curl
@ -78,12 +75,15 @@ class AutoReseed
self::$curl->setOpt(CURLOPT_SSL_VERIFYPEER, false); self::$curl->setOpt(CURLOPT_SSL_VERIFYPEER, false);
self::$curl->setOpt(CURLOPT_SSL_VERIFYHOST, 2); self::$curl->setOpt(CURLOPT_SSL_VERIFYHOST, 2);
// 合作站点自动鉴权绑定 // 合作站点鉴权绑定
Oauth::login(self::$apiUrl . self::$endpoints['login']); Oauth::login(self::$apiUrl . self::$endpoints['login']);
// 显示支持站点列表 // 显示支持站点列表
self::ShowTableSites(); self::ShowTableSites();
self::$clients = isset($configALL['default']['clients']) && $configALL['default']['clients'] ? $configALL['default']['clients'] : array(); self::$clients = isset($configALL['default']['clients']) && $configALL['default']['clients'] ? $configALL['default']['clients'] : array();
if (empty(self::$clients)){
die('全局客户端为空!');
}
// 递归删除上次历史记录 // 递归删除上次历史记录
IFile::rmdir(self::$cacheDir, true); IFile::rmdir(self::$cacheDir, true);
@ -127,9 +127,6 @@ class AutoReseed
if (isset($rs['msg']) && $rs['msg']) { if (isset($rs['msg']) && $rs['msg']) {
die($rs['msg'].PHP_EOL); die($rs['msg'].PHP_EOL);
} }
if (isset($rs['errmsg']) && $rs['errmsg']) {
die($rs['errmsg'].PHP_EOL);
}
die('远端服务器无响应,请稍后再试!!!'); die('远端服务器无响应,请稍后再试!!!');
} }
$data = []; $data = [];
@ -269,6 +266,7 @@ class AutoReseed
} }
self::reseed(); self::reseed();
self::wechatMessage(); self::wechatMessage();
exit(self::$ExitCode);
} }
/** /**
* IYUUAutoReseed辅种 * IYUUAutoReseed辅种

View File

@ -157,7 +157,7 @@ return array(
'url_replace' => array(), 'url_replace' => array(),
'url_join' => array( 'url_join' => array(
//'ipv6=1', // 种子Tracker的IP地址选择 可选ipv4ipv6 //'ipv6=1', // 种子Tracker的IP地址选择 可选ipv4ipv6
//'https=1', 'https=1',
), ),
), ),
// m-team // m-team

View File

@ -29,4 +29,3 @@ use IYUU\AutoReseed;
AutoReseed::init(); AutoReseed::init();
AutoReseed::call(); AutoReseed::call();
exit(0);