mirror of
https://gitee.com/ledc/IYUUAutoReseed
synced 2025-08-25 15:34:52 +00:00
Compare commits
48 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
854121884b | ||
|
da88f3e7fc | ||
|
3abc02d660 | ||
|
339f1304c6 | ||
|
c4df9899c8 | ||
|
6494351ff3 | ||
|
e01dbfd601 | ||
|
940f948f43 | ||
|
958bef0dfa | ||
|
ea74b96293 | ||
|
94948610e4 | ||
|
0f1605ffca | ||
|
33ff8a991a | ||
|
877616214c | ||
|
aa4a8c76fe | ||
|
f6870a4e95 | ||
|
e073f165ac | ||
|
6144b8b301 | ||
|
658d764c26 | ||
|
2ce1920c51 | ||
|
ea158ddd55 | ||
|
76c0cefca2 | ||
|
a69a2c2955 | ||
|
7dc0c54c56 | ||
|
19197d36ce | ||
|
8561fac8c4 | ||
|
e4911871b8 | ||
|
a328f68178 | ||
|
ce65b5d1ff | ||
|
dff0c17b33 | ||
|
7dcd3e55f4 | ||
|
9027262f57 | ||
|
31d0e6ee03 | ||
|
076e688e1c | ||
|
c649c05a3a | ||
|
4896e08635 | ||
|
3b3289274b | ||
|
bf65f7039d | ||
|
0a7c2120a1 | ||
|
04a10295c2 | ||
|
3e75aec9d0 | ||
|
63ce263afb | ||
|
19df3f3cfb | ||
|
66490efad7 | ||
|
9044d3575e | ||
|
69ba1ebe56 | ||
|
978295b44d | ||
|
f3b4deae4c |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,9 +1,9 @@
|
|||||||
/torrent
|
/torrent
|
||||||
/config/config.php
|
/config/config.php
|
||||||
/php-7.2.12-nts
|
/config/sites.json
|
||||||
/*.bat
|
/*.bat
|
||||||
/*.sh
|
/*.sh
|
||||||
/vendor
|
|
||||||
.idea
|
.idea
|
||||||
.php_cs.cache
|
.php_cs.cache
|
||||||
/config/sites.json
|
vendor
|
||||||
|
php-7.4.2-nts-Win32-vc15-x86
|
||||||
|
File diff suppressed because it is too large
Load Diff
66
app/Client/AbstractClient.php
Normal file
66
app/Client/AbstractClient.php
Normal 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);
|
||||||
|
}
|
@@ -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();
|
|
||||||
}
|
|
@@ -2,12 +2,12 @@
|
|||||||
namespace IYUU\Client\qBittorrent;
|
namespace IYUU\Client\qBittorrent;
|
||||||
|
|
||||||
use Curl\Curl;
|
use Curl\Curl;
|
||||||
use IYUU\Client\AbstractClientInterface;
|
use IYUU\Client\AbstractClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* https://github.com/qbittorrent/qBittorrent/wiki/Web-API-Documentation
|
* https://github.com/qbittorrent/qBittorrent/wiki/Web-API-Documentation
|
||||||
*/
|
*/
|
||||||
class qBittorrent implements AbstractClientInterface
|
class qBittorrent extends AbstractClient
|
||||||
{
|
{
|
||||||
private $debug;
|
private $debug;
|
||||||
private $url;
|
private $url;
|
||||||
@@ -157,18 +157,12 @@ class qBittorrent implements AbstractClientInterface
|
|||||||
#$extra_options['skip_checking'] = 'true'; //跳校验
|
#$extra_options['skip_checking'] = 'true'; //跳校验
|
||||||
// 关键 上传文件流 multipart/form-data【严格按照api文档编写】
|
// 关键 上传文件流 multipart/form-data【严格按照api文档编写】
|
||||||
$post_data = $this->buildData($extra_options);
|
$post_data = $this->buildData($extra_options);
|
||||||
#p($post_data);
|
|
||||||
// 设置请求头
|
// 设置请求头
|
||||||
$this->curl->setHeader('Content-Type', 'multipart/form-data; boundary='.$this->delimiter);
|
$this->curl->setHeader('Content-Type', 'multipart/form-data; boundary='.$this->delimiter);
|
||||||
$this->curl->setHeader('Content-Length', strlen($post_data));
|
$this->curl->setHeader('Content-Length', strlen($post_data));
|
||||||
return $this->postData('torrent_add', $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)
|
public function torrentDeleteAll($deleteFiles = false)
|
||||||
{
|
{
|
||||||
$torrents = json_decode($this->torrentList());
|
$torrents = json_decode($this->torrentList());
|
||||||
@@ -301,10 +295,56 @@ class qBittorrent implements AbstractClientInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* 抽象方法,子类实现
|
||||||
*/
|
*/
|
||||||
public function status()
|
public function status()
|
||||||
{
|
{
|
||||||
return $this->appVersion();
|
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']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
* Time: 2020
|
* Time: 2020
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace IYUU\Client\Transmission;
|
namespace IYUU\Client\transmission;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the type of exception the TransmissionRPC class will throw
|
* This is the type of exception the TransmissionRPC class will throw
|
@@ -26,9 +26,9 @@
|
|||||||
* PHP Class support (PHP 5) (PHP 4 might work, untested)
|
* 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...
|
* A friendly little version check...
|
||||||
@@ -47,19 +47,13 @@ if (version_compare(PHP_VERSION, '5.2.10', '<')) {
|
|||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class TransmissionRPC implements AbstractClientInterface
|
class transmission extends AbstractClient
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* User agent used in all http communication
|
* User agent used in all http communication
|
||||||
*/
|
*/
|
||||||
const HTTP_UA = 'TransmissionRPC for PHP/0.3';
|
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 URL to the bittorent client you want to communicate with
|
||||||
* the port (default: 9091) can be set in you Transmission preferences
|
* the port (default: 9091) can be set in you Transmission preferences
|
||||||
@@ -79,12 +73,6 @@ class TransmissionRPC implements AbstractClientInterface
|
|||||||
*/
|
*/
|
||||||
public $password = '';
|
public $password = '';
|
||||||
|
|
||||||
/**
|
|
||||||
* Return results as an array, or an object (default)
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
public $return_as_array = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print debugging information, default is off
|
* Print debugging information, default is off
|
||||||
* @var bool
|
* @var bool
|
||||||
@@ -107,11 +95,16 @@ class TransmissionRPC implements AbstractClientInterface
|
|||||||
* Default values for stream context
|
* Default values for stream context
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $default_context_opts = array('http' => array(
|
private $default_context_opts = array(
|
||||||
'user_agent' => self::HTTP_UA,
|
'http' => array(
|
||||||
'timeout' => '60', // Don't want to be too slow
|
'user_agent' => self::HTTP_UA,
|
||||||
'ignore_errors' => true, // Leave the error parsing/handling to the code
|
'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
|
* Takes the connection parameters
|
||||||
*
|
*
|
||||||
* TODO: Sanitize username, password, and URL
|
|
||||||
*
|
|
||||||
* @param string $url
|
* @param string $url
|
||||||
* @param string $username
|
* @param string $username
|
||||||
* @param string $password
|
* @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;
|
$this->url = $url;
|
||||||
|
|
||||||
// Username & password
|
|
||||||
$this->username = $username;
|
$this->username = $username;
|
||||||
$this->password = $password;
|
$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)) {
|
if (!is_array($ids)) {
|
||||||
$ids = array($ids);
|
$ids = array($ids);
|
||||||
} // Convert $ids to an array if only a single id was passed
|
}
|
||||||
$request = array("ids" => $ids);
|
$request = array("ids" => $ids);
|
||||||
return $this->request("torrent-start", $request);
|
return $this->request("torrent-start", $request);
|
||||||
}
|
}
|
||||||
@@ -186,7 +165,7 @@ class TransmissionRPC implements AbstractClientInterface
|
|||||||
{
|
{
|
||||||
if (!is_array($ids)) {
|
if (!is_array($ids)) {
|
||||||
$ids = array($ids);
|
$ids = array($ids);
|
||||||
} // Convert $ids to an array if only a single id was passed
|
}
|
||||||
$request = array("ids" => $ids);
|
$request = array("ids" => $ids);
|
||||||
return $this->request("torrent-stop", $request);
|
return $this->request("torrent-stop", $request);
|
||||||
}
|
}
|
||||||
@@ -202,7 +181,7 @@ class TransmissionRPC implements AbstractClientInterface
|
|||||||
{
|
{
|
||||||
if (!is_array($ids)) {
|
if (!is_array($ids)) {
|
||||||
$ids = array($ids);
|
$ids = array($ids);
|
||||||
} // Convert $ids to an array if only a single id was passed
|
}
|
||||||
$request = array("ids" => $ids);
|
$request = array("ids" => $ids);
|
||||||
return $this->request("torrent-reannounce", $request);
|
return $this->request("torrent-reannounce", $request);
|
||||||
}
|
}
|
||||||
@@ -218,7 +197,7 @@ class TransmissionRPC implements AbstractClientInterface
|
|||||||
{
|
{
|
||||||
if (!is_array($ids)) {
|
if (!is_array($ids)) {
|
||||||
$ids = array($ids);
|
$ids = array($ids);
|
||||||
} // Convert $ids to an array if only a single id was passed
|
}
|
||||||
$request = array("ids" => $ids);
|
$request = array("ids" => $ids);
|
||||||
return $this->request("torrent-verify", $request);
|
return $this->request("torrent-verify", $request);
|
||||||
}
|
}
|
||||||
@@ -353,23 +332,6 @@ class TransmissionRPC implements AbstractClientInterface
|
|||||||
return $this->request("torrent-add", $extra_options);
|
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)
|
/* 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 torrent_location The URL or path to the torrent file
|
||||||
* @param save_path Folder to save torrent in
|
* @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);
|
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
|
* Remove torrent from transmission
|
||||||
*
|
*
|
||||||
@@ -388,7 +369,7 @@ class TransmissionRPC implements AbstractClientInterface
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws TransmissionRPCException
|
* @throws TransmissionRPCException
|
||||||
*/
|
*/
|
||||||
public function remove($ids, $delete_local_data = false)
|
public function delete($ids, $delete_local_data = false)
|
||||||
{
|
{
|
||||||
if (!is_array($ids)) {
|
if (!is_array($ids)) {
|
||||||
$ids = array($ids);
|
$ids = array($ids);
|
||||||
@@ -587,7 +568,8 @@ class TransmissionRPC implements AbstractClientInterface
|
|||||||
$array[$index] = ($value ? 1 : 0);
|
$array[$index] = ($value ? 1 : 0);
|
||||||
} // Store boolean values as 0 or 1
|
} // Store boolean values as 0 or 1
|
||||||
if (is_string($value)) {
|
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");
|
$array[$index] = mb_convert_encoding($value, "UTF-8");
|
||||||
//utf8_encode( $value ); // Make sure all data is UTF-8 encoded for Transmission
|
//utf8_encode( $value ); // Make sure all data is UTF-8 encoded for Transmission
|
||||||
}
|
}
|
||||||
@@ -596,50 +578,12 @@ class TransmissionRPC implements AbstractClientInterface
|
|||||||
return $array;
|
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 请求
|
* 执行 rpc 请求
|
||||||
*
|
*
|
||||||
* @param string $method 请求类型/方法, 详见 $this->allowMethods
|
* @param string $method 请求类型/方法, 详见 $this->allowMethods
|
||||||
* @param array $arguments 附加参数, 可选
|
* @param array $arguments 附加参数, 可选
|
||||||
* @return mixed
|
* @return array
|
||||||
* @throws TransmissionRPCException
|
* @throws TransmissionRPCException
|
||||||
*/
|
*/
|
||||||
protected function request($method, $arguments = array())
|
protected function request($method, $arguments = array())
|
||||||
@@ -687,9 +631,9 @@ class TransmissionRPC implements AbstractClientInterface
|
|||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
if (!$content) {
|
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)
|
// Setup authentication (if provided)
|
||||||
if ($this->username && $this->password) {
|
if ($this->username && $this->password) {
|
||||||
$contextopts['http']['header'] = sprintf("Authorization: Basic %s\r\n", base64_encode($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) {
|
if ($this->debug) {
|
||||||
@@ -764,10 +704,56 @@ class TransmissionRPC implements AbstractClientInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* 抽象方法,子类实现
|
||||||
*/
|
*/
|
||||||
public function status()
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -124,8 +124,7 @@ class Table
|
|||||||
$this->rows = $rows;
|
$this->rows = $rows;
|
||||||
$this->cellAlign = $align;
|
$this->cellAlign = $align;
|
||||||
|
|
||||||
foreach ($rows as $row)
|
foreach ($rows as $row) {
|
||||||
{
|
|
||||||
$this->checkColWidth($row);
|
$this->checkColWidth($row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,12 +137,9 @@ class Table
|
|||||||
*/
|
*/
|
||||||
protected function checkColWidth($row)
|
protected function checkColWidth($row)
|
||||||
{
|
{
|
||||||
if (is_array($row))
|
if (is_array($row)) {
|
||||||
{
|
foreach ($row as $key => $cell) {
|
||||||
foreach ($row as $key => $cell)
|
if (!isset($this->colWidth[$key]) || strlen($cell) > $this->colWidth[$key]) {
|
||||||
{
|
|
||||||
if (!isset($this->colWidth[$key]) || strlen($cell) > $this->colWidth[$key])
|
|
||||||
{
|
|
||||||
$this->colWidth[$key] = strlen($cell);
|
$this->colWidth[$key] = strlen($cell);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -159,12 +155,9 @@ class Table
|
|||||||
*/
|
*/
|
||||||
public function addRow($row, $first = false)
|
public function addRow($row, $first = false)
|
||||||
{
|
{
|
||||||
if ($first)
|
if ($first) {
|
||||||
{
|
|
||||||
array_unshift($this->rows, $row);
|
array_unshift($this->rows, $row);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->rows[] = $row;
|
$this->rows[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,8 +186,7 @@ class Table
|
|||||||
$style = $this->getStyle($pos);
|
$style = $this->getStyle($pos);
|
||||||
$array = [];
|
$array = [];
|
||||||
|
|
||||||
foreach ($this->colWidth as $width)
|
foreach ($this->colWidth as $width) {
|
||||||
{
|
|
||||||
$array[] = str_repeat($style[1], $width + 2);
|
$array[] = str_repeat($style[1], $width + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,17 +203,14 @@ class Table
|
|||||||
$style = $this->getStyle('cell');
|
$style = $this->getStyle('cell');
|
||||||
$content = $this->renderSeparator('top');
|
$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);
|
$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;
|
$content .= $style[0] . implode(' ' . $style[2], $array) . ' ' . $style[3] . PHP_EOL;
|
||||||
|
|
||||||
if ($this->rows)
|
if ($this->rows) {
|
||||||
{
|
|
||||||
$content .= $this->renderSeparator('middle');
|
$content .= $this->renderSeparator('middle');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,12 +220,9 @@ class Table
|
|||||||
|
|
||||||
protected function getStyle($style)
|
protected function getStyle($style)
|
||||||
{
|
{
|
||||||
if ($this->format[$this->style])
|
if ($this->format[$this->style]) {
|
||||||
{
|
|
||||||
$style = $this->format[$this->style][$style];
|
$style = $this->format[$this->style][$style];
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$style = [' ', ' ', ' ', ' '];
|
$style = [' ', ' ', ' ', ' '];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,8 +237,7 @@ class Table
|
|||||||
*/
|
*/
|
||||||
public function render($dataList = [])
|
public function render($dataList = [])
|
||||||
{
|
{
|
||||||
if ($dataList)
|
if ($dataList) {
|
||||||
{
|
|
||||||
$this->setRows($dataList);
|
$this->setRows($dataList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,35 +245,26 @@ class Table
|
|||||||
$content = $this->renderHeader();
|
$content = $this->renderHeader();
|
||||||
$style = $this->getStyle('cell');
|
$style = $this->getStyle('cell');
|
||||||
|
|
||||||
if ($this->rows)
|
if ($this->rows) {
|
||||||
{
|
foreach ($this->rows as $row) {
|
||||||
foreach ($this->rows as $row)
|
if (is_string($row) && '-' === $row) {
|
||||||
{
|
|
||||||
if (is_string($row) && '-' === $row)
|
|
||||||
{
|
|
||||||
$content .= $this->renderSeparator('middle');
|
$content .= $this->renderSeparator('middle');
|
||||||
}
|
} elseif (is_scalar($row)) {
|
||||||
elseif (is_scalar($row))
|
|
||||||
{
|
|
||||||
$content .= $this->renderSeparator('cross-top');
|
$content .= $this->renderSeparator('cross-top');
|
||||||
$array = str_pad($row, 3 * (count($this->colWidth) - 1) + array_reduce($this->colWidth, function ($a, $b) {
|
$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 .= $style[0] . ' ' . $array . ' ' . $style[3] . PHP_EOL;
|
||||||
$content .= $this->renderSeparator('cross-bottom');
|
$content .= $this->renderSeparator('cross-bottom');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$array = [];
|
$array = [];
|
||||||
|
|
||||||
foreach ($row as $key => $val)
|
foreach ($row as $key => $val) {
|
||||||
{
|
|
||||||
$array[] = ' ' . str_pad($val, $this->colWidth[$key], ' ', $this->cellAlign);
|
$array[] = ' ' . str_pad($val, $this->colWidth[$key], ' ', $this->cellAlign);
|
||||||
}
|
}
|
||||||
|
|
||||||
$content .= $style[0] . implode(' ' . $style[2], $array) . ' ' . $style[3] . PHP_EOL;
|
$content .= $style[0] . implode(' ' . $style[2], $array) . ' ' . $style[3] . PHP_EOL;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,4 +273,4 @@ class Table
|
|||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
106
app/helper.php
106
app/helper.php
@@ -140,7 +140,7 @@ function send($site = '', $torrent = array())
|
|||||||
* @param string $method
|
* @param string $method
|
||||||
* @return mixed 返回的数据
|
* @return mixed 返回的数据
|
||||||
*/
|
*/
|
||||||
function download($url, $cookies, $useragent, $method = 'GET')
|
function download($url, $cookies='', $useragent='', $method = 'GET')
|
||||||
{
|
{
|
||||||
$header = array(
|
$header = array(
|
||||||
"Content-Type:application/x-www-form-urlencoded",
|
"Content-Type:application/x-www-form-urlencoded",
|
||||||
@@ -198,16 +198,17 @@ function convertToMB($from)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 字节数Byte转换为KB、MB、GB、TB
|
* 字节数Byte转换为KB、MB、GB、TB
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getFilesize($num){
|
function getFilesize($num)
|
||||||
|
{
|
||||||
$p = 0;
|
$p = 0;
|
||||||
$format='bytes';
|
$format='bytes';
|
||||||
if($num>0 && $num<1024){
|
if ($num>0 && $num<1024) {
|
||||||
$p = 0;
|
$p = 0;
|
||||||
return number_format($num).' '.$format;
|
return number_format($num).' '.$format;
|
||||||
}
|
}
|
||||||
if($num>=1024 && $num<pow(1024, 2)){
|
if ($num>=1024 && $num<pow(1024, 2)) {
|
||||||
$p = 1;
|
$p = 1;
|
||||||
$format = 'KB';
|
$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)) {
|
if (is_bool($data)) {
|
||||||
$show_data=$data ? 'true' : 'false';
|
$show_data=$data ? 'true' : 'false';
|
||||||
@@ -336,29 +338,11 @@ function wlog($data='',$name = '',$path = ''){
|
|||||||
$dir = $path===''? TORRENT_PATH . 'cache' . DS : $path;
|
$dir = $path===''? TORRENT_PATH . 'cache' . DS : $path;
|
||||||
IFile::mkdir($dir);
|
IFile::mkdir($dir);
|
||||||
$myfile = $dir.$name.'.txt';
|
$myfile = $dir.$name.'.txt';
|
||||||
$file_pointer = @fopen($myfile,"a");
|
$file_pointer = @fopen($myfile, "a");
|
||||||
$worldsnum = @fwrite($file_pointer,$show_data);
|
$worldsnum = @fwrite($file_pointer, $show_data);
|
||||||
@fclose($file_pointer);
|
@fclose($file_pointer);
|
||||||
return $worldsnum;
|
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
|
//PHP stdClass Object转array
|
||||||
function object_array($array)
|
function object_array($array)
|
||||||
@@ -389,22 +373,23 @@ function oddFilter($var)
|
|||||||
*/
|
*/
|
||||||
function evenFilter($var)
|
function evenFilter($var)
|
||||||
{
|
{
|
||||||
// 返回$var最后一个二进制位,
|
// 返回$var最后一个二进制位,
|
||||||
// 为0则保留(偶数的二进制的最后一位肯定是0)
|
// 为0则保留(偶数的二进制的最后一位肯定是0)
|
||||||
return(!($var & 1));
|
return(!($var & 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布员签名
|
* 发布员签名
|
||||||
* 注意:同时配置iyuu.cn与secret时,优先使用secret。
|
* 注意:同时配置iyuu.cn与secret时,优先使用secret。
|
||||||
*/
|
*/
|
||||||
function sign( $timestamp ){
|
function sign($timestamp)
|
||||||
global $configALL;
|
{
|
||||||
// 爱语飞飞
|
global $configALL;
|
||||||
$token = isset($configALL['iyuu.cn']) && $configALL['iyuu.cn'] ? $configALL['iyuu.cn'] : '';
|
// 爱语飞飞
|
||||||
// 鉴权
|
$token = isset($configALL['iyuu.cn']) && $configALL['iyuu.cn'] ? $configALL['iyuu.cn'] : '';
|
||||||
$token = isset($configALL['secret']) && $configALL['secret'] ? $configALL['secret'] : $token;
|
// 鉴权
|
||||||
return sha1($timestamp . $token);
|
$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+盐)
|
* token算法:IYUU + uid + T + sha1(openid+time+盐)
|
||||||
* @param string $token 用户请求token
|
* @param string $token 用户请求token
|
||||||
*/
|
*/
|
||||||
function getUid($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;
|
//验证是否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) {
|
switch ($dir) {
|
||||||
case 'Protocols':
|
case 'Protocols':
|
||||||
@@ -434,31 +421,30 @@ function ShowTableSites($dir = 'Protocols',$filter = array()){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$data = [];
|
$data = [];
|
||||||
$i = $j = $k = 0;
|
$i = $j = $k = 0; //i列、j序号、k行
|
||||||
foreach(glob(APP_PATH.$dir.DS.'*.php') as $key => $start_file)
|
foreach (glob(APP_PATH.$dir.DS.'*.php') as $key => $start_file) {
|
||||||
{
|
$start_file = str_replace("\\", "/", $start_file);
|
||||||
$start_file = str_replace("\\","/",$start_file);
|
$offset = strripos($start_file, '/');
|
||||||
$offset = strripos($start_file,'/');
|
if ($offset===false) {
|
||||||
if ($offset===false) {
|
$start_file = substr($start_file, 0, -4);
|
||||||
$start_file = substr($start_file,0,-4);
|
} else {
|
||||||
} else {
|
$start_file = substr($start_file, $offset+1, -4);
|
||||||
$start_file = substr($start_file,$offset+1,-4);
|
|
||||||
}
|
}
|
||||||
// 过滤示例、过滤解码接口
|
// 过滤示例、过滤解码接口
|
||||||
if (in_array($start_file, $filter)) {
|
if (in_array($start_file, $filter)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 控制多少列
|
// 控制多少列
|
||||||
if ($i > 4) {
|
if ($i > 4) {
|
||||||
$k++;
|
$k++;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
$j++;
|
$j++;
|
||||||
$data[$k][] = $j.". ".$start_file;
|
$data[$k][] = $j.". ".$start_file;
|
||||||
}
|
}
|
||||||
//输出表格
|
//输出表格
|
||||||
$table = new Table();
|
$table = new Table();
|
||||||
$table->setRows($data);
|
$table->setRows($data);
|
||||||
echo($table->render());
|
echo($table->render());
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"owner888/phpspider": "^2.1",
|
|
||||||
"curl/curl": "^2.2"
|
"curl/curl": "^2.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
60
composer.lock
generated
60
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "32806a4860870f6306b69cf349584387",
|
"content-hash": "10281f19c929443b7db18d1ab159ec63",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "curl/curl",
|
"name": "curl/curl",
|
||||||
@@ -66,58 +66,6 @@
|
|||||||
"dot"
|
"dot"
|
||||||
],
|
],
|
||||||
"time": "2018-12-04T19:47:03+00:00"
|
"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": [],
|
"packages-dev": [],
|
||||||
@@ -126,6 +74,10 @@
|
|||||||
"stability-flags": [],
|
"stability-flags": [],
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": [],
|
"platform": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"ext-mbstring": "*",
|
||||||
|
"ext-curl": "*"
|
||||||
|
},
|
||||||
"platform-dev": []
|
"platform-dev": []
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,15 @@
|
|||||||
* 技术讨论及后续更新,请加入QQ群!!!!!!!
|
* 技术讨论及后续更新,请加入QQ群!!!!!!!
|
||||||
群名称:IYUU自动辅种交流
|
群名称:IYUU自动辅种交流
|
||||||
QQ群号:859882209
|
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(
|
return array(
|
||||||
// 1.【必须配置】爱语飞飞 微信通知,请访问https://iyuu.cn 用微信扫码申请
|
// 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
|
'host' => 'http://127.0.0.1:9091/transmission/rpc', // 警告!注意:transmission/rpc这段别动,你只需要修改 127.0.0.1:9091
|
||||||
'username' => '',
|
'username' => '',
|
||||||
'password' => '',
|
'password' => '',
|
||||||
|
'BT_backup' => '/var/lib/transmission/torrents', // 移动做种:如果脚本与当前客户端不在一台机器,必须配置
|
||||||
|
'move' => 0, // 0不移动,1移动并辅种,2移动仅辅种自身,3未定义
|
||||||
),
|
),
|
||||||
# 结束
|
# 结束
|
||||||
# 开始
|
# 开始
|
||||||
array(
|
array(
|
||||||
'type' => 'qBittorrent', // 支持:transmission、qBittorrent
|
'type' => 'qBittorrent', // 支持:transmission、qBittorrent
|
||||||
'host' => 'http://www.baidu.com:8083',
|
'host' => 'http://127.0.0.1:8083',
|
||||||
'username' => '',
|
'username' => '',
|
||||||
'password' => '',
|
'password' => '',
|
||||||
|
'BT_backup' => 'C:\Users\ASUS\AppData\Local\qBittorrent\BT_backup', // 移动做种:必须配置
|
||||||
|
'move' => 0, // 0不移动,1移动并辅种,2移动仅辅种自身,3未定义
|
||||||
),
|
),
|
||||||
# 结束
|
# 结束
|
||||||
// 全局客户端设置 结束
|
// 全局客户端设置 结束
|
||||||
),
|
),
|
||||||
|
// 移动做种必须配置
|
||||||
'move' =>array(
|
'move' =>array(
|
||||||
'type' => 2, // 0保持不变,1减,2加, 3直接替换
|
'type' => 0, // 0保持不变,1减,2加,3替换
|
||||||
'path' =>array(
|
'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,
|
'CONNECTTIMEOUT'=> 60,
|
||||||
@@ -58,6 +94,23 @@ return array(
|
|||||||
'passkey' => '',
|
'passkey' => '',
|
||||||
// 种子Tracker的IP地址选择 可选:ipv4,ipv6
|
// 种子Tracker的IP地址选择 可选:ipv4,ipv6
|
||||||
'ip_type' => 'ipv4',
|
'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 序号:2
|
||||||
'keepfrds' => array(
|
'keepfrds' => array(
|
||||||
@@ -65,6 +118,14 @@ return array(
|
|||||||
'cookie' => '',
|
'cookie' => '',
|
||||||
// 如果需要自动辅种,必须配置
|
// 如果需要自动辅种,必须配置
|
||||||
'passkey' => '',
|
'passkey' => '',
|
||||||
|
'workingMode' => 1,
|
||||||
|
'watch' => '',
|
||||||
|
'filter' => array(
|
||||||
|
'size'=>array(
|
||||||
|
'min' => '1GB',
|
||||||
|
'max' => '280GB',
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
// ourbits 序号:3
|
// ourbits 序号:3
|
||||||
'ourbits' => array(
|
'ourbits' => array(
|
||||||
@@ -74,6 +135,14 @@ return array(
|
|||||||
'passkey' => '',
|
'passkey' => '',
|
||||||
'id' => 0, // 用户ID
|
'id' => 0, // 用户ID
|
||||||
'is_vip' => 0, // 是否具有VIP或特殊权限?0 普通,1 VIP
|
'is_vip' => 0, // 是否具有VIP或特殊权限?0 普通,1 VIP
|
||||||
|
'workingMode' => 0,
|
||||||
|
'watch' => '/root/downloads',
|
||||||
|
'filter' => array(
|
||||||
|
'size'=>array(
|
||||||
|
'min' => '1GB',
|
||||||
|
'max' => '280GB',
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
// HDSky 序号:4
|
// HDSky 序号:4
|
||||||
'hdsky' => array(
|
'hdsky' => array(
|
||||||
@@ -153,6 +222,8 @@ return array(
|
|||||||
'cookie' => '',
|
'cookie' => '',
|
||||||
// 如果需要自动辅种,必须配置
|
// 如果需要自动辅种,必须配置
|
||||||
'passkey' => '',
|
'passkey' => '',
|
||||||
|
// 如果需要rss订阅,必须配置
|
||||||
|
'rss' => '',
|
||||||
),
|
),
|
||||||
// nanyangpt 序号:15
|
// nanyangpt 序号:15
|
||||||
'nanyangpt' => array(
|
'nanyangpt' => array(
|
||||||
@@ -308,7 +379,7 @@ return array(
|
|||||||
// 如果需要自动辅种,必须配置
|
// 如果需要自动辅种,必须配置
|
||||||
'passkey' => '',
|
'passkey' => '',
|
||||||
),
|
),
|
||||||
// upxin 序号:37
|
// hdu 序号:37
|
||||||
'upxin' => array(
|
'upxin' => array(
|
||||||
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
|
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
|
||||||
'cookie' => '',
|
'cookie' => '',
|
||||||
@@ -357,6 +428,41 @@ return array(
|
|||||||
// 如果需要自动辅种,必须配置
|
// 如果需要自动辅种,必须配置
|
||||||
'passkey' => '',
|
'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' => '',
|
||||||
|
),
|
||||||
|
|
||||||
// 配置文件结束
|
// 配置文件结束
|
||||||
);
|
);
|
||||||
|
24
init.php
24
init.php
@@ -1,7 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
//----------------------------------
|
|
||||||
// 公共入口文件
|
|
||||||
//----------------------------------
|
|
||||||
// 定义目录
|
// 定义目录
|
||||||
defined('ROOT_PATH') or define("ROOT_PATH", __DIR__);
|
defined('ROOT_PATH') or define("ROOT_PATH", __DIR__);
|
||||||
define('DS', DIRECTORY_SEPARATOR);
|
define('DS', DIRECTORY_SEPARATOR);
|
||||||
@@ -10,7 +7,7 @@ define('TORRENT_PATH', ROOT_PATH.DS.'torrent'.DS);
|
|||||||
|
|
||||||
// 严格开发模式
|
// 严格开发模式
|
||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
#ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
|
|
||||||
// 永不超时
|
// 永不超时
|
||||||
ini_set('max_execution_time', 0);
|
ini_set('max_execution_time', 0);
|
||||||
@@ -27,7 +24,7 @@ if (PHP_SAPI != 'cli') {
|
|||||||
|
|
||||||
// 设置时区
|
// 设置时区
|
||||||
date_default_timezone_set('Asia/Shanghai');
|
date_default_timezone_set('Asia/Shanghai');
|
||||||
|
echo microtime(true).' 环境变量初始化完成!'.PHP_EOL;
|
||||||
// 系统配置
|
// 系统配置
|
||||||
if (file_exists(ROOT_PATH."/config/config.php")) {
|
if (file_exists(ROOT_PATH."/config/config.php")) {
|
||||||
// 配置(全局变量)
|
// 配置(全局变量)
|
||||||
@@ -35,17 +32,26 @@ if (file_exists(ROOT_PATH."/config/config.php")) {
|
|||||||
} else {
|
} else {
|
||||||
// 示例配置
|
// 示例配置
|
||||||
$configALL = require_once ROOT_PATH . '/config/config.sample.php';
|
$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")) {
|
if (is_file(ROOT_PATH . "/config/sites.json")) {
|
||||||
$sitesJson = file_get_contents(ROOT_PATH . "/config/sites.json");
|
$sitesJson = file_get_contents(ROOT_PATH . "/config/sites.json");
|
||||||
$configALL['sitesALL'] = json_decode($sitesJson, true);
|
$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';
|
require_once ROOT_PATH . '/vendor/autoload.php';
|
||||||
|
echo microtime(true).' composer依赖载入完成!'.PHP_EOL;
|
||||||
global $argv;
|
global $argv;
|
||||||
$start_file = str_replace("\\","/",trim($argv[0]));
|
$start_file = str_replace("\\", "/", trim($argv[0]));
|
||||||
if( substr($start_file,-8)==="init.php" ){
|
if (substr($start_file, -8)==="init.php") {
|
||||||
require_once __DIR__ . '/iyuu.php';
|
require_once __DIR__ . '/iyuu.php';
|
||||||
}
|
}
|
||||||
|
10
iyuu.php
10
iyuu.php
@@ -2,11 +2,7 @@
|
|||||||
require_once __DIR__ . '/init.php';
|
require_once __DIR__ . '/init.php';
|
||||||
use IYUU\AutoReseed;
|
use IYUU\AutoReseed;
|
||||||
|
|
||||||
|
echo microtime(true).' IYUU自动辅种正在初始化...'.PHP_EOL;
|
||||||
AutoReseed::init();
|
AutoReseed::init();
|
||||||
$hashArray = AutoReseed::get();
|
AutoReseed::call();
|
||||||
if (AutoReseed::$move != null) {
|
exit(0);
|
||||||
echo "种子移动完毕,请重新编辑配置,再尝试辅种! \n\n";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
AutoReseed::call($hashArray);
|
|
||||||
AutoReseed::wechatMessage();
|
|
||||||
|
27
readme.md
27
readme.md
@@ -29,10 +29,10 @@ IYUU自动辅种工具(英文名:IYUUAutoReseed),是一款PHP语言编
|
|||||||
2. qBittorrent
|
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运行环境的所有平台,例如:Linux、Windows、MacOS!
|
具备PHP运行环境的所有平台,例如:Linux、Windows、MacOS!
|
||||||
|
|
||||||
官方下载的记得开启crul、fileinfo、mbstring,这3个扩展。
|
官方下载的记得开启crul、fileinfo、mbstring,这3个扩展。
|
||||||
|
|
||||||
@@ -42,9 +42,18 @@ IYUU自动辅种工具(英文名:IYUUAutoReseed),是一款PHP语言编
|
|||||||
## 下载源码
|
## 下载源码
|
||||||
- github仓库:https://github.com/ledccn/IYUUAutoReseed
|
- github仓库:https://github.com/ledccn/IYUUAutoReseed
|
||||||
- 码云仓库:https://gitee.com/ledc/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]
|
- 点击链接加入群聊【IYUU自动辅种交流】:[https://jq.qq.com/?_wv=1027&k=5JOfOlM][1]
|
||||||
@@ -59,8 +68,6 @@ IYUU自动辅种工具(英文名:IYUUAutoReseed),是一款PHP语言编
|
|||||||
**您所有的打赏将用于服务器续期,增加服务的延续性。**
|
**您所有的打赏将用于服务器续期,增加服务的延续性。**
|
||||||
|
|
||||||
|
|
||||||
![微信打赏.png][2]
|
|
||||||
|
|
||||||
|
|
||||||
## 捐赠者列表
|
## 捐赠者列表
|
||||||
感谢以下捐赠者,排名不分先后!
|
感谢以下捐赠者,排名不分先后!
|
||||||
@@ -104,6 +111,16 @@ IYUU自动辅种工具(英文名:IYUUAutoReseed),是一款PHP语言编
|
|||||||
| 寒山先生 | ¥100元 | 2020年1月11日11:47 |
|
| 寒山先生 | ¥100元 | 2020年1月11日11:47 |
|
||||||
| 天空(感谢远程指导小意思) | ¥20元 | 2020年1月14日23:11 |
|
| 天空(感谢远程指导小意思) | ¥20元 | 2020年1月14日23:11 |
|
||||||
| 寒山先生 | ¥200元 | 2020年1月18日12:37 |
|
| 寒山先生 | ¥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 |
|
||||||
|
|
||||||
|
|
||||||
补充说明:
|
补充说明:
|
||||||
|
|
||||||
|
170
wiki/RSS订阅使用教程.md
Normal file
170
wiki/RSS订阅使用教程.md
Normal 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地址选择 可选:ipv4,ipv6
|
||||||
|
'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)
|
||||||
|
本部分以我堡为例,讲解工作模式0:watch监控目录
|
||||||
|
关键地方:`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订阅下载、下载免费种时的各种配置的情况,请仔细阅读务必理解!**
|
@@ -12,7 +12,6 @@ IYUU自动辅种工具、Ourbits双方达成合作,可以对使用接口的用
|
|||||||
### 设置Ourbits:
|
### 设置Ourbits:
|
||||||
![编辑配置4.png][5]
|
![编辑配置4.png][5]
|
||||||
`passkey`,在你的控制面板 - 密钥
|
`passkey`,在你的控制面板 - 密钥
|
||||||
`is_vip`,根据你的实际情况填写,因站点有下载种子的流控,如果你不在限制之列,可以`设置为1`
|
|
||||||
`id`,为用户中心打开后,浏览器地址栏**http://xxxxx.xxx/userdetails.php?id=`46880`**等号=后面的几个数字,如图:
|
`id`,为用户中心打开后,浏览器地址栏**http://xxxxx.xxx/userdetails.php?id=`46880`**等号=后面的几个数字,如图:
|
||||||
![编辑配置6.png][6]
|
![编辑配置6.png][6]
|
||||||
|
|
||||||
|
20
wiki/常见问题.md
20
wiki/常见问题.md
@@ -28,24 +28,6 @@
|
|||||||
|
|
||||||
答:按站内说明,修改下载器所在设备的HOST,或者在具备修改HOST功能的路由器内修改。
|
答:按站内说明,修改下载器所在设备的HOST,或者在具备修改HOST功能的路由器内修改。
|
||||||
|
|
||||||
#### 问:我拥有辅种时自动跳过站点的特殊权限,如何设置为可以辅种呢?
|
|
||||||
|
|
||||||
答:在站点的独立配置区域,添加一行代码`'is_vip' => 1,`即可。例如Ourbits:
|
|
||||||
|
|
||||||
```php
|
|
||||||
// ourbits
|
|
||||||
'ourbits' => array(
|
|
||||||
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
|
|
||||||
'cookie' => '',
|
|
||||||
// 如果需要自动辅种,必须配置
|
|
||||||
'passkey' => '',
|
|
||||||
'id' => 46880, // 用户ID
|
|
||||||
'is_vip' => 1, // 是否具有VIP或特殊权限?0 普通,1 VIP
|
|
||||||
),
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 问:如何升级到最新版本?
|
#### 问:如何升级到最新版本?
|
||||||
|
|
||||||
答:从github或码云仓库,下载最新的源码,覆盖到本地即可。
|
答:从github或码云仓库,下载最新的源码,覆盖到本地即可。
|
||||||
@@ -87,7 +69,7 @@
|
|||||||
|
|
||||||
2.手动下载种子,看看是否出现了下载种子的提示页?
|
2.手动下载种子,看看是否出现了下载种子的提示页?
|
||||||
|
|
||||||
3.瓷器、城市需要cookie辅种,请检查cookie是否配置正确,如果下载出现提示页面,需要更新配置内的cookie、更新cookid!!!
|
3.瓷器、城市需要cookie辅种,请检查cookie是否配置正确!!如果下载出现提示页面,需要更新配置内的cookie、更新cookie!!!
|
||||||
|
|
||||||
如果整个站都失败,请按以上步骤排查。
|
如果整个站都失败,请按以上步骤排查。
|
||||||
|
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
| 自动辅种结束微信通知 | 已完成 | 2019年12月25日 | 2019年12月27日 |
|
| 自动辅种结束微信通知 | 已完成 | 2019年12月25日 | 2019年12月27日 |
|
||||||
| 做种客户端间转移 | 已完成 | 2019年12月25日 | 2020年1月14日 |
|
| 做种客户端间转移 | 已完成 | 2019年12月25日 | 2020年1月14日 |
|
||||||
| 手动辅种按目录分组 | 已完成 | 2019年12月26日 | 2020年1月14日 |
|
| 手动辅种按目录分组 | 已完成 | 2019年12月26日 | 2020年1月14日 |
|
||||||
|
| 自动转移客户端 | 已完成 | 2020年1月27日 | 2020年1月29日 |
|
||||||
| WEB页面生成配置 | 暂未开始 | | |
|
| WEB页面生成配置 | 暂未开始 | | |
|
||||||
| 自动转移客户端 | 暂未开始 | | |
|
|
||||||
| 脚本docker容器化 | 暂未开始 | | |
|
| 脚本docker容器化 | 暂未开始 | | |
|
||||||
| 浏览器插件 | 暂未开始 | | |
|
| 浏览器插件 | 暂未开始 | | |
|
||||||
| 合集自动拆包辅种 | 暂未开始 | | |
|
| 合集自动拆包辅种 | 暂未开始 | | |
|
||||||
|
12
wiki/更新历史.md
12
wiki/更新历史.md
@@ -1,3 +1,15 @@
|
|||||||
|
### 2020年1月30日
|
||||||
|
|
||||||
|
新增:CCFBits站点辅种
|
||||||
|
|
||||||
|
### 2020年1月28日
|
||||||
|
|
||||||
|
新增:北邮站点辅种
|
||||||
|
|
||||||
|
新增:做种客户端转移功能
|
||||||
|
|
||||||
|
优化:删除用不到的依赖包
|
||||||
|
|
||||||
### 2020年1月21日
|
### 2020年1月21日
|
||||||
|
|
||||||
新增:支持的站点列表json本地化
|
新增:支持的站点列表json本地化
|
||||||
|
@@ -79,7 +79,7 @@ IYUU自动辅种工具、Ourbits双方达成合作,可以对使用接口的用
|
|||||||
## Windows安装PHP运行环境
|
## Windows安装PHP运行环境
|
||||||
也可以去官方下载【https://www.php.net/downloads】,官方下载的记得开启`curl、fileinfo、mbstring`,这3个扩展。
|
也可以去官方下载【https://www.php.net/downloads】,官方下载的记得开启`curl、fileinfo、mbstring`,这3个扩展。
|
||||||
另外我打包了一份,下载地址:
|
另外我打包了一份,下载地址:
|
||||||
微云链接:https://share.weiyun.com/5EiXLfn 密码:ezsvnb
|
微云链接:https://share.weiyun.com/5I13dek 密码:utcjsx
|
||||||
下载回来是一个ZIP压缩包,解压到`D:\IYUUAutoReseed\`目录内,文件结构如图:
|
下载回来是一个ZIP压缩包,解压到`D:\IYUUAutoReseed\`目录内,文件结构如图:
|
||||||
![编辑配置7.png][12]
|
![编辑配置7.png][12]
|
||||||
点击红框内`执行辅种`即可。
|
点击红框内`执行辅种`即可。
|
||||||
|
4
执行辅种.cmd
Normal file
4
执行辅种.cmd
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
@echo off
|
||||||
|
chcp 65001
|
||||||
|
%cd%\php-7.4.2-nts-Win32-vc15-x86\php %cd%\iyuu.php
|
||||||
|
pause
|
Reference in New Issue
Block a user