Compare commits

..

68 Commits

Author SHA1 Message Date
iyuu.cn
854121884b 新增转移成功跳校验、转移成功删除当前做种功能。 2020-02-18 14:48:35 +08:00
iyuu.cn
da88f3e7fc 新增种子删除上报功能! 2020-02-17 16:54:27 +08:00
iyuu.cn
3abc02d660 修改示例配置 2020-02-17 16:46:59 +08:00
iyuu.cn
339f1304c6 优化日志记录 2020-02-16 20:51:39 +08:00
iyuu.cn
c4df9899c8 修复transmission添加任务成功后,获取名字和id 2020-02-16 15:10:15 +08:00
iyuu.cn
6494351ff3 修复transmission返回值判断错误 2020-02-16 14:39:23 +08:00
iyuu.cn
e01dbfd601 审查代码,删除无用接口 2020-02-16 01:26:40 +08:00
iyuu.cn
940f948f43 增加客户端文件是否存在判断 2020-02-15 22:12:12 +08:00
iyuu.cn
958bef0dfa windows大小写不敏感,新增 2020-02-15 19:24:58 +08:00
iyuu.cn
ea74b96293 windows大小写不敏感,删除 2020-02-15 19:24:10 +08:00
iyuu.cn
94948610e4 优化瓷器cookie有效性检查 2020-02-15 19:20:12 +08:00
iyuu.cn
0f1605ffca 修改transmission首字母小写 2020-02-15 16:05:05 +08:00
iyuu.cn
33ff8a991a 优化工厂模式创建客户端实例
增加新功能:本地做种客户端转移
2020-02-15 09:20:41 +08:00
iyuu.cn
877616214c 新增本地转移做种客户端示例配置 2020-02-15 09:19:20 +08:00
iyuu.cn
aa4a8c76fe 升级php版本号 2020-02-12 14:50:05 +08:00
iyuu.cn
f6870a4e95 增加瓷器的第一次下载种子检测 2020-02-12 14:16:38 +08:00
iyuu.cn
e073f165ac 优化提示信息。echo对隐私信息脱敏 2020-02-09 23:20:20 +08:00
iyuu.cn
6144b8b301 更新Readme.md 2020-02-08 11:59:30 +08:00
iyuu.cn
658d764c26 修复pathReplace方法返回值错误 2020-02-08 11:27:10 +08:00
iyuu.cn
2ce1920c51 后端API迁移至新架构,升级版本号到1.0.0 2020-02-07 18:31:51 +08:00
iyuu.cn
ea158ddd55 规范代码 2020-02-01 21:47:26 +08:00
IYUU
76c0cefca2 变更忽略列表 2020-01-31 20:55:27 +08:00
IYUU
a69a2c2955 变更忽略列表 2020-01-31 20:51:52 +08:00
IYUU
7dc0c54c56 排除列表 2020-01-31 20:50:24 +08:00
IYUU
19197d36ce 整合vendor依赖目录 2020-01-31 15:16:18 +08:00
IYUU
8561fac8c4 修改示例配置IP为本机 2020-01-31 12:28:07 +08:00
IYUU
e4911871b8 新增Windows辅种一键脚本 2020-01-31 11:18:00 +08:00
IYUU
a328f68178 完善逻辑 2020-01-31 03:00:32 +08:00
IYUU
ce65b5d1ff 规范换行符 2020-01-31 01:07:18 +08:00
IYUU
dff0c17b33 调整顺序 2020-01-31 00:35:43 +08:00
IYUU
7dcd3e55f4 更新https支持 2020-01-30 22:00:21 +08:00
IYUU
9027262f57 更新文档 2020-01-30 21:52:34 +08:00
IYUU
31d0e6ee03 优化辅种CCFBits下载种子方法。 2020-01-30 17:33:34 +08:00
IYUU
076e688e1c 修复CCFBits自动评论 2020-01-30 16:41:36 +08:00
IYUU
c649c05a3a 新增CCFBits站点支持 2020-01-30 13:57:10 +08:00
IYUU
4896e08635 CCFBits辅种时智能启用评论 2020-01-30 13:22:48 +08:00
IYUU
3b3289274b 完善转移功能:当启用转移功能时,可以设置是否辅种被转移客户端。 2020-01-30 11:33:46 +08:00
IYUU
bf65f7039d 示例配置内增加教程 2020-01-29 15:11:02 +08:00
IYUU
0a7c2120a1 修复str_replace($key, '', $path, 1);执行错误的bug 2020-01-29 14:43:30 +08:00
IYUU
04a10295c2 更新文档 2020-01-29 00:42:52 +08:00
IYUU
3e75aec9d0 减少依赖包 2020-01-29 00:08:58 +08:00
IYUU
63ce263afb 新增做种客户端移动,新增北邮人辅种 2020-01-28 23:57:18 +08:00
iyuu.cn
19df3f3cfb 格式化代码 2020-01-22 22:56:35 +08:00
iyuu.cn
66490efad7 优化错误提示,优化辅种匹配算法 2020-01-22 20:00:21 +08:00
iyuu.cn
9044d3575e 更新参数 2020-01-22 14:19:17 +08:00
iyuu.cn
69ba1ebe56 wiki加入RSS订阅使用教程 2020-01-22 12:10:32 +08:00
iyuu.cn
978295b44d 更新示例配置,支持RSS订阅 2020-01-22 12:05:08 +08:00
iyuu.cn
f3b4deae4c 标准化格式 2020-01-22 10:47:33 +08:00
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
27 changed files with 1750 additions and 784 deletions

7
.gitignore vendored
View File

@@ -1,8 +1,9 @@
/torrent
/config/config.php
/php-7.2.12-nts
/config/sites.json
/*.bat
/*.sh
/vendor
.idea
.php_cs.cache
.php_cs.cache
vendor
php-7.4.2-nts-Win32-vc15-x86

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
<?php
/**
* Created by PhpStorm.
* User: David <367013672@qq.com>
* Date: 2020-2-14
* Time: 21:31:49
*/
namespace IYUU\Client;
abstract class AbstractClient
{
/**
* 公共方法:创建客户端实例
*/
public static function create($config = array())
{
$type = $config['type'];
$host = $config['host'];
$username = $config['username'];
$password = $config['password'];
$file = __DIR__ . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $type .'.php';
if (!is_file($file)) {
die($file.' 文件不存在');
}
$className = "\IYUU\Client\\" . $type . "\\" . $type;
if (class_exists($className)) {
echo $type." 客户端正在实例化!".PHP_EOL;
return new $className($host, $username, $password);
} else {
die($className.' 客户端不存在');
}
}
/**
* 查询Bittorrent客户端状态
*
* @return string
*/
abstract public function status();
/**
* 获取种子列表
* @return array(
'hash' => string json,
'sha1' => string,
'hashString '=> array
)
*/
abstract public function getList(&$move = array());
/**
* 添加种子连接
*/
abstract public function add($torrent_url, $save_path = '', $extra_options = array());
/**
* 添加种子原数据
*/
abstract public function add_metainfo($torrent_url, $save_path = '', $extra_options = array());
/**
* 删除种子
*/
abstract public function delete($hash, $deleteFiles = false);
}

View File

@@ -1,21 +0,0 @@
<?php
/**
* Created by PhpStorm.
* User: Rhilip
* Date: 1/17/2020
* Time: 2020
*/
namespace IYUU\Client;
interface AbstractClientInterface
{
/**
* 查询Bittorrent客户端状态
*
* @return string
*/
public function status();
}

View File

@@ -2,12 +2,12 @@
namespace IYUU\Client\qBittorrent;
use Curl\Curl;
use IYUU\Client\AbstractClientInterface;
use IYUU\Client\AbstractClient;
/**
* https://github.com/qbittorrent/qBittorrent/wiki/Web-API-Documentation
*/
class qBittorrent implements AbstractClientInterface
class qBittorrent extends AbstractClient
{
private $debug;
private $url;
@@ -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.");
}
}
@@ -157,18 +157,12 @@ class qBittorrent implements AbstractClientInterface
#$extra_options['skip_checking'] = 'true'; //跳校验
// 关键 上传文件流 multipart/form-data【严格按照api文档编写】
$post_data = $this->buildData($extra_options);
#p($post_data);
// 设置请求头
$this->curl->setHeader('Content-Type', 'multipart/form-data; boundary='.$this->delimiter);
$this->curl->setHeader('Content-Length', strlen($post_data));
return $this->postData('torrent_add', $post_data);
}
public function torrentDelete($hash='', $deleteFiles = false)
{
return $this->postData('torrent_delete', ['hashes' => $hash, 'deleteFiles' => $deleteFiles ? 'true':'false']);
}
public function torrentDeleteAll($deleteFiles = false)
{
$torrents = json_decode($this->torrentList());
@@ -295,16 +289,62 @@ class qBittorrent implements AbstractClientInterface
$data .= 'Content-Disposition: form-data; name="' . $name . '"' . $eol . $eol;
$data .= $content . $eol;
}
}
}
$data .= "--" . $this->delimiter . "--" . $eol;
return $data;
}
/**
* @inheritDoc
* 抽象方法,子类实现
*/
public function status()
{
return $this->appVersion();
}
/**
* 抽象方法,子类实现
*/
public function getList(&$move = array())
{
$result = $this->getData('torrent_list');
$res = json_decode($result, true);
if (empty($res)) {
echo "获取种子列表失败可能qBittorrent暂时无响应请稍后重试".PHP_EOL;
return array();
}
// 过滤,只保留正常做种
$res = array_filter($res, function ($v) {
if (isset($v['state']) && in_array($v['state'], array('uploading','stalledUP','pausedUP','queuedUP','checkingUP','forcedUP'))) {
return true;
}
return false;
}, ARRAY_FILTER_USE_BOTH);
if (empty($res)) {
echo "未获取到正常做种数据,请多保种,然后重试!".PHP_EOL;
return array();
}
// 提取数组hashString
$info_hash = array_column($res, 'hash');
// 升序排序
sort($info_hash);
$json = json_encode($info_hash, JSON_UNESCAPED_UNICODE);
// 去重 应该从文件读入,防止重复提交
$sha1 = sha1($json);
// 组装返回数据
$hashArray['hash'] = $json;
$hashArray['sha1'] = $sha1;
// 变换数组hashString为键
$hashArray['hashString'] = array_column($res, "save_path", 'hash');
return $hashArray;
}
/**
* 抽象方法,子类实现
*/
public function delete($hash='', $deleteFiles = false)
{
return $this->postData('torrent_delete', ['hashes' => $hash, 'deleteFiles' => $deleteFiles ? 'true':'false']);
}
}

View File

@@ -6,7 +6,7 @@
* Time: 2020
*/
namespace IYUU\Client\Transmission;
namespace IYUU\Client\transmission;
/**
* This is the type of exception the TransmissionRPC class will throw

View File

@@ -26,9 +26,9 @@
* PHP Class support (PHP 5) (PHP 4 might work, untested)
*/
namespace IYUU\Client\Transmission;
namespace IYUU\Client\transmission;
use IYUU\Client\AbstractClientInterface;
use IYUU\Client\AbstractClient;
/**
* A friendly little version check...
@@ -47,19 +47,13 @@ if (version_compare(PHP_VERSION, '5.2.10', '<')) {
* </code>
*
*/
class TransmissionRPC implements AbstractClientInterface
class transmission extends AbstractClient
{
/**
* User agent used in all http communication
*/
const HTTP_UA = 'TransmissionRPC for PHP/0.3';
/**
* Minimum PHP version required
* 5.2.10 implemented the required http stream ignore_errors option
*/
const MIN_PHPVER = '5.2.10';
/**
* The URL to the bittorent client you want to communicate with
* the port (default: 9091) can be set in you Transmission preferences
@@ -79,12 +73,6 @@ class TransmissionRPC implements AbstractClientInterface
*/
public $password = '';
/**
* Return results as an array, or an object (default)
* @var bool
*/
public $return_as_array = false;
/**
* Print debugging information, default is off
* @var bool
@@ -107,11 +95,16 @@ class TransmissionRPC implements AbstractClientInterface
* Default values for stream context
* @var array
*/
private $default_context_opts = array('http' => array(
'user_agent' => self::HTTP_UA,
'timeout' => '60', // Don't want to be too slow
'ignore_errors' => true, // Leave the error parsing/handling to the code
)
private $default_context_opts = array(
'http' => array(
'user_agent' => self::HTTP_UA,
'timeout' => '60', // Don't want to be too slow
'ignore_errors' => true, // Leave the error parsing/handling to the code
),
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
)
);
/**
@@ -134,29 +127,15 @@ class TransmissionRPC implements AbstractClientInterface
/**
* Takes the connection parameters
*
* TODO: Sanitize username, password, and URL
*
* @param string $url
* @param string $username
* @param string $password
*/
public function __construct($url = 'http://localhost:9091/transmission/rpc', $username = null, $password = null, $return_as_array = false)
public function __construct($url = 'http://127.0.0.1:9091/transmission/rpc', $username = null, $password = null)
{
// server URL
$this->url = $url;
// Username & password
$this->username = $username;
$this->password = $password;
// Get the Transmission RPC_version
$this->rpc_version = self::sget()->arguments->rpc_version;
// Return As Array
$this->return_as_array = $return_as_array;
// Reset X-Transmission-Session-Id so we (re)fetch one
$this->session_id = null;
}
/**
@@ -170,7 +149,7 @@ class TransmissionRPC implements AbstractClientInterface
{
if (!is_array($ids)) {
$ids = array($ids);
} // Convert $ids to an array if only a single id was passed
}
$request = array("ids" => $ids);
return $this->request("torrent-start", $request);
}
@@ -186,7 +165,7 @@ class TransmissionRPC implements AbstractClientInterface
{
if (!is_array($ids)) {
$ids = array($ids);
} // Convert $ids to an array if only a single id was passed
}
$request = array("ids" => $ids);
return $this->request("torrent-stop", $request);
}
@@ -202,7 +181,7 @@ class TransmissionRPC implements AbstractClientInterface
{
if (!is_array($ids)) {
$ids = array($ids);
} // Convert $ids to an array if only a single id was passed
}
$request = array("ids" => $ids);
return $this->request("torrent-reannounce", $request);
}
@@ -218,7 +197,7 @@ class TransmissionRPC implements AbstractClientInterface
{
if (!is_array($ids)) {
$ids = array($ids);
} // Convert $ids to an array if only a single id was passed
}
$request = array("ids" => $ids);
return $this->request("torrent-verify", $request);
}
@@ -353,23 +332,6 @@ class TransmissionRPC implements AbstractClientInterface
return $this->request("torrent-add", $extra_options);
}
/**
* Add a torrent using the raw torrent data
*
* @param string $torrent_metainfo The raw, unencoded contents (metainfo) of a torrent
* @param string $save_path Folder to save torrent in
* @param array $extra_options Optional extra torrent options
* @return mixed
* @throws TransmissionRPCException
*/
public function add_metainfo($torrent_metainfo, $save_path = '', $extra_options = array())
{
$extra_options['download-dir'] = $save_path;
$extra_options['metainfo'] = base64_encode($torrent_metainfo);
return $this->request("torrent-add", $extra_options);
}
/* Add a new torrent using a file path or a URL (For backwards compatibility)
* @param torrent_location The URL or path to the torrent file
* @param save_path Folder to save torrent in
@@ -380,6 +342,25 @@ class TransmissionRPC implements AbstractClientInterface
return $this->add_file($torrent_location, $save_path, $extra_options);
}
/**
* Add a torrent using the raw torrent data
*
* @param string $torrent_metainfo The raw, unencoded contents (metainfo) of a torrent
* @param string $save_path Folder to save torrent in
* @param array $extra_options Optional extra torrent options
* @return mixed
* @throws TransmissionRPCException
*/
public function add_metainfo($torrent_metainfo, $save_path = '', $extra_options = array())
{
if (!empty($save_path)) {
$extra_options['download-dir'] = $save_path;
}
$extra_options['metainfo'] = base64_encode($torrent_metainfo);
return $this->request("torrent-add", $extra_options);
}
/**
* Remove torrent from transmission
*
@@ -388,7 +369,7 @@ class TransmissionRPC implements AbstractClientInterface
* @return mixed
* @throws TransmissionRPCException
*/
public function remove($ids, $delete_local_data = false)
public function delete($ids, $delete_local_data = false)
{
if (!is_array($ids)) {
$ids = array($ids);
@@ -587,7 +568,8 @@ class TransmissionRPC implements AbstractClientInterface
$array[$index] = ($value ? 1 : 0);
} // Store boolean values as 0 or 1
if (is_string($value)) {
if (mb_detect_encoding($value, "auto") !== 'UTF-8') {
$type = mb_detect_encoding($value, "auto");
if ($type !== 'UTF-8') {
$array[$index] = mb_convert_encoding($value, "UTF-8");
//utf8_encode( $value ); // Make sure all data is UTF-8 encoded for Transmission
}
@@ -596,50 +578,12 @@ class TransmissionRPC implements AbstractClientInterface
return $array;
}
/**
* Clean up the result object. Replaces all minus(-) characters in the object properties with underscores
* and converts any object with any all-digit property names to an array.
*
* @param object The request result to clean
* @returns array The cleaned object
* @return array|object
*/
protected function cleanResultObject($object)
{
// Prepare and cast object to array
$return_as_array = false;
$array = $object;
if (!is_array($array)) {
$array = (array)$array;
}
foreach ($array as $index => $value) {
if (is_array($array[$index]) || is_object($array[$index])) {
$array[$index] = $this->cleanResultObject($array[$index]); // Recursion
}
if (strstr($index, '-')) {
$valid_index = str_replace('-', '_', $index);
$array[$valid_index] = $array[$index];
unset($array[$index]);
$index = $valid_index;
}
// Might be an array, check index for digits, if so, an array should be returned
if (ctype_digit((string)$index)) {
$return_as_array = true;
}
if (empty($value)) {
unset($array[$index]);
}
}
// Return array cast to object
return $return_as_array ? $array : (object)$array;
}
/**
* 执行 rpc 请求
*
* @param string $method 请求类型/方法, 详见 $this->allowMethods
* @param array $arguments 附加参数, 可选
* @return mixed
* @return array
* @throws TransmissionRPCException
*/
protected function request($method, $arguments = array())
@@ -687,9 +631,9 @@ class TransmissionRPC implements AbstractClientInterface
curl_close($ch);
if (!$content) {
$content = json_encode(array('result' => 'failed'));
$content = array('result' => 'failed');
}
return $this->return_as_array ? json_decode($content, true) : $this->cleanResultObject(json_decode($content)); // Return the sanitized result
return json_decode($content, true);
}
/**
@@ -760,10 +704,56 @@ class TransmissionRPC implements AbstractClientInterface
}
/**
* @inheritDoc
* 抽象方法,子类实现
*/
public function status()
{
return isset($this->sstats()->result) ? $this->sstats()->result : 'error';
$rs = $this->sstats();
return isset($rs['result']) ? $rs['result'] : 'error';
}
/**
* 抽象方法,子类实现
*/
public function getList(&$move = array())
{
$ids = array();
$fields = array( "id", "status", "name", "hashString", "downloadDir", "torrentFile" );
$res = $this->get($ids, $fields);
if (isset($res['result']) && $res['result'] == 'success') {
// 成功
} else {
// 失败
echo "获取种子列表失败可能transmission暂时无响应请稍后重试".PHP_EOL;
return array();
}
if (empty($res['arguments']['torrents'])) {
echo "未获取到正常做种数据,请多保种,然后重试!".PHP_EOL;
return array();
}
$res = $res['arguments']['torrents'];
// 过滤,只保留正常做种
$res = array_filter($res, function ($v) {
return isset($v['status']) && $v['status']===6;
}, ARRAY_FILTER_USE_BOTH);
if (empty($res)) {
echo "未获取到正常做种数据,请多保种,然后重试!".PHP_EOL;
return array();
}
// 提取数组hashString
$info_hash = array_column($res, 'hashString');
// 升序排序
sort($info_hash);
$json = json_encode($info_hash, JSON_UNESCAPED_UNICODE);
// 去重 应该从文件读入,防止重复提交
$sha1 = sha1($json);
// 组装返回数据
$hashArray['hash'] = $json;
$hashArray['sha1'] = $sha1;
// 变换数组hashString为键
$hashArray['hashString'] = array_column($res, "downloadDir", 'hashString');
$move = array_column($res, null, 'hashString');
return $hashArray;
}
}

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

@@ -0,0 +1,276 @@
<?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
@@ -136,7 +140,7 @@ function send($site = '', $torrent = array())
* @param string $method
* @return mixed 返回的数据
*/
function download($url, $cookies, $useragent, $method = 'GET')
function download($url, $cookies='', $useragent='', $method = 'GET')
{
$header = array(
"Content-Type:application/x-www-form-urlencoded",
@@ -192,6 +196,38 @@ 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 站点标识
@@ -286,22 +322,26 @@ function filter($site = '', $torrent = array())
}
/**
* transmission过滤函数只保留正常做种
* 日志记录函数
*/
function filterStatus($v)
function wlog($data='', $name = '', $path = '')
{
return isset($v['status']) && $v['status']===6;
}
/**
* qBittorrent过滤函数只保留正常做种
*/
function qbfilterStatus($v)
{
if (isset($v['state']) && in_array($v['state'], array('uploading','stalledUP','pausedUP','queuedUP','checkingUP','forcedUP'))) {
return true;
// 数据转换
if (is_bool($data)) {
$show_data=$data ? 'true' : 'false';
} elseif (is_null($data)) {
$show_data='null';
} else {
$show_data=print_r($data, true);
}
return false;
// 写入日志
$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;
}
//PHP stdClass Object转array
@@ -317,3 +357,94 @@ 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; //i列、j序号、k行
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

@@ -3,7 +3,6 @@
"ext-json": "*",
"ext-mbstring": "*",
"ext-curl": "*",
"owner888/phpspider": "^2.1",
"curl/curl": "^2.2"
},
"autoload": {

60
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "32806a4860870f6306b69cf349584387",
"content-hash": "10281f19c929443b7db18d1ab159ec63",
"packages": [
{
"name": "curl/curl",
@@ -66,58 +66,6 @@
"dot"
],
"time": "2018-12-04T19:47:03+00:00"
},
{
"name": "owner888/phpspider",
"version": "v2.1.6",
"source": {
"type": "git",
"url": "https://github.com/owner888/phpspider.git",
"reference": "e6021148adec201418c16ba26f39bc013ba5b4d9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/owner888/phpspider/zipball/e6021148adec201418c16ba26f39bc013ba5b4d9",
"reference": "e6021148adec201418c16ba26f39bc013ba5b4d9",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.5.0"
},
"suggest": {
"ext-pcntl、ext-redis": "For better performance. "
},
"type": "library",
"autoload": {
"psr-4": {
"phpspider\\": "./"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Seatle Yang",
"email": "seatle@foxmail.com",
"homepage": "http://www.phpspider.org",
"role": "Developer"
}
],
"description": "The PHPSpider Framework.",
"homepage": "http://www.phpspider.org",
"keywords": [
"framework",
"phpspider"
],
"time": "2018-08-15T08:04:29+00:00"
}
],
"packages-dev": [],
@@ -126,6 +74,10 @@
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform": {
"ext-json": "*",
"ext-mbstring": "*",
"ext-curl": "*"
},
"platform-dev": []
}

View File

@@ -3,7 +3,15 @@
* 技术讨论及后续更新请加入QQ群
群名称IYUU自动辅种交流
QQ群号859882209
* 手动配置方法,请查看:https://www.iyuu.cn/archives/324/
* IYUU自动辅种工具--最简配置(所有平台通用教程) https://www.iyuu.cn/archives/324/
* IYUU自动辅种工具--如何下载最新源码? https://www.iyuu.cn/archives/338/
* IYUU自动辅种工具--合作站点鉴权配置说明 https://www.iyuu.cn/archives/337/
* IYUU自动下载种子之RSS订阅使用教程 https://www.iyuu.cn/archives/349/
* IYUU自动转移做种客户端-使用教程 https://www.iyuu.cn/archives/351/
脚本仓库下载法:
git clone https://github.com/ledccn/IYUUAutoReseed
cd IYUUAutoReseed
composer install
*/
return array(
// 1.【必须配置】爱语飞飞 微信通知请访问https://iyuu.cn 用微信扫码申请
@@ -25,22 +33,50 @@ return array(
'host' => 'http://127.0.0.1:9091/transmission/rpc', // 警告注意transmission/rpc这段别动你只需要修改 127.0.0.1:9091
'username' => '',
'password' => '',
'BT_backup' => '/var/lib/transmission/torrents', // 移动做种:如果脚本与当前客户端不在一台机器,必须配置
'move' => 0, // 0不移动1移动并辅种2移动仅辅种自身3未定义
),
# 结束
# 开始
array(
'type' => 'qBittorrent', // 支持transmission、qBittorrent
'host' => 'http://www.baidu.com:8083',
'host' => 'http://127.0.0.1:8083',
'username' => '',
'password' => '',
'BT_backup' => 'C:\Users\ASUS\AppData\Local\qBittorrent\BT_backup', // 移动做种:必须配置
'move' => 0, // 0不移动1移动并辅种2移动仅辅种自身3未定义
),
# 结束
// 全局客户端设置 结束
),
// 移动做种必须配置
'move' =>array(
'type' => 2, // 0保持不变1减2加 3直接替换
'type' => 0, // 0保持不变1减2加3替换
'path' =>array(
'/sda1' => '/volume1',
// 当前路径 => 目标路径
'/downloads' => '/volume1',
),
'skip_check' => 0, //转移成功,跳校验
'delete_torrent' => 0, //转移成功,删除当前做种
),
'workingMode' => 0,
'watch' => '/volume1/downloads',
'filter' => array(
'size'=>array(
'min' => '1GB',
'max' => '280GB',
),
'seeders'=>array(
'min' => 1,
'max' => 3,
),
'leechers'=>array(
'min' => 0,
'max' => 10000,
),
'completed'=>array(
'min' => 0,
'max' => 10000,
),
),
'CONNECTTIMEOUT'=> 60,
@@ -58,6 +94,23 @@ return array(
'passkey' => '',
// 种子Tracker的IP地址选择 可选ipv4ipv6
'ip_type' => 'ipv4',
'clients' => array(
array(
'type' => 'transmission', // 支持transmission、qBittorrent
'host' => 'http://127.0.0.1:9091/transmission/rpc', // 警告注意transmission/rpc这段别动你只需要修改 127.0.0.1:9091
'username' => '',
'password' => '',
'downloadDir'=> '',
),
),
'workingMode' => 1,
'watch' => '',
'filter' => array(
'size'=>array(
'min' => '1GB',
'max' => '280GB',
),
),
),
// keepfrds 序号2
'keepfrds' => array(
@@ -65,6 +118,14 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'workingMode' => 1,
'watch' => '',
'filter' => array(
'size'=>array(
'min' => '1GB',
'max' => '280GB',
),
),
),
// ourbits 序号3
'ourbits' => array(
@@ -74,6 +135,14 @@ return array(
'passkey' => '',
'id' => 0, // 用户ID
'is_vip' => 0, // 是否具有VIP或特殊权限0 普通1 VIP
'workingMode' => 0,
'watch' => '/root/downloads',
'filter' => array(
'size'=>array(
'min' => '1GB',
'max' => '280GB',
),
),
),
// HDSky 序号4
'hdsky' => array(
@@ -153,6 +222,8 @@ return array(
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
// 如果需要rss订阅必须配置
'rss' => '',
),
// nanyangpt 序号15
'nanyangpt' => array(
@@ -273,7 +344,7 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// hdbug 序号32
// hddisk.life 序号32
'hdbug' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
@@ -308,7 +379,7 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// upxin 序号37
// hdu 序号37
'upxin' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
@@ -357,6 +428,41 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// byr 序号44 北邮
'byr' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// CCFBits 序号45
'ccfbits' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// hdbits 序号46
'hdbits' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// PTPBD 序号47
'ptpbd' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// HD-T 序号48
'hd-torrents' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// 配置文件结束
);

View File

@@ -1,17 +1,13 @@
<?php
//----------------------------------
// 公共入口文件
//----------------------------------
// 定义目录
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);
// 严格开发模式
error_reporting(E_ALL);
#ini_set('display_errors', 1);
ini_set('display_errors', 1);
// 永不超时
ini_set('max_execution_time', 0);
@@ -28,7 +24,7 @@ if (PHP_SAPI != 'cli') {
// 设置时区
date_default_timezone_set('Asia/Shanghai');
echo microtime(true).' 环境变量初始化完成!'.PHP_EOL;
// 系统配置
if (file_exists(ROOT_PATH."/config/config.php")) {
// 配置(全局变量)
@@ -36,15 +32,26 @@ if (file_exists(ROOT_PATH."/config/config.php")) {
} else {
// 示例配置
$configALL = require_once ROOT_PATH . '/config/config.sample.php';
echo microtime(true).' 缺少config.php已载入config.sample.php示例配置。'.PHP_EOL;
echo microtime(true).' 请把配置文件改名为config.php以免后续版本升级覆盖配置'.PHP_EOL;
$t = 30;
do {
echo microtime(true)." 请把配置文件改名为config.php{$t}秒后继续...".PHP_EOL;
sleep(1);
} while (--$t > 0);
}
echo microtime(true).' 全局配置载入完成!'.PHP_EOL;
// 读取支持列表
if (is_file(ROOT_PATH . "/config/sites.json")) {
$sitesJson = file_get_contents(ROOT_PATH . "/config/sites.json");
$configALL['sitesALL'] = json_decode($sitesJson, true);
echo microtime(true).' 支持站点JSON载入完成'.PHP_EOL;
}
echo microtime(true).' 正在加载composer包管理器...'.PHP_EOL;
require_once ROOT_PATH . '/vendor/autoload.php';
AutoReseed::init();
$hashArray = AutoReseed::get();
if (AutoReseed::$move != null) {
echo "种子移动完毕,请重新编辑配置,再尝试辅种! \n\n";
exit;
echo microtime(true).' composer依赖载入完成'.PHP_EOL;
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();

8
iyuu.php Normal file
View File

@@ -0,0 +1,8 @@
<?php
require_once __DIR__ . '/init.php';
use IYUU\AutoReseed;
echo microtime(true).' IYUU自动辅种正在初始化...'.PHP_EOL;
AutoReseed::init();
AutoReseed::call();
exit(0);

View File

@@ -29,20 +29,31 @@ 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圣城(已删除)、北邮、CCFBits
## 运行环境
所有具备PHP运行环境的所有平台官方下载的记得开启crul、fileinfo、mbstring这3个扩展。
例如Linux、Windows、MacOS
具备PHP运行环境的所有平台例如Linux、Windows、MacOS
官方下载的记得开启crul、fileinfo、mbstring这3个扩展。
1. Windows下安装php环境https://www.php.net/downloads
## 下载源码
- github仓库https://github.com/ledccn/IYUUAutoReseed
- 码云仓库https://gitee.com/ledc/IYUUAutoReseed
- 仓库下载的源码缺少vendor目录可以去群内下载或者通过安装php包管理器composer进到源码目录内执行命令`composer install`会自动帮你安装vendor目录。
## 使用方法
详见Wiki https://gitee.com/ledc/IYUUAutoReseed/wikis
详见Wiki
https://gitee.com/ledc/IYUUAutoReseed/wikis
https://gitee.com/ledc/IYUUAutoReseed/tree/master/wiki
## 接口开发文档
http://api.iyuu.cn/docs.php?type=expand
## 需求提交/错误反馈
- 点击链接加入群聊【IYUU自动辅种交流】[https://jq.qq.com/?_wv=1027&k=5JOfOlM][1]
@@ -57,8 +68,6 @@ IYUU自动辅种工具英文名IYUUAutoReseed是一款PHP语言编
**您所有的打赏将用于服务器续期,增加服务的延续性。**
![微信打赏.png][2]
## 捐赠者列表
感谢以下捐赠者,排名不分先后!
@@ -100,6 +109,18 @@ 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 |
| 小城流水 | ¥5元 | 2020年1月22日22:14 |
| 国旗(未署名) | ¥8.8元 | 2020年1月22日23:28 |
| 当下丶 | ¥100元 | 2020年1月28日1:45 |
| 陈君政 | ¥10元 | 2020年2月3日11:32 |
| 不寐夜游 | ¥10元 | 2020年2月8日17:17 |
| Jack | ¥10元 | 2020年2月13日08:05 |
| 陈伟平 | ¥28.88元 | 2020年2月13日12:35 |
| PhalApi Pro商业授权 | ¥-950元 | 2020年2月14日21:56 |
| jonnaszheng | ¥10元 | 2020年2月15日10:25 |
补充说明:

View File

@@ -0,0 +1,170 @@
IYUU新推出RSS订阅功能
## 功能
自动订阅站点的新种,自动添加下载任务,支持大小过滤。
## 优势
1.弥补部分下载器没有RSS订阅的缺陷
2.与下载器本身的RSS功能相比IYUU自动RSS订阅支持远程连接下载器支持下载器多盘位、支持多目录支持筛选支持下载器集群
## 需要配置什么?
1.必须配置各站的`passkey`秘钥,从各站点的`控制面板`复制到配置文件内对应站点`passkey`处即可;
2.TTG的密钥比较特殊请从RSS链接处复制并给站点配置加一个`rss`配置项详情参考示例配置文件TTG配置
前期如果你正确使用了`IYUUAutoReseed自动辅种工具`的话,本部分就非常简单了。
----------
## 如何配置`workingMode`工作模式、`watch`监控目录、`cliects`下载器?
### 第一步完善全局配置
```php
'default' => array(
// 5.【必须配置】浏览器UA打开http://demo.iyuu.cn 复制过来即可
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',
// 6.【自动辅种必须配置】全局客户端设置(条目不够可以复制)
'clients' => array(
// 全局客户端设置 开始
# 开始
array(
'type' => 'transmission', // 支持transmission、qBittorrent
'host' => 'http://127.0.0.1:9091/transmission/rpc', // 警告注意transmission/rpc这段别动你只需要修改 127.0.0.1:9091
'username' => '',
'password' => '',
),
# 结束
# 开始
array(
'type' => 'qBittorrent', // 支持transmission、qBittorrent
'host' => 'http://www.baidu.com:8083',
'username' => '',
'password' => '',
),
# 结束
// 全局客户端设置 结束
),
'move' =>array(
'type' => 2, // 0保持不变1减2加 3直接替换
'path' =>array(
'/sda1' => '/volume1',
),
),
'workingMode' => 0,
'watch' => '/volume1/downloads',
'filter' => array(
'size'=>array(
'min' => '10GB',
'max' => '280GB',
),
'seeders'=>array(
'min' => 1,
'max' => 3,
),
'leechers'=>array(
'min' => 0,
'max' => 10000,
),
'completed'=>array(
'min' => 0,
'max' => 10000,
),
),
'CONNECTTIMEOUT'=> 60,
'TIMEOUT' => 600,
),
```
----------
### 第二步完善站点配置示例配置m-team
本部分以馒头为例,讲解`工作模式1负载均衡`
关键地方:`clients``workingMode``watch``filter`
- 全局已经配置clients两个用来辅种站点单独配置clients一个用来下载在RSS订阅添加下载任务时**以站点单独配置的clients为准**。
- `workingMode=>1,` 代表当前站点将会工作在模式1
- `watch=>''` 因为站点工作在模式1配置了也无效**留空即可**
- 全局和站点都配置filter该站点RSS订阅添加下载任务时**过滤规则以站点配置为准**
下面是m-team的示例配置代码。
```php
'm-team' => array(
// 14.m-team的cookie 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => 'tp=',
// 15.m-team的passkey 【必须配置】
'passkey' => '',
// 种子Tracker的IP地址选择 可选ipv4ipv6
'ip_type' => 'ipv4',
'clients' => array(
array(
'type' => 'transmission', // 支持transmission、qBittorrent
'host' => 'http://127.0.0.1:9091/transmission/rpc', // 警告注意transmission/rpc这段别动你只需要修改 127.0.0.1:9091
'username' => '',
'password' => '',
),
),
'workingMode' => 1,
'watch' => '',
'filter' => array(
'size'=>array(
'min' => '1GB',
'max' => '280GB',
),
),
),
```
----------
### 第三步完善站点配置示例配置keepfrds
本部分以朋友为例讲解工作模式1负载均衡
关键地方:`clients``workingMode``watch``filter`
- 全局已经配置clients两个用来辅种**站点没有单独配置clients在RSS订阅添加下载任务时以全局配置的clients为准**。
- `workingMode=>1,` 代表当前站点将会工作在模式1
- `watch=>''` 因为站点工作在模式1配置了也无效**留空即可**
- 全局和站点都配置filter该站点RSS订阅添加下载任务时**过滤规则以站点配置为准**
下面是keepfrds的示例配置代码。
```php
'keepfrds' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'workingMode' => 1,
'watch' => '',
'filter' => array(
'size'=>array(
'min' => '1GB',
'max' => '280GB',
),
),
),
```
----------
### 第四步完善站点配置示例配置ourbits
本部分以我堡为例讲解工作模式0watch监控目录
关键地方:`workingMode``watch``filter`
- `workingMode=>0,` 代表当前站点将会工作在模式0**脚本会往指定的watch目录内下载种子**,由下载器添加下载任务;
- `watch=>'/root/downloads'` 脚本会往`/root/downloads`目录内下载种子,由下载器添加下载任务;
- 全局和站点都配置filter该站点RSS订阅添加下载任务时**过滤规则以站点配置为准**
下面是ourbits的示例配置代码。
```php
'ourbits' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'id' => 0, // 用户ID
'is_vip' => 0, // 是否具有VIP或特殊权限0 普通1 VIP
'workingMode' => 0,
'watch' => '/root/downloads',
'filter' => array(
'size'=>array(
'min' => '1GB',
'max' => '280GB',
),
),
),
```
**总结以上概况讲解了RSS订阅下载、下载免费种时的各种配置的情况请仔细阅读务必理解**

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,22 +6,21 @@ 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
![编辑配置4.png][5]
`passkey`,在你的控制面板 - 密钥
`is_vip`,根据你的实际情况填写,因站点有下载种子的流控,如果你不在限制之列,可以`设置为1`
`id`,为用户中心打开后,浏览器地址栏**http://xxxxx.xxx/userdetails.php?id=`46880`**等号=后面的几个数字,如图:
![编辑配置6.png][6]
到此,配置文件编辑完毕,请记得保存。
如果提示保存格式请保存为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

@@ -28,24 +28,6 @@
按站内说明修改下载器所在设备的HOST或者在具备修改HOST功能的路由器内修改。
#### 问:我拥有辅种时自动跳过站点的特殊权限,如何设置为可以辅种呢?
答:在站点的独立配置区域,添加一行代码`'is_vip' => 1,`即可。例如Ourbits
```php
// ourbits
'ourbits' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
'id' => 46880, // 用户ID
'is_vip' => 1, // 是否具有VIP或特殊权限0 普通1 VIP
),
```
#### 问:如何升级到最新版本?
从github或码云仓库下载最新的源码覆盖到本地即可。
@@ -81,6 +63,22 @@
请退出登录在登录时勾选下面两个SSL的选项登录后复制cookie重新配置。
#### 问IYUU自动辅种失败怎么排查问题
1.输入种子链接,手动方法,看看种子是否还在?
2.手动下载种子,看看是否出现了下载种子的提示页?
3.瓷器、城市需要cookie辅种请检查cookie是否配置正确如果下载出现提示页面需要更新配置内的cookie、更新cookie
如果整个站都失败,请按以上步骤排查。
#### 问Windows下执行脚本时乱码
用cmd和powershell执行脚本中文输出乱码由于我是写php脚本的非常喜欢国际化的uft8编码。注册表修改有些可以有些不可以直接在控制面板修改。
控制面板\时钟和区域\区域\管理\更改系统区域设置\勾选beta版:使用unicode-utf8全球语言支持,保存重启即可仅支持win10
#### 问:如何反馈问题?
1、点击链接加入群聊【IYUU自动辅种交流】[https://jq.qq.com/?_wv=1027&k=5JOfOlM][1]

View File

@@ -8,8 +8,8 @@
| 自动辅种结束微信通知 | 已完成 | 2019年12月25日 | 2019年12月27日 |
| 做种客户端间转移 | 已完成 | 2019年12月25日 | 2020年1月14日 |
| 手动辅种按目录分组 | 已完成 | 2019年12月26日 | 2020年1月14日 |
| 自动转移客户端 | 已完成 | 2020年1月27日 | 2020年1月29日 |
| WEB页面生成配置 | 暂未开始 | | |
| 自动转移客户端 | 暂未开始 | | |
| 脚本docker容器化 | 暂未开始 | | |
| 浏览器插件 | 暂未开始 | | |
| 合集自动拆包辅种 | 暂未开始 | | |

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,23 @@
### 2020年1月30日
新增CCFBits站点辅种
### 2020年1月28日
新增:北邮站点辅种
新增:做种客户端转移功能
优化:删除用不到的依赖包
### 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
@@ -79,7 +79,7 @@ IYUU自动辅种工具、Ourbits双方达成合作可以对使用接口的用
## Windows安装PHP运行环境
也可以去官方下载【https://www.php.net/downloads】官方下载的记得开启`curl、fileinfo、mbstring`这3个扩展。
另外我打包了一份,下载地址:
微云链接https://share.weiyun.com/5EiXLfn 密码ezsvnb
微云链接https://share.weiyun.com/5I13dek 密码utcjsx
下载回来是一个ZIP压缩包解压到`D:\IYUUAutoReseed\`目录内,文件结构如图:
![编辑配置7.png][12]
点击红框内`执行辅种`即可。

4
执行辅种.cmd Normal file
View File

@@ -0,0 +1,4 @@
@echo off
chcp 65001
%cd%\php-7.4.2-nts-Win32-vc15-x86\php %cd%\iyuu.php
pause

4
计划任务.cmd Normal file
View File

@@ -0,0 +1,4 @@
@echo off
chcp 65001
D:\IYUUAutoReseed\php-7.4.2-nts-Win32-vc15-x86\php.exe D:\IYUUAutoReseed\iyuu.php
exit