Compare commits

..

66 Commits

Author SHA1 Message Date
iyuu.cn
426e47337d 版本号升级至1.5.0
新增海豚音乐
2020-02-21 06:46:53 +08:00
iyuu.cn
37809f7bfe 新增海豚音乐示例配置 2020-02-21 06:42:54 +08:00
iyuu.cn
721aaf217b 新增海豚音乐dicmusic,更新捐赠名单 2020-02-21 06:42:35 +08:00
iyuu.cn
aa18b23dbb 增加转移做种搜索目录命令find / -name BT_backup 2020-02-20 21:03:31 +08:00
iyuu.cn
4d452e3909 优化大于一万条做种,防止精简配置,导致超时设置无效。 2020-02-20 18:09:50 +08:00
iyuu.cn
741ccb4fb4 优化大于一万条做种时辅种失败问题。 2020-02-20 17:49:50 +08:00
iyuu.cn
e336970fca 小钢炮使用docker版qb 4.1.6 简明教程 2020-02-20 17:48:24 +08:00
iyuu.cn
0321deee01 小钢炮qBittorrent连接失败的处理办法 2020-02-20 17:05:57 +08:00
iyuu.cn
08ef3769c2 删除示例配置圣城cnscg 2020-02-20 16:33:31 +08:00
iyuu.cn
1355398f76 修复扩展参数extra_options错误 2020-02-20 16:13:15 +08:00
iyuu.cn
53533df4b9 新增两个API接口 2020-02-20 09:20:16 +08:00
iyuu.cn
53902ee878 优化https判断 2020-02-20 06:52:31 +08:00
iyuu.cn
60430f6550 代码格式化 2020-02-19 13:33:58 +08:00
iyuu.cn
9445547378 修复transmission添加任务后,ID无法显示的bug 2020-02-19 02:45:27 +08:00
iyuu.cn
8ba1ef1ff4 新增docker容器安装使用方法 2020-02-18 21:23:19 +08:00
iyuu.cn
ca148bac6b 更新忽略列表 2020-02-18 18:02:40 +08:00
iyuu.cn
3393eae7e7 新增做种列表备份功能,便于紧急恢复。 2020-02-18 16:02:16 +08:00
iyuu.cn
06c00f88dc 增加版本号,用于服务器端限定 2020-02-18 15:08:57 +08:00
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
27 changed files with 1259 additions and 788 deletions

9
.gitignore vendored
View File

@@ -1,9 +0,0 @@
/torrent
/config/config.php
/php-7.2.12-nts
/*.bat
/*.sh
/vendor
.idea
.php_cs.cache
/config/sites.json

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,20 +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;
@@ -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());
@@ -301,10 +295,56 @@ class qBittorrent implements AbstractClientInterface
}
/**
* @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);
}
/**
@@ -714,10 +658,6 @@ 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) {
@@ -764,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;
}
}

View File

@@ -124,8 +124,7 @@ class Table
$this->rows = $rows;
$this->cellAlign = $align;
foreach ($rows as $row)
{
foreach ($rows as $row) {
$this->checkColWidth($row);
}
}
@@ -138,12 +137,9 @@ class Table
*/
protected function checkColWidth($row)
{
if (is_array($row))
{
foreach ($row as $key => $cell)
{
if (!isset($this->colWidth[$key]) || strlen($cell) > $this->colWidth[$key])
{
if (is_array($row)) {
foreach ($row as $key => $cell) {
if (!isset($this->colWidth[$key]) || strlen($cell) > $this->colWidth[$key]) {
$this->colWidth[$key] = strlen($cell);
}
}
@@ -159,12 +155,9 @@ class Table
*/
public function addRow($row, $first = false)
{
if ($first)
{
if ($first) {
array_unshift($this->rows, $row);
}
else
{
} else {
$this->rows[] = $row;
}
@@ -193,8 +186,7 @@ class Table
$style = $this->getStyle($pos);
$array = [];
foreach ($this->colWidth as $width)
{
foreach ($this->colWidth as $width) {
$array[] = str_repeat($style[1], $width + 2);
}
@@ -211,17 +203,14 @@ class Table
$style = $this->getStyle('cell');
$content = $this->renderSeparator('top');
foreach ($this->header as $key => $header)
{
foreach ($this->header as $key => $header) {
$array[] = ' ' . str_pad($header, $this->colWidth[$key], $style[1], $this->headerAlign);
}
if (!empty($array))
{
if (!empty($array)) {
$content .= $style[0] . implode(' ' . $style[2], $array) . ' ' . $style[3] . PHP_EOL;
if ($this->rows)
{
if ($this->rows) {
$content .= $this->renderSeparator('middle');
}
}
@@ -231,12 +220,9 @@ class Table
protected function getStyle($style)
{
if ($this->format[$this->style])
{
if ($this->format[$this->style]) {
$style = $this->format[$this->style][$style];
}
else
{
} else {
$style = [' ', ' ', ' ', ' '];
}
@@ -251,8 +237,7 @@ class Table
*/
public function render($dataList = [])
{
if ($dataList)
{
if ($dataList) {
$this->setRows($dataList);
}
@@ -260,35 +245,26 @@ class Table
$content = $this->renderHeader();
$style = $this->getStyle('cell');
if ($this->rows)
{
foreach ($this->rows as $row)
{
if (is_string($row) && '-' === $row)
{
if ($this->rows) {
foreach ($this->rows as $row) {
if (is_string($row) && '-' === $row) {
$content .= $this->renderSeparator('middle');
}
elseif (is_scalar($row))
{
} 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;
}));
return $a + $b;
}));
$content .= $style[0] . ' ' . $array . ' ' . $style[3] . PHP_EOL;
$content .= $this->renderSeparator('cross-bottom');
}
else
{
} else {
$array = [];
foreach ($row as $key => $val)
{
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;
}
}
}
@@ -297,4 +273,4 @@ class Table
return $content;
}
}
}

View File

@@ -140,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",
@@ -149,7 +149,7 @@ function download($url, $cookies, $useragent, $method = 'GET')
if ($method === 'POST') {
curl_setopt($ch, CURLOPT_POST, true);
}
if (stripos($url, 'https://') !== false) {
if (stripos($url, 'https://') === 0) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSLVERSION, 1);
@@ -198,16 +198,17 @@ function convertToMB($from)
/**
* 字节数Byte转换为KB、MB、GB、TB
*
*
*/
function getFilesize($num){
function getFilesize($num)
{
$p = 0;
$format='bytes';
if($num>0 && $num<1024){
if ($num>0 && $num<1024) {
$p = 0;
return number_format($num).' '.$format;
}
if($num>=1024 && $num<pow(1024, 2)){
if ($num>=1024 && $num<pow(1024, 2)) {
$p = 1;
$format = 'KB';
}
@@ -323,7 +324,8 @@ function filter($site = '', $torrent = array())
/**
* 日志记录函数
*/
function wlog($data='',$name = '',$path = ''){
function wlog($data='', $name = '', $path = '')
{
// 数据转换
if (is_bool($data)) {
$show_data=$data ? 'true' : 'false';
@@ -336,29 +338,11 @@ function wlog($data='',$name = '',$path = ''){
$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);
$file_pointer = @fopen($myfile, "a");
$worldsnum = @fwrite($file_pointer, $show_data);
@fclose($file_pointer);
return $worldsnum;
}
/**
* transmission过滤函数只保留正常做种
*/
function filterStatus($v)
{
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;
}
return false;
}
//PHP stdClass Object转array
function object_array($array)
@@ -389,22 +373,23 @@ function oddFilter($var)
*/
function evenFilter($var)
{
// 返回$var最后一个二进制位
// 返回$var最后一个二进制位
// 为0则保留偶数的二进制的最后一位肯定是0
return(!($var & 1));
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);
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);
}
/**
@@ -412,15 +397,17 @@ function sign( $timestamp ){
* 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 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()){
function ShowTableSites($dir = 'Protocols', $filter = array())
{
// 过滤的文件
switch ($dir) {
case 'Protocols':
@@ -434,31 +421,30 @@ function ShowTableSites($dir = 'Protocols',$filter = array()){
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);
$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 (in_array($start_file, $filter)) {
continue;
}
// 控制多少列
if ($i > 4) {
$k++;
$i = 0;
if ($i > 4) {
$k++;
$i = 0;
}
$i++;
$j++;
$data[$k][] = $j.". ".$start_file;
}
//输出表格
$table = new Table();
$table->setRows($data);
echo($table->render());
$j++;
$data[$k][] = $j.". ".$start_file;
}
//输出表格
$table = new Table();
$table->setRows($data);
echo($table->render());
}

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', // 移动做种必须配置Linux搜索方法find / -name 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(
@@ -308,7 +379,7 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// upxin 序号37
// hdu 序号37
'upxin' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
@@ -336,13 +407,6 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// cnscg 序号41 圣城
'cnscg' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// nicept 序号42 老师
'nicept' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
@@ -357,6 +421,49 @@ 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' => '',
),
// dicmusic 序号49 海豚
'dicmusic' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '', // authkey
'torrent_pass' => '', // torrent_pass
),
// 配置文件结束
);

3
docker/Dockerfile Normal file
View File

@@ -0,0 +1,3 @@
FROM php:7.4-fpm
EXPOSE 9000
WORKDIR /var/www

View File

@@ -0,0 +1,51 @@
# IYUUAutoReseed自动辅种docker安装教程
第一步复制docker目录到您的Linux的任意目录内
第二步:给予`build.sh``iyuu.sh`可执行权限;
第三步:编译镜像并运行容器,命令为:`./build.sh` 耐心等待完成;
第四步:测试是否安装完成,命令为:`./iyuu.sh`
然后看教程https://www.iyuu.cn/archives/324/,来编辑配置即可。
#### 必读:脚本会在`/root`目录,创建`IYUUAutoReseed`文件夹,您只需要按照上述教程编辑好配置,放到`/root/IYUUAutoReseed/config/config.php`
### 辅种时执行的命令:`iyuu.sh`
## 如何定时辅种?
`iyuu.sh`加入Linux计划任务内。
## 小钢炮qBittorrent连接失败
v4.1.5无法连接请安装灯大高版本的qbittorrent做种列表不丢失且不用校验。
```sh
IMAGE_NAME=80x86/qbittorrent
WEB_PORT=8083
DOWNLOAD_PATH=$(cat /var/lib/qbittorrent/.config/qBittorrent/qBittorrent.conf | grep -i 'Downloads\\SavePath' | cut -d'=' -f2)
BT_PORT=8999
QBT_AUTH_SERVER_ADDR=$(ip -4 addr show docker0 | grep inet | awk '{print $2}' | cut -d'/' -f1)
docker run -d --name qbittorrent \
-e PUID=$(id -u qbittorrent) \
-e PGID=$(cat /etc/group | grep -e '^users' | cut -d':' -f3) \
-e WEB_PORT=$WEB_PORT \
-e BT_PORT=$BT_PORT \
-e QBT_AUTH_SERVER_ADDR=$QBT_AUTH_SERVER_ADDR \
--restart unless-stopped \
-p $WEB_PORT:$WEB_PORT -p $BT_PORT:$BT_PORT/tcp -p $BT_PORT:$BT_PORT/udp \
-v /var/lib/qbittorrent/.config/qBittorrent:/config \
-v /var/lib/qbittorrent/.local/share/data/qBittorrent:/data \
-v "$DOWNLOAD_PATH":/downloads \
--mount type=tmpfs,destination=/tmp \
${IMAGE_NAME}
```

6
docker/build.sh Normal file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
curl -o ./IYUUAutoReseed.zip http://api.iyuu.cn/IYUUAutoReseed.zip
unzip -o ./IYUUAutoReseed.zip -d /root
rm ./IYUUAutoReseed.zip
docker build -t iyuu:latest .
docker run -it -v /root/IYUUAutoReseed:/var/www -p 8510:9000 --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest

2
docker/iyuu.sh Normal file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
docker exec -it IYUUAutoReseed php iyuu.php

View File

@@ -1,7 +1,4 @@
<?php
//----------------------------------
// 公共入口文件
//----------------------------------
// 定义目录
defined('ROOT_PATH') or define("ROOT_PATH", __DIR__);
define('DS', DIRECTORY_SEPARATOR);
@@ -10,7 +7,7 @@ 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);
@@ -27,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")) {
// 配置(全局变量)
@@ -35,17 +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';
echo microtime(true).' composer依赖载入完成'.PHP_EOL;
global $argv;
$start_file = str_replace("\\","/",trim($argv[0]));
if( substr($start_file,-8)==="init.php" ){
$start_file = str_replace("\\", "/", trim($argv[0]));
if (substr($start_file, -8)==="init.php") {
require_once __DIR__ . '/iyuu.php';
}

View File

@@ -2,11 +2,7 @@
require_once __DIR__ . '/init.php';
use IYUU\AutoReseed;
echo microtime(true).' IYUU自动辅种正在初始化...'.PHP_EOL;
AutoReseed::init();
$hashArray = AutoReseed::get();
if (AutoReseed::$move != null) {
echo "种子移动完毕,请重新编辑配置,再尝试辅种! \n\n";
exit;
}
AutoReseed::call($hashArray);
AutoReseed::wechatMessage();
AutoReseed::call();
exit(0);

View File

@@ -29,10 +29,10 @@ 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、dicmusic
## 运行环境
所有具备PHP运行环境的所有平台例如Linux、Windows、MacOS
具备PHP运行环境的所有平台例如Linux、Windows、MacOS
官方下载的记得开启crul、fileinfo、mbstring这3个扩展。
@@ -42,9 +42,18 @@ IYUU自动辅种工具英文名IYUUAutoReseed是一款PHP语言编
## 下载源码
- 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]
@@ -59,8 +68,6 @@ IYUU自动辅种工具英文名IYUUAutoReseed是一款PHP语言编
**您所有的打赏将用于服务器续期,增加服务的延续性。**
![微信打赏.png][2]
## 捐赠者列表
感谢以下捐赠者,排名不分先后!
@@ -104,6 +111,24 @@ IYUU自动辅种工具英文名IYUUAutoReseed是一款PHP语言编
| 寒山先生 | ¥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 |
| Alpha | ¥10.81元 | 2020年1月24日20:23 |
| 羽生 | ¥88.88元 | 2020年1月24日21:06 |
| 当下丶 | ¥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 |
| weekendsd54zdk | ¥10元 | 2020年2月17日14:31 |
| 寒山先生 | ¥200元 | 2020年2月17日17:00 |
| PLC组态远程服务 | ¥8.88元 | 2020年2月18日02:14 |
| JeSsiE杰西 | ¥66元 | 2020年2月20日19:38 |
| 黄叶梓(炮王) | ¥10元 | 2020年2月20日21:10 |
| 里奥龙 | ¥88.8元 | 2020年2月20日21:48 |
补充说明:

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

@@ -12,7 +12,6 @@ IYUU自动辅种工具、Ourbits双方达成合作可以对使用接口的用
### 设置Ourbits
![编辑配置4.png][5]
`passkey`,在你的控制面板 - 密钥
`is_vip`,根据你的实际情况填写,因站点有下载种子的流控,如果你不在限制之列,可以`设置为1`
`id`,为用户中心打开后,浏览器地址栏**http://xxxxx.xxx/userdetails.php?id=`46880`**等号=后面的几个数字,如图:
![编辑配置6.png][6]

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或码云仓库下载最新的源码覆盖到本地即可。
@@ -87,7 +69,7 @@
2.手动下载种子,看看是否出现了下载种子的提示页?
3.瓷器、城市需要cookie辅种请检查cookie是否配置正确如果下载出现提示页面需要更新配置内的cookie、更新cookid
3.瓷器、城市需要cookie辅种请检查cookie是否配置正确如果下载出现提示页面需要更新配置内的cookie、更新cookie
如果整个站都失败,请按以上步骤排查。
@@ -97,6 +79,10 @@
控制面板\时钟和区域\区域\管理\更改系统区域设置\勾选beta版:使用unicode-utf8全球语言支持,保存重启即可仅支持win10
#### 问小钢炮qBittorrent原装v4.1.5版本无法连接的解决办法?
请按照这篇文章升级种子不用重新校验数据不丢失。小钢炮使用docker版qb 4.1.6 简明教程http://nanodm.net:8092/archives/43/
#### 问:如何反馈问题?
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,3 +1,15 @@
### 2020年1月30日
新增CCFBits站点辅种
### 2020年1月28日
新增:北邮站点辅种
新增:做种客户端转移功能
优化:删除用不到的依赖包
### 2020年1月21日
新增支持的站点列表json本地化

View File

@@ -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