Compare commits

...

20 Commits

Author SHA1 Message Date
iyuu.cn
fcb2384949 增加乱码解决方法 2020-01-22 09:37:21 +08:00
iyuu.cn
33b55d7598 新增更新历史信息 2020-01-22 08:50:58 +08:00
iyuu.cn
db8290fe89 新增RSS订阅新种命令 2020-01-22 08:50:35 +08:00
iyuu.cn
81083220c5 修正站点鉴权帮助文档 2020-01-22 08:50:13 +08:00
iyuu.cn
39cb00d648 新增常见问题 2020-01-22 08:49:40 +08:00
iyuu.cn
db9010cee7 新增排除文件。 2020-01-21 17:53:17 +08:00
iyuu.cn
ad6f798946 新增json支持的站点列表本地化 2020-01-21 11:00:46 +08:00
iyuu.cn
36d07a25db 新增在线查询支持站点表格显示 2020-01-21 02:18:51 +08:00
iyuu.cn
7c35291b15 新增Windows系统composer install安装依赖包命令 2020-01-21 01:17:57 +08:00
iyuu.cn
7d531a26c8 Transmission兼容支持https链接 2020-01-20 14:09:04 +08:00
iyuu.cn
385a122f02 更新捐赠名单 2020-01-19 12:56:45 +08:00
iyuu.cn
f75feeca44 更新数据清理 2020-01-19 12:35:41 +08:00
iyuu.cn
d8fc340691 修改hdbug站点示例配置信息 2020-01-18 23:11:31 +08:00
iyuu.cn
2345124ce0 更新数据 2020-01-18 21:25:31 +08:00
iyuu.cn
f9592c6b0d 新增IYUU入口文件 2020-01-18 20:13:21 +08:00
iyuu.cn
fd695e4209 更新数据清理时间 2020-01-18 12:16:56 +08:00
iyuu.cn
8ddb143485 新增wlog日志助手函数 2020-01-18 12:16:25 +08:00
iyuu.cn
ef2668ca54 完善各种日志的输出 2020-01-18 12:16:07 +08:00
iyuu.cn
51f3fa39bc 检查代码缩进规范 2020-01-18 10:27:27 +08:00
iyuu.cn
84b3f23c27 完善下载最新源码的教程 2020-01-17 21:35:36 +08:00
19 changed files with 900 additions and 314 deletions

1
.gitignore vendored
View File

@@ -6,3 +6,4 @@
/vendor
.idea
.php_cs.cache
/config/sites.json

View File

@@ -10,6 +10,7 @@ use IYUU\Client\qBittorrent\qBittorrent;
use IYUU\Client\Transmission\TransmissionRPC;
use IYUU\Library\IFile;
use IYUU\Library\Oauth;
use IYUU\Library\Table;
/**
* IYUUAutoReseed自动辅种类
@@ -89,6 +90,8 @@ class AutoReseed
*/
public static function init()
{
// 显示支持站点列表
self::ShowTableSites();
global $configALL;
self::$clients = isset($configALL['default']['clients']) && $configALL['default']['clients'] ? $configALL['default']['clients'] : array();
echo "程序正在初始化运行参数... \n";
@@ -103,6 +106,53 @@ class AutoReseed
Oauth::login(self::$apiUrl . self::$endpoints['login']);
}
/**
* 显示支持站点列表
*/
private static function ShowTableSites(){
$list[] = 'gitee 源码仓库https://gitee.com/ledc/IYUUAutoReseed';
$list[] = 'github源码仓库https://github.com/ledccn/IYUUAutoReseed';
$list[] = '教程https://gitee.com/ledc/IYUUAutoReseed/tree/master/wiki';
$list[] = "QQ群859882209 【IYUU自动辅种交流】 \n";
foreach ($list as $key => $value) {
echo $value.PHP_EOL;
}
// 发起请求
echo "正在连接IYUUAutoReseed服务器查询支持列表…… \n";
$curl = new Curl();
$curl->setOpt(CURLOPT_SSL_VERIFYPEER, false); // 禁止验证证书
$curl->setOpt(CURLOPT_SSL_VERIFYHOST, false); // 不检查证书
$res = $curl->post(self::$apiUrl);
$sites = json_decode($res->response, true);
// 数据写入本地
if (true) {
$json = array_column($sites, null, 'site');
ksort($json);
$json = json_encode($json, JSON_UNESCAPED_UNICODE);
$myfile = ROOT_PATH.DS.'config'.DS.'sites.json';
$file_pointer = @fopen($myfile,"w");
$worldsnum = @fwrite($file_pointer,$json);
@fclose($file_pointer);
}
$data = [];
$i = $j = $k = 0;
foreach($sites as $v)
{
// 控制多少列
if ($i > 4) {
$k++;
$i = 0;
}
$i++;
$j++;
$data[$k][] = $j.". ".$v['site'];
}
echo "IYUUAutoReseed自动辅种脚本目前支持以下站点".PHP_EOL;
//输出表格
$table = new Table();
$table->setRows($data);
echo($table->render());
}
/**
* 连接远端RPC服务器
*
@@ -355,29 +405,19 @@ class AutoReseed
$hashArray['sign'] = Oauth::getSign();
$hashArray['version'] = self::VER;
// 写请求日志
if (true) {
// 文件句柄
$resource = fopen(self::$cacheDir.'hashString.txt', "wb");
// 成功返回写入字节数失败返回false
$worldsnum = fwrite($resource, p($hashArray, false));
fclose($resource);
}
wlog($hashArray,'hashString');
// 发起请求
echo "正在提交辅种信息…… \n";
$res = $curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray);
$resArray = json_decode($res->response, true);
// 写返回日志
if(true){
// 文件句柄
$resource = fopen(self::$cacheDir.'reseed.txt', "wb");
// 成功返回写入字节数失败返回false
$worldsnum = fwrite($resource, p($resArray, false));
fclose($resource);
}
wlog($resArray,'reseed');
// 判断返回值
if ( isset($resArray['errmsg']) && ($resArray['errmsg'] == 'ok') ) {
if (isset($resArray['errmsg']) && ($resArray['errmsg'] == 'ok')) {
echo "辅种信息提交成功!!! \n\n";
}else{
} else {
$errmsg = isset($resArray['errmsg']) ? $resArray['errmsg'] : '远端服务器无响应,请稍后重试!';
echo '-----辅种失败,原因:' .$errmsg. " \n\n";
exit(1);
@@ -416,31 +456,37 @@ class AutoReseed
* 前置检测
*/
// passkey检测
if ( empty($configALL[$sites[$sitesID]['site']]['passkey']) ) {
if (empty($configALL[$sites[$sitesID]['site']]['passkey'])) {
echo '-------因当前' .$sites[$sitesID]['site']. "站点未设置passkey已跳过 \n\n";
self::$wechatMsg['reseedSkip']++;
continue;
}
// cookie检测
if ( in_array($sites[$sitesID]['site'], self::$cookieCheck) && empty($configALL[$sites[$sitesID]['site']]['cookie']) ) {
if (in_array($sites[$sitesID]['site'], self::$cookieCheck) && empty($configALL[$sites[$sitesID]['site']]['cookie'])) {
echo '-------因当前' .$sites[$sitesID]['site']. '站点未设置cookie已跳过' . "\n\n";
self::$wechatMsg['reseedSkip']++;
continue;
}
// 流控检测
if ( isset($configALL[$sites[$sitesID]['site']]['limit']) ) {
if (isset($configALL[$sites[$sitesID]['site']]['limit'])) {
echo "-------因当前" .$sites[$sitesID]['site']. "站点触发流控,已跳过!! {$_url} \n\n";
// 流控日志
if ($sites[$sitesID]['site'] == 'hdchina') {
$details_page = str_replace('{}', $value['torrent_id'], 'details.php?id={}&hit=1');
$_url = 'https://' .$sites[$sitesID]['base_url']. '/' .$details_page;
}
wlog('clients_'.$k."\n".$downloadDir."\n"."-------因当前" .$sites[$sitesID]['site']. "站点触发流控,已跳过!! {$_url} \n\n",'reseedLimit');
self::$wechatMsg['reseedSkip']++;
continue;
}
// 重复做种检测
if ( isset($infohash_Dir[$value['info_hash']]) ) {
if (isset($infohash_Dir[$value['info_hash']])) {
echo '-------与客户端现有种子重复:'.$_url."\n\n";
self::$wechatMsg['reseedRepeat']++;
continue;
}
// 历史添加检测
if ( is_file(self::$cacheHash . $value['info_hash'].'.txt') ) {
if (is_file(self::$cacheHash . $value['info_hash'].'.txt')) {
echo '-------当前种子上次辅种已成功添加,已跳过! '.$_url."\n\n";
self::$wechatMsg['reseedPass']++;
continue;
@@ -469,7 +515,7 @@ class AutoReseed
*/
// 判断是否具有VIP或特殊权限
$is_vip = isset($configALL[$sites[$sitesID]['site']]['is_vip']) && $configALL[$sites[$sitesID]['site']]['is_vip'] ? 1 : 0;
if ( (in_array($sites[$sitesID]['site'], self::$noReseed)==false) || $is_vip ) {
if ((in_array($sites[$sitesID]['site'], self::$noReseed)==false) || $is_vip) {
/**
* 可以辅种
*/
@@ -488,11 +534,11 @@ class AutoReseed
$offset = strpos($details_html, $download_page);
$urlTemp = substr($details_html, $offset, 50);
// 种子地址
$_url = substr($urlTemp,0,strpos($urlTemp,'">'));
$_url = substr($urlTemp, 0, strpos($urlTemp, '">'));
$_url = 'https://' .$sites[$sitesID]['base_url']. '/' . $_url;
print "种子下载页:".$_url. "\n";
$url = download($_url, $cookie, $userAgent);
if(strpos($url,'系统检测到过多的种子下载请求') != false){
if (strpos($url, '系统检测到过多的种子下载请求') != false) {
echo "当前站点触发人机验证,已加入排除列表 \n";
ff($sites[$sitesID]['site']. '站点,辅种时触发人机验证!');
$configALL[$sites[$sitesID]['site']]['limit'] = 1;
@@ -503,17 +549,17 @@ class AutoReseed
$cookie = isset($configALL[$sites[$sitesID]['site']]['cookie']) ? $configALL[$sites[$sitesID]['site']]['cookie'] : '';
$userAgent = $configALL['default']['userAgent'];
print "种子:".$_url. "\n";
if ( isset($configALL[$sites[$sitesID]['site']]['cuhash']) ) {
if (isset($configALL[$sites[$sitesID]['site']]['cuhash'])) {
// 已获取cuhash
# code...
}else {
} else {
// 获取cuhash
$html = download('https://' .$sites[$sitesID]['base_url']. '/pt', $cookie, $userAgent);
// 提取种子下载地址
$offset = strpos($html,'cuhash=');
$offset = strpos($html, 'cuhash=');
$len = strlen('cuhash=');
$cuhashTemp = substr($html,$offset+$len,40);
$configALL[$sites[$sitesID]['site']]['cuhash'] = substr($cuhashTemp,0,strpos($cuhashTemp,'"'));
$cuhashTemp = substr($html, $offset+$len, 40);
$configALL[$sites[$sitesID]['site']]['cuhash'] = substr($cuhashTemp, 0, strpos($cuhashTemp, '"'));
}
$url = $_url."&cuhash=". $configALL[$sites[$sitesID]['site']]['cuhash'];
// 城市下载种子时会302转向
@@ -527,9 +573,7 @@ class AutoReseed
$ret = false;
// 成功返回true
$ret = self::add($k, $url, $downloadDir);
// 添加成功的种子以infohash为文件名写入缓存
if ($ret) {
// 成功的种子
// 按站点规范日志内容
switch ($sites[$sitesID]['site']) {
case 'hdchina':
$url = $details_url;
@@ -540,47 +584,39 @@ class AutoReseed
default:
break;
}
// 文件句柄
$resource = fopen(self::$cacheHash . $value['info_hash'].'.txt', "wb");
// 成功返回写入字节数失败返回false
$worldsnum = fwrite($resource, $url);
fclose($resource);
// 添加成功的种子以infohash为文件名写入缓存
if ($ret) {
// 成功的种子
wlog($url."\n", $value['info_hash'], self::$cacheHash);
wlog($url."\n",'reseedSuccess');
// 成功累加
self::$wechatMsg['reseedSuccess']++;
continue;
}else{
} else {
// 失败的种子
// 不同站点的错误提示
switch ($sites[$sitesID]['site']) {
case 'hdcity':
break;
default:
break;
}
wlog($url."\n",'reseedError');
// 失败累加
self::$wechatMsg['reseedError']++;
continue;
}
}else{
} else {
/**
* 不辅种
*/
echo '-------已跳过不辅种的站点:'.$_url."\n\n";
// 写入日志文件,供用户手动辅种
if ( !isset($infohash_Dir[$value['info_hash']]) ) {
// 站点类型判断
// 按站点规范日志内容
switch ($sites[$sitesID]['site']) {
case 'hdchina':
$url = $details_url;
break;
case 'hdcity':
$url = $_url;
break;
default:
break;
}
// 文件句柄
$resource = fopen(self::$cacheDir . $sites[$sitesID]['site'].'.txt', 'a');
// 成功返回写入字节数失败返回false
$worldsnum = fwrite($resource, 'clients_'.$k."\n".$downloadDir."\n".$url."\n".$details_url."\n\n");
fclose($resource);
}
// 写入日志文件,供用户手动辅种
wlog('clients_'.$k."\n".$downloadDir."\n".$url."\n".$details_url."\n\n", $sites[$sitesID]['site']);
}
}
}

View File

@@ -17,5 +17,4 @@ interface AbstractClientInterface
* @return string
*/
public function status();
}

View File

@@ -714,6 +714,10 @@ class TransmissionRPC implements AbstractClientInterface
// Setup authentication (if provided)
if ($this->username && $this->password) {
$contextopts['http']['header'] = sprintf("Authorization: Basic %s\r\n", base64_encode($this->username . ':' . $this->password));
$contextopts['http']['ssl'] = array(
"verify_peer"=>false,
"verify_peer_name"=>false,
);
}
if ($this->debug) {

View File

@@ -87,7 +87,7 @@ class qBittorrent implements AbstractClientInterface
$this->curl->setOpt(CURLOPT_TIMEOUT, 600); // 超时
// Authenticate and get cookie, else throw exception
if (!$this->authenticate()) {
throw new \Exception("Unable to authenticate with Web Api.");
throw new \Exception("qBittorrent Unable to authenticate with Web Api.");
}
}

300
app/Library/Table.php Normal file
View File

@@ -0,0 +1,300 @@
<?php
/**
* Created by PhpStorm.
* User: 大卫
* Date: 2020-1-19
* Time: 17:44
*/
namespace IYUU\Library;
class Table
{
const ALIGN_LEFT = 1;
const ALIGN_RIGHT = 0;
const ALIGN_CENTER = 2;
/**
* 头信息数据
* @var array
*/
protected $header = [];
/**
* 头部对齐方式 默认1 ALGIN_LEFT 0 ALIGN_RIGHT 2 ALIGN_CENTER
* @var int
*/
protected $headerAlign = 1;
/**
* 表格数据(二维数组)
* @var array
*/
protected $rows = [];
/**
* 单元格对齐方式 默认1 ALGIN_LEFT 0 ALIGN_RIGHT 2 ALIGN_CENTER
* @var int
*/
protected $cellAlign = 1;
/**
* 单元格宽度信息
* @var array
*/
protected $colWidth = [];
/**
* 表格输出样式
* @var string
*/
protected $style = 'default';
/**
* 表格样式定义
* @var array
*/
protected $format = [
'compact' => [],
'default' => [
'top' => ['+', '-', '+', '+'],
'cell' => ['|', ' ', '|', '|'],
'middle' => ['+', '-', '+', '+'],
'bottom' => ['+', '-', '+', '+'],
'cross-top' => ['+', '-', '-', '+'],
'cross-bottom' => ['+', '-', '-', '+'],
],
'markdown' => [
'top' => [' ', ' ', ' ', ' '],
'cell' => ['|', ' ', '|', '|'],
'middle' => ['|', '-', '|', '|'],
'bottom' => [' ', ' ', ' ', ' '],
'cross-top' => ['|', ' ', ' ', '|'],
'cross-bottom' => ['|', ' ', ' ', '|'],
],
'borderless' => [
'top' => ['=', '=', ' ', '='],
'cell' => [' ', ' ', ' ', ' '],
'middle' => ['=', '=', ' ', '='],
'bottom' => ['=', '=', ' ', '='],
'cross-top' => ['=', '=', ' ', '='],
'cross-bottom' => ['=', '=', ' ', '='],
],
'box' => [
'top' => ['┌', '─', '┬', '┐'],
'cell' => ['│', ' ', '│', '│'],
'middle' => ['├', '─', '┼', '┤'],
'bottom' => ['└', '─', '┴', '┘'],
'cross-top' => ['├', '─', '┴', '┤'],
'cross-bottom' => ['├', '─', '┬', '┤'],
],
'box-double' => [
'top' => ['╔', '═', '╤', '╗'],
'cell' => ['║', ' ', '│', '║'],
'middle' => ['╠', '─', '╪', '╣'],
'bottom' => ['╚', '═', '╧', '╝'],
'cross-top' => ['╠', '═', '╧', '╣'],
'cross-bottom' => ['╠', '═', '╤', '╣'],
],
];
/**
* 设置表格头信息 以及对齐方式
* @access public
* @param array $header 要输出的Header信息
* @param int $align 对齐方式 默认1 ALGIN_LEFT 0 ALIGN_RIGHT 2 ALIGN_CENTER
* @return void
*/
public function setHeader($header, $align = self::ALIGN_LEFT)
{
$this->header = $header;
$this->headerAlign = $align;
$this->checkColWidth($header);
}
/**
* 设置输出表格数据 及对齐方式
* @access public
* @param array $rows 要输出的表格数据(二维数组)
* @param int $align 对齐方式 默认1 ALGIN_LEFT 0 ALIGN_RIGHT 2 ALIGN_CENTER
* @return void
*/
public function setRows($rows, $align = self::ALIGN_LEFT)
{
$this->rows = $rows;
$this->cellAlign = $align;
foreach ($rows as $row)
{
$this->checkColWidth($row);
}
}
/**
* 检查列数据的显示宽度
* @access public
* @param mixed $row 行数据
* @return void
*/
protected function checkColWidth($row)
{
if (is_array($row))
{
foreach ($row as $key => $cell)
{
if (!isset($this->colWidth[$key]) || strlen($cell) > $this->colWidth[$key])
{
$this->colWidth[$key] = strlen($cell);
}
}
}
}
/**
* 增加一行表格数据
* @access public
* @param mixed $row 行数据
* @param bool $first 是否在开头插入
* @return void
*/
public function addRow($row, $first = false)
{
if ($first)
{
array_unshift($this->rows, $row);
}
else
{
$this->rows[] = $row;
}
$this->checkColWidth($row);
}
/**
* 设置输出表格的样式
* @access public
* @param string $style 样式名
* @return void
*/
public function setStyle($style)
{
$this->style = isset($this->format[$style]) ? $style : 'default';
}
/**
* 输出分隔行
* @access public
* @param string $pos 位置
* @return string
*/
protected function renderSeparator($pos)
{
$style = $this->getStyle($pos);
$array = [];
foreach ($this->colWidth as $width)
{
$array[] = str_repeat($style[1], $width + 2);
}
return $style[0] . implode($style[2], $array) . $style[3] . PHP_EOL;
}
/**
* 输出表格头部
* @access public
* @return string
*/
protected function renderHeader()
{
$style = $this->getStyle('cell');
$content = $this->renderSeparator('top');
foreach ($this->header as $key => $header)
{
$array[] = ' ' . str_pad($header, $this->colWidth[$key], $style[1], $this->headerAlign);
}
if (!empty($array))
{
$content .= $style[0] . implode(' ' . $style[2], $array) . ' ' . $style[3] . PHP_EOL;
if ($this->rows)
{
$content .= $this->renderSeparator('middle');
}
}
return $content;
}
protected function getStyle($style)
{
if ($this->format[$this->style])
{
$style = $this->format[$this->style][$style];
}
else
{
$style = [' ', ' ', ' ', ' '];
}
return $style;
}
/**
* 输出表格
* @access public
* @param array $dataList 表格数据
* @return string
*/
public function render($dataList = [])
{
if ($dataList)
{
$this->setRows($dataList);
}
// 输出头部
$content = $this->renderHeader();
$style = $this->getStyle('cell');
if ($this->rows)
{
foreach ($this->rows as $row)
{
if (is_string($row) && '-' === $row)
{
$content .= $this->renderSeparator('middle');
}
elseif (is_scalar($row))
{
$content .= $this->renderSeparator('cross-top');
$array = str_pad($row, 3 * (count($this->colWidth) - 1) + array_reduce($this->colWidth, function ($a, $b) {
return $a + $b;
}));
$content .= $style[0] . ' ' . $array . ' ' . $style[3] . PHP_EOL;
$content .= $this->renderSeparator('cross-bottom');
}
else
{
$array = [];
foreach ($row as $key => $val)
{
$array[] = ' ' . str_pad($val, $this->colWidth[$key], ' ', $this->cellAlign);
}
$content .= $style[0] . implode(' ' . $style[2], $array) . ' ' . $style[3] . PHP_EOL;
}
}
}
$content .= $this->renderSeparator('bottom');
return $content;
}
}

View File

@@ -1,4 +1,8 @@
<?php
use IYUU\Library\IFile;
use IYUU\Library\Table;
/**
* 调试函数
* @param $data
@@ -192,6 +196,37 @@ function convertToMB($from)
}
}
/**
* 字节数Byte转换为KB、MB、GB、TB
*
*/
function getFilesize($num){
$p = 0;
$format='bytes';
if($num>0 && $num<1024){
$p = 0;
return number_format($num).' '.$format;
}
if($num>=1024 && $num<pow(1024, 2)){
$p = 1;
$format = 'KB';
}
if ($num>=pow(1024, 2) && $num<pow(1024, 3)) {
$p = 2;
$format = 'MB';
}
if ($num>=pow(1024, 3) && $num<pow(1024, 4)) {
$p = 3;
$format = 'GB';
}
if ($num>=pow(1024, 4) && $num<pow(1024, 5)) {
$p = 3;
$format = 'TB';
}
$num /= pow(1024, $p);
return number_format($num, 2).$format;
}
/**
* @brief 种子过滤器
* @param string $site 站点标识
@@ -285,6 +320,27 @@ function filter($site = '', $torrent = array())
return false;
}
/**
* 日志记录函数
*/
function wlog($data='',$name = '',$path = ''){
// 数据转换
if (is_bool($data)) {
$show_data=$data ? 'true' : 'false';
} elseif (is_null($data)) {
$show_data='null';
} else {
$show_data=print_r($data, true);
}
// 写入日志
$dir = $path===''? TORRENT_PATH . 'cache' . DS : $path;
IFile::mkdir($dir);
$myfile = $dir.$name.'.txt';
$file_pointer = @fopen($myfile,"a");
$worldsnum = @fwrite($file_pointer,$show_data);
@fclose($file_pointer);
return $worldsnum;
}
/**
* transmission过滤函数只保留正常做种
*/
@@ -317,3 +373,92 @@ function object_array($array)
}
return $array;
}
/**
* 奇数
*/
function oddFilter($var)
{
// 返回$var最后一个二进制位
// 为1则保留奇数的二进制的最后一位肯定是1
return($var & 1);
}
/**
* 偶数
*/
function evenFilter($var)
{
// 返回$var最后一个二进制位
// 为0则保留偶数的二进制的最后一位肯定是0
return(!($var & 1));
}
/**
* 发布员签名
* 注意同时配置iyuu.cn与secret时优先使用secret。
*/
function sign( $timestamp ){
global $configALL;
// 爱语飞飞
$token = isset($configALL['iyuu.cn']) && $configALL['iyuu.cn'] ? $configALL['iyuu.cn'] : '';
// 鉴权
$token = isset($configALL['secret']) && $configALL['secret'] ? $configALL['secret'] : $token;
return sha1($timestamp . $token);
}
/**
* @brief 分离token中的用户uid
* token算法IYUU + uid + T + sha1(openid+time+盐)
* @param string $token 用户请求token
*/
function getUid($token){
//验证是否IYUU开头strpos($token,'T')<15,token总长度小于60(40+10+5)
return (strlen($token)<60)&&(strpos($token,'IYUU')===0)&&(strpos($token,'T')<15) ? substr($token,4,strpos($token,'T')-4): false;
}
/**
* 显示支持的站点列表
*/
function ShowTableSites($dir = 'Protocols',$filter = array()){
// 过滤的文件
switch ($dir) {
case 'Protocols':
$filter = ['axxxx','decodeBase'];
break;
case 'Rss':
$filter = ['AbstractRss'];
break;
default:
# code...
break;
}
$data = [];
$i = $j = $k = 0;
foreach(glob(APP_PATH.$dir.DS.'*.php') as $key => $start_file)
{
$start_file = str_replace("\\","/",$start_file);
$offset = strripos($start_file,'/');
if ($offset===false) {
$start_file = substr($start_file,0,-4);
} else {
$start_file = substr($start_file,$offset+1,-4);
}
// 过滤示例、过滤解码接口
if (in_array($start_file, $filter)) {
continue;
}
// 控制多少列
if ($i > 4) {
$k++;
$i = 0;
}
$i++;
$j++;
$data[$k][] = $j.". ".$start_file;
}
//输出表格
$table = new Table();
$table->setRows($data);
echo($table->render());
}

2
build.cmd Normal file
View File

@@ -0,0 +1,2 @@
@echo off
composer install

View File

@@ -273,7 +273,7 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// hdbug 序号32
// hddisk.life 序号32
'hdbug' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',

View File

@@ -3,10 +3,9 @@
// 公共入口文件
//----------------------------------
// 定义目录
use IYUU\AutoReseed;
defined('ROOT_PATH') or define("ROOT_PATH", __DIR__);
define('DS', DIRECTORY_SEPARATOR);
defined('APP_PATH') or define('APP_PATH', ROOT_PATH.DS.'app'.DS);
define('TORRENT_PATH', ROOT_PATH.DS.'torrent'.DS);
// 严格开发模式
@@ -37,14 +36,16 @@ if (file_exists(ROOT_PATH."/config/config.php")) {
// 示例配置
$configALL = require_once ROOT_PATH . '/config/config.sample.php';
}
// 读取支持列表
if (is_file(ROOT_PATH . "/config/sites.json")) {
$sitesJson = file_get_contents(ROOT_PATH . "/config/sites.json");
$configALL['sitesALL'] = json_decode($sitesJson, true);
}
require_once ROOT_PATH . '/vendor/autoload.php';
AutoReseed::init();
$hashArray = AutoReseed::get();
if (AutoReseed::$move != null) {
echo "种子移动完毕,请重新编辑配置,再尝试辅种! \n\n";
exit;
global $argv;
$start_file = str_replace("\\","/",trim($argv[0]));
if( substr($start_file,-8)==="init.php" ){
require_once __DIR__ . '/iyuu.php';
}
AutoReseed::call($hashArray);
AutoReseed::wechatMessage();

12
iyuu.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
require_once __DIR__ . '/init.php';
use IYUU\AutoReseed;
AutoReseed::init();
$hashArray = AutoReseed::get();
if (AutoReseed::$move != null) {
echo "种子移动完毕,请重新编辑配置,再尝试辅种! \n\n";
exit;
}
AutoReseed::call($hashArray);
AutoReseed::wechatMessage();

View File

@@ -29,11 +29,13 @@ IYUU自动辅种工具英文名IYUUAutoReseed是一款PHP语言编
2. qBittorrent
## 支持自动辅种的站点
学校、杜比、家园、天空、朋友、馒头、萌猫、我堡、猫站、铂金家、烧包、北洋、TCCF、南洋、TTG、映客、城市、52pt、brobits、备胎、SSD、CHD、ptmsg、leaguehd、聆音、瓷器、hdarea、eastgame(TLF)、1ptba、hdtime、hd4fans、opencd、hdbug、hdstreet、joyhd、u2、upxin(HDU)、oshen、discfan(GZT)、cnscg圣城。
学校、杜比、家园、天空、朋友、馒头、萌猫、我堡、猫站、铂金家、烧包、北洋、TCCF、南洋、TTG、映客、城市、52pt、brobits、备胎、SSD、CHD、ptmsg、leaguehd、聆音、瓷器、hdarea、eastgame(TLF)、1ptba、hdtime、hd4fans、opencd、hdbug、hdstreet、joyhd、u2、upxin(HDU)、oshen、discfan(GZT)、cnscg圣城(已删除)
## 运行环境
所有具备PHP运行环境的所有平台官方下载的记得开启crul、fileinfo、mbstring这3个扩展。
例如Linux、Windows、MacOS
所有具备PHP运行环境的所有平台例如Linux、Windows、MacOS
官方下载的记得开启crul、fileinfo、mbstring这3个扩展。
1. Windows下安装php环境https://www.php.net/downloads
@@ -100,6 +102,8 @@ IYUU自动辅种工具英文名IYUUAutoReseed是一款PHP语言编
| 寒山先生 | ¥100元 | 2020年1月9日11:51 |
| 王浩淼 | ¥50元 | 2020年1月9日11:53 |
| 寒山先生 | ¥100元 | 2020年1月11日11:47 |
| 天空(感谢远程指导小意思) | ¥20元 | 2020年1月14日23:11 |
| 寒山先生 | ¥200元 | 2020年1月18日12:37 |
补充说明:

View File

@@ -0,0 +1,51 @@
## 下载最新源码的两种方法
### 第一种:下载完整的发行版
**github**[GITHUB仓库 发行版][1]
**gitee**[码云仓库 发行版][2]
下载**`Release.zip`**后缀的压缩包,解压缩后即可配置适用。
### 第二种git clone下载源码
**拉取源码命令,下面两个仓库都可以:**
- github`git clone https://github.com/ledccn/IYUUAutoReseed`
- gitee`git clone https://gitee.com/ledc/IYUUAutoReseed.git`
----------
**完整命令:**
```bash
git clone https://github.com/ledccn/IYUUAutoReseed
cd IYUUAutoReseed
composer install
```
Windows环境完整过程演示
![git下载源码composer安装.png][3]
```cmd
E:\>git clone https://github.com/ledccn/IYUUAutoReseed
Cloning into 'IYUUAutoReseed'...
remote: Enumerating objects: 189, done.
remote: Counting objects: 100% (189/189), done.
remote: Compressing objects: 100% (120/120), done.
Receiving objects: 97% (814/remote: Total 839 (delta 78), reused 171 (delta 64), pack-reused 650839), 380.00 KiB | 45.0R
Receiving objects: 100% (839/839), 419.04 KiB | 50.00 KiB/s, done.
Resolving deltas: 100% (468/468), done.
E:\>cd IYUUAutoReseed
E:\IYUUAutoReseed>composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Package operations: 2 installs, 0 updates, 0 removals
- Installing curl/curl (2.2.0): Loading from cache
- Installing owner888/phpspider (v2.1.6): Loading from cache
owner888/phpspider suggests installing ext-pcntl、ext-redis (For better performance. )
Generating autoload files
E:\IYUUAutoReseed>
```
[1]: https://github.com/ledccn/IYUUAutoReseed/releases
[2]: https://gitee.com/ledc/IYUUAutoReseed/releases
[3]: https://www.iyuu.cn/usr/uploads/2020/01/314358689.png

View File

@@ -6,7 +6,7 @@ IYUU自动辅种工具、Ourbits双方达成合作可以对使用接口的用
![微信通知1.png][1]
![微信通知2.png][2]
![微信通知3.png][3]
2.复制您的token令牌到`/app/config/config.php`文件内的`iyuu.cn`对应的配置字段,保存。如图:
2.复制您的token令牌到`/config/config.php`文件内的`iyuu.cn`对应的配置字段,保存。如图:
![微信通知4.png][4]
### 设置Ourbits
@@ -19,9 +19,9 @@ IYUU自动辅种工具、Ourbits双方达成合作可以对使用接口的用
到此,配置文件编辑完毕,请记得保存。
如果提示保存格式请保存为UTF8无BOM格式。
[1]: https://www.iyuu.cn/usr/uploads/2019/12/2331433923.png
[2]: https://www.iyuu.cn/usr/uploads/2019/12/3324442680.png
[3]: https://www.iyuu.cn/usr/uploads/2019/12/3181272964.png
[4]: https://www.iyuu.cn/usr/uploads/2019/12/3669828008.png
[5]: https://www.iyuu.cn/usr/uploads/2019/12/3696916642.png
[6]: https://www.iyuu.cn/usr/uploads/2019/12/1230288911.png
[1]: https://www.iyuu.cn/usr/uploads/2019/12/2331433923.png
[2]: https://www.iyuu.cn/usr/uploads/2019/12/3324442680.png
[3]: https://www.iyuu.cn/usr/uploads/2019/12/3181272964.png
[4]: https://www.iyuu.cn/usr/uploads/2019/12/3669828008.png
[5]: https://www.iyuu.cn/usr/uploads/2019/12/3696916642.png
[6]: https://www.iyuu.cn/usr/uploads/2019/12/1230288911.png

View File

@@ -3,7 +3,13 @@ php命令与脚本路径之间是有个空格请注意请注意请注
## IYUU自动辅种命令
`php ./init.php`
`php ./iyuu.php`
## IYUU自动下载种子之RSS订阅
`php ./rss.php 站点名`

View File

@@ -81,6 +81,22 @@
请退出登录在登录时勾选下面两个SSL的选项登录后复制cookie重新配置。
#### 问IYUU自动辅种失败怎么排查问题
1.输入种子链接,手动方法,看看种子是否还在?
2.手动下载种子,看看是否出现了下载种子的提示页?
3.瓷器、城市需要cookie辅种请检查cookie是否配置正确如果下载出现提示页面需要更新配置内的cookie、更新cookid
如果整个站都失败,请按以上步骤排查。
#### 问Windows下执行脚本时乱码
用cmd和powershell执行脚本中文输出乱码由于我是写php脚本的非常喜欢国际化的uft8编码。注册表修改有些可以有些不可以直接在控制面板修改。
控制面板\时钟和区域\区域\管理\更改系统区域设置\勾选beta版:使用unicode-utf8全球语言支持,保存重启即可仅支持win10
#### 问:如何反馈问题?
1、点击链接加入群聊【IYUU自动辅种交流】[https://jq.qq.com/?_wv=1027&k=5JOfOlM][1]

View File

@@ -1,46 +1,47 @@
## 404数据最后清理时间
|标志 | 最后清理时间 | 状态 |
| :-: | :-: | ---- |
| 兽 | | |
|老师 | | |
|伊甸园 | | |
|CHD | | |
|hdzone | | |
|港知堂(discfan) | | |
|海豚 | | |
|oshen | | |
|HDU(upxin) | | |
|U2 | | |
|joyhd | | |
|高清街 | | |
|HDTIME | | |
|hddisk(hdbug) | | |
|HDArea | | |
|1ptba | | |
|烧包 | | |
|LeagueHD | | |
|聆音 | | |
|TLFBits | | |
|备胎 | | |
|Brobits | | |
|52pt | | |
| 南洋 | | 已完成 |
|映客 | | 已完成 |
| ttg | | |
|城市 | 2020年1月17日01:48:27 | 已完成 |
|萌猫 | 2020年1月16日12:07:12 | 已完成 |
|ptmsg | 2020年1月16日12:07:17 | 已完成 |
|瓷器 | | |
|杜比 | 2020年1月16日11:34:19 | 已完成 |
|tccf | 2020年1月17日01:48:36 | 已完成 |
|馒头 | | |
|春天 | 2020年1月16日00:23:05 | 已完成 |
|北洋 | 2020年1月16日00:23:05 | 已完成 |
|猫站 | 2020年1月17日01:48:43 | 已完成 |
|朋友 | 2020年1月16日00:23:05 | 已完成 |
|铂金家 | 2020年1月16日00:23:05 | 已完成 |
|家园 | 2020年1月16日00:23:05 | 已完成 |
|学校 | 2020年1月16日00:19:24 | 已完成 |
| 我堡 | 2020年1月15日13:56:22 | 已完成 |
| 天空 | 2020年1月15日20:49:33 | 已完成 |
| 1ptba | 2020年1月19日12:00:00 | 已完成 |
|52pt | 2020年1月19日12:00:00 | 已完成 |
|beitai-备胎 | 2020年1月19日12:00:00 | 已完成 |
|brobits | 2020年1月19日12:00:00 | 已完成 |
|btschool-学校 | 2020年1月19日12:00:00 | 已完成 |
|chdbits-彩虹岛 | 2020年1月19日12:00:00 | 已完成 |
|discfan-港知堂 | 2020年1月19日12:00:00 | 已完成 |
|dmhy-幼儿园 | 2020年1月19日12:00:00 | 已完成 |
|eastgame | 2020年1月19日12:00:00 | 已完成 |
|hd4fans-兽 | | 已完成 |
|hdarea-HDA | | |
|hdbd-伊甸园 | | |
|hdbug(hddisk) | 2020年1月19日12:00:00 | 已完成 |
|hdchina-瓷器 | 2020年1月19日12:00:00 | 已完成 |
|hdcity-城市 | 2020年1月19日12:00:00 | 已完成 |
|hddolby-杜比 | 2020年1月19日12:00:00 | 已完成 |
|hdhome-家园 | 2020年1月19日12:00:00 | 已完成 |
|hdsky-天空 | 2020年1月19日12:00:00 | 已完成 |
|hdstreet | 2020年1月19日12:00:00 | 已完成 |
|hdtime-时间 | 2020年1月19日12:00:00 | 已完成 |
|hdzone-HDZ | 2020年1月19日12:00:00 | 已完成 |
|joyhd | 2020年1月19日12:00:00 | 已完成 |
| keepfrds-朋友 | 2020年1月19日12:00:00 | 已完成 |
|leaguehd | 2020年1月19日12:00:00 | 已完成 |
| m-team-馒头 | 2020年1月19日12:00:00 | 已完成 |
|moecat-萌猫 | 2020年1月19日12:00:00 | 已完成 |
|nanyangpt-南洋 | 2020年1月19日12:00:00 | 已完成 |
|nicept-老师 | | |
|opencd-皇后 | | 已完成 |
|oshen | 2020年1月19日12:00:00 | 已完成 |
|ourbits-我堡 | 2020年1月19日12:00:00 | 已完成 |
|pterclub-猫站 | 2020年1月19日12:00:00 | 已完成 |
|pthome-铂金家 | 2020年1月19日12:00:00 | 已完成 |
|ptmsg | 2020年1月19日12:00:00 | 已完成 |
|ptsbao-烧包 | 2020年1月19日12:00:00 | 已完成 |
|soulvoice-聆音 | 2020年1月19日12:00:00 | 已完成 |
|ssd-春天 | 2020年1月19日12:00:00 | 已完成 |
|tjupt-北洋 | 2020年1月19日12:00:00 | 已完成 |
|torrentccf-TCCF | 2020年1月19日12:00:00 | 已完成 |
| ttg-听听歌 | 2020年1月19日12:00:00 | 已完成 |
| upxin | 2020年1月19日12:00:00 | 已完成 |
| yingk-映客 | 2020年1月19日12:00:00 | 已完成 |
| ziyuan-资源 | | |

View File

@@ -1,3 +1,11 @@
### 2020年1月21日
新增支持的站点列表json本地化
新增:在线查询支持站点控制台显示
新增Windows系统composer install安装依赖包命令
### 2020年1月17日
优化:文件结构,辅种脚本前置检查;

View File

@@ -1,4 +1,4 @@
以下教程以windows为基础进行讲解其他系统同理
以下教程以windows为基础进行讲解通用威联通、群晖、铁威马等Linux系统
博客链接https://www.iyuu.cn/archives/324/
## 第一步 下载压缩包
从[码云仓库][1]下载最新源码解压缩到D盘的根目录下。
@@ -49,7 +49,7 @@ IYUU自动辅种工具、Ourbits双方达成合作可以对使用接口的用
![微信通知1.png][6]
![微信通知2.png][7]
![微信通知3.png][8]
2.复制您的token令牌到`/app/config/config.php`文件内的`iyuu.cn`对应的配置字段,保存。如图:
2.复制您的token令牌到`/config/config.php`文件内的`iyuu.cn`对应的配置字段,保存。如图:
![微信通知4.png][9]
### 设置Ourbits