mirror of
https://gitee.com/ledc/IYUUAutoReseed
synced 2025-08-24 15:04:50 +00:00
Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
426e47337d | ||
|
37809f7bfe | ||
|
721aaf217b | ||
|
aa18b23dbb | ||
|
4d452e3909 | ||
|
741ccb4fb4 | ||
|
e336970fca | ||
|
0321deee01 | ||
|
08ef3769c2 | ||
|
1355398f76 | ||
|
53533df4b9 | ||
|
53902ee878 | ||
|
60430f6550 | ||
|
9445547378 | ||
|
8ba1ef1ff4 | ||
|
ca148bac6b | ||
|
3393eae7e7 | ||
|
06c00f88dc | ||
|
854121884b |
9
.gitignore
vendored
9
.gitignore
vendored
@@ -1,9 +0,0 @@
|
||||
/torrent
|
||||
/config/config.php
|
||||
/config/sites.json
|
||||
/*.bat
|
||||
/*.sh
|
||||
.idea
|
||||
.php_cs.cache
|
||||
vendor
|
||||
php-7.4.2-nts-Win32-vc15-x86
|
@@ -13,7 +13,7 @@ use IYUU\Library\Table;
|
||||
class AutoReseed
|
||||
{
|
||||
// 版本号
|
||||
const VER = '1.0.0';
|
||||
const VER = '1.5.0';
|
||||
// RPC连接
|
||||
private static $links = array();
|
||||
// 客户端配置
|
||||
@@ -23,7 +23,7 @@ class AutoReseed
|
||||
// 不辅种的站点 'ourbits','hdchina'
|
||||
private static $noReseed = array();
|
||||
// 不转移的站点 'hdarea','hdbd'
|
||||
private static $noMove = array('hdarea');
|
||||
private static $noMove = array('');
|
||||
// cookie检查
|
||||
private static $cookieCheck = array('hdchina','hdcity');
|
||||
// 缓存路径
|
||||
@@ -36,7 +36,9 @@ class AutoReseed
|
||||
'login' => '/user/login',
|
||||
'sites' => '/api/sites',
|
||||
'infohash'=> '/api/infohash',
|
||||
'notify' => '/api/notify',
|
||||
'notify' => '/api/notify',
|
||||
'alike' => '/api/alike',
|
||||
'hash' => '/api/hash',
|
||||
);
|
||||
// curl
|
||||
private static $curl = null;
|
||||
@@ -67,6 +69,7 @@ class AutoReseed
|
||||
public static function init()
|
||||
{
|
||||
global $configALL;
|
||||
self::backup('config', $configALL);
|
||||
self::$curl = new Curl();
|
||||
self::$curl->setOpt(CURLOPT_SSL_VERIFYPEER, false);
|
||||
self::$curl->setOpt(CURLOPT_SSL_VERIFYHOST, false);
|
||||
@@ -190,15 +193,15 @@ class AutoReseed
|
||||
}
|
||||
if (isset($result['result']) && $result['result'] == 'success') {
|
||||
$id = $name = '';
|
||||
if (isset($result['arguments']['torrent_duplicate'])) {
|
||||
$id = $result['arguments']['torrent_duplicate']['id'];
|
||||
$name = $result['arguments']['torrent_duplicate']['name'];
|
||||
} elseif (isset($result['arguments']['torrent_added'])) {
|
||||
$id = $result['arguments']['torrent_added']['id'];
|
||||
$name = $result['arguments']['torrent_added']['name'];
|
||||
if (isset($result['arguments']['torrent-duplicate'])) {
|
||||
$id = $result['arguments']['torrent-duplicate']['id'];
|
||||
$name = $result['arguments']['torrent-duplicate']['name'];
|
||||
} elseif (isset($result['arguments']['torrent-added'])) {
|
||||
$id = $result['arguments']['torrent-added']['id'];
|
||||
$name = $result['arguments']['torrent-added']['name'];
|
||||
}
|
||||
print "名字:".$name . PHP_EOL;
|
||||
print "********RPC添加下载任务成功 [" .$result['result']. "] (id=$id)".PHP_EOL.PHP_EOL;
|
||||
print "名字:" .$name . PHP_EOL;
|
||||
print "********RPC添加下载任务成功 [" .$result['result']. "] (id=" .$id. ")".PHP_EOL.PHP_EOL;
|
||||
return true;
|
||||
} else {
|
||||
$errmsg = isset($result['result']) ? $result['result'] : '未知错误,请稍后重试!';
|
||||
@@ -272,7 +275,7 @@ class AutoReseed
|
||||
// 失败
|
||||
continue;
|
||||
}
|
||||
// 此处需要优化大于一万条做种时,应分批上传
|
||||
self::backup('clients_'.$k, $hashArray);
|
||||
$infohash_Dir = $hashArray['hashString'];
|
||||
unset($hashArray['hashString']);
|
||||
// 签名
|
||||
@@ -282,6 +285,13 @@ class AutoReseed
|
||||
// 写请求日志
|
||||
wlog($hashArray, 'hashString'.$k);
|
||||
self::$wechatMsg['hashCount'] +=count($infohash_Dir);
|
||||
// 此处优化大于一万条做种时,设置超时
|
||||
if (count($infohash_Dir) > 5000) {
|
||||
$connecttimeout = isset($configALL['default']['CONNECTTIMEOUT']) && $configALL['default']['CONNECTTIMEOUT']>60 ? $configALL['default']['CONNECTTIMEOUT'] : 60;
|
||||
$timeout = isset($configALL['default']['TIMEOUT']) && $configALL['default']['TIMEOUT']>600 ? $configALL['default']['TIMEOUT'] : 600;
|
||||
self::$curl->setOpt(CURLOPT_CONNECTTIMEOUT, $connecttimeout);
|
||||
self::$curl->setOpt(CURLOPT_TIMEOUT, $timeout);
|
||||
}
|
||||
echo "正在向服务器提交 clients_".$k." 种子哈希……".PHP_EOL;
|
||||
$res = self::$curl->post(self::$apiUrl . self::$endpoints['infohash'], $hashArray);
|
||||
$res = json_decode($res->response, true);
|
||||
@@ -417,6 +427,7 @@ class AutoReseed
|
||||
$_url = 'https://' .$sites[$sid]['base_url']. '/' . $_url;
|
||||
print "种子下载页:".$_url.PHP_EOL;
|
||||
$url = download($_url, $cookie, $userAgent);
|
||||
p($url);
|
||||
if (strpos($url, '第一次下载提示') != false) {
|
||||
echo "当前站点触发第一次下载提示,已加入排除列表".PHP_EOL;
|
||||
echo "请进入瓷器详情页,点右上角蓝色框:下载种子,成功后更新cookie!".PHP_EOL;
|
||||
@@ -586,10 +597,11 @@ class AutoReseed
|
||||
// 目标下载器类型
|
||||
$rpcKey = self::$move[0];
|
||||
$type = self::$links[$rpcKey]['type'];
|
||||
$extra_options = array();
|
||||
if ($type == 'qBittorrent') {
|
||||
#$extra_options['skip_checking'] = "true"; //转移时,跳校验
|
||||
} else {
|
||||
$extra_options = array();
|
||||
if (isset($configALL['default']['move']['skip_check']) && $configALL['default']['move']['skip_check'] === 1) {
|
||||
$extra_options['skip_checking'] = "true"; //转移成功,跳校验
|
||||
}
|
||||
}
|
||||
// 添加转移任务:成功返回:true
|
||||
$ret = self::add(self::$move[0], $torrent, $downloadDir, $extra_options);
|
||||
@@ -598,9 +610,10 @@ class AutoReseed
|
||||
*/
|
||||
$log = $info_hash.PHP_EOL.$torrentPath.PHP_EOL.$downloadDir.PHP_EOL.PHP_EOL;
|
||||
if ($ret) {
|
||||
// 删除做种,不删资源
|
||||
#self::$links[$k]['rpc']->delete($torrentDelete);
|
||||
|
||||
//转移成功时,删除做种,不删资源
|
||||
if (isset($configALL['default']['move']['delete_torrent']) && $configALL['default']['move']['delete_torrent'] === 1) {
|
||||
self::$links[$k]['rpc']->delete($torrentDelete);
|
||||
}
|
||||
// 转移成功的种子,以infohash为文件名,写入缓存
|
||||
wlog($log, $info_hash, self::$cacheMove);
|
||||
wlog($log, 'MoveSuccess'.$k);
|
||||
@@ -681,6 +694,10 @@ class AutoReseed
|
||||
case 'ccfbits':
|
||||
$url = str_replace('{passkey}', $configALL[$site]['passkey'], $_url);
|
||||
break;
|
||||
case 'dicmusic':
|
||||
$_url = str_replace('{authkey}', $configALL[$site]['passkey'], $_url);
|
||||
$url = str_replace('{torrent_pass}', $configALL[$site]['torrent_pass'], $_url);
|
||||
break;
|
||||
default:
|
||||
$url = $_url."&passkey=". $configALL[$site]['passkey'];
|
||||
break;
|
||||
@@ -737,4 +754,15 @@ class AutoReseed
|
||||
'torrent_id'=> $torrent_id,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 备份功能
|
||||
*/
|
||||
private static function backup($key = '', $array = [])
|
||||
{
|
||||
$json = json_encode($array, JSON_UNESCAPED_UNICODE);
|
||||
$myfile = ROOT_PATH.DS.'config'.DS.$key.'.json';
|
||||
$file_pointer = @fopen($myfile, "w");
|
||||
$worldsnum = @fwrite($file_pointer, $json);
|
||||
@fclose($file_pointer);
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -6,8 +6,8 @@
|
||||
* 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/
|
||||
* IYUU自动下载种子--之RSS订阅使用教程 https://www.iyuu.cn/archives/349/
|
||||
* IYUU自动转移做种客户端--使用教程 https://www.iyuu.cn/archives/351/
|
||||
脚本仓库下载法:
|
||||
git clone https://github.com/ledccn/IYUUAutoReseed
|
||||
cd IYUUAutoReseed
|
||||
@@ -43,7 +43,7 @@ return array(
|
||||
'host' => 'http://127.0.0.1:8083',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'BT_backup' => 'C:\Users\ASUS\AppData\Local\qBittorrent\BT_backup', // 移动做种:必须配置
|
||||
'BT_backup' => 'C:\Users\ASUS\AppData\Local\qBittorrent\BT_backup', // 移动做种:必须配置,Linux搜索方法:find / -name BT_backup
|
||||
'move' => 0, // 0不移动,1移动并辅种,2移动仅辅种自身,3未定义
|
||||
),
|
||||
# 结束
|
||||
@@ -56,6 +56,8 @@ return array(
|
||||
// 当前路径 => 目标路径
|
||||
'/downloads' => '/volume1',
|
||||
),
|
||||
'skip_check' => 0, //转移成功,跳校验
|
||||
'delete_torrent' => 0, //转移成功,删除当前做种
|
||||
),
|
||||
'workingMode' => 0,
|
||||
'watch' => '/volume1/downloads',
|
||||
@@ -405,13 +407,6 @@ return array(
|
||||
// 如果需要自动辅种,必须配置
|
||||
'passkey' => '',
|
||||
),
|
||||
// cnscg 序号:41 圣城
|
||||
'cnscg' => array(
|
||||
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
|
||||
'cookie' => '',
|
||||
// 如果需要自动辅种,必须配置
|
||||
'passkey' => '',
|
||||
),
|
||||
// nicept 序号:42 老师
|
||||
'nicept' => array(
|
||||
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
|
||||
@@ -461,6 +456,14 @@ return array(
|
||||
// 如果需要自动辅种,必须配置
|
||||
'passkey' => '',
|
||||
),
|
||||
// dicmusic 序号:49 海豚
|
||||
'dicmusic' => array(
|
||||
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
|
||||
'cookie' => '',
|
||||
// 如果需要自动辅种,必须配置
|
||||
'passkey' => '', // authkey
|
||||
'torrent_pass' => '', // torrent_pass
|
||||
),
|
||||
|
||||
// 配置文件结束
|
||||
);
|
||||
|
3
docker/Dockerfile
Normal file
3
docker/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM php:7.4-fpm
|
||||
EXPOSE 9000
|
||||
WORKDIR /var/www
|
51
docker/IYUUAutoReseed自动辅种docker安装教程.md
Normal file
51
docker/IYUUAutoReseed自动辅种docker安装教程.md
Normal 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
6
docker/build.sh
Normal 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
2
docker/iyuu.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
docker exec -it IYUUAutoReseed php iyuu.php
|
10
readme.md
10
readme.md
@@ -29,7 +29,7 @@ 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圣城(已删除)、北邮、CCFBits。
|
||||
学校、杜比、家园、天空、朋友、馒头、萌猫、我堡、猫站、铂金家、烧包、北洋、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!
|
||||
@@ -113,6 +113,8 @@ http://api.iyuu.cn/docs.php?type=expand
|
||||
| 寒山先生 | ¥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 |
|
||||
@@ -120,6 +122,12 @@ http://api.iyuu.cn/docs.php?type=expand
|
||||
| 陈伟平 | ¥28.88元 | 2020年2月13日12:35 |
|
||||
| PhalApi Pro商业授权 | ¥-950元 | 2020年2月14日21:56 |
|
||||
| jonnaszheng | ¥10元 | 2020年2月15日10:25 |
|
||||
| weekend(sd54zdk) | ¥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 |
|
||||
|
||||
|
||||
补充说明:
|
||||
|
@@ -79,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]
|
||||
|
Reference in New Issue
Block a user