mirror of
https://gitee.com/ledc/IYUUAutoReseed
synced 2025-08-24 15:04:50 +00:00
Compare commits
8 Commits
v0.1.0-202
...
v0.1.2
Author | SHA1 | Date | |
---|---|---|---|
|
6216f8d5f3 | ||
|
852f7672cf | ||
|
348adfdcea | ||
|
3b8cbbd339 | ||
|
17b213829f | ||
|
98d01c34ff | ||
|
64523cc05d | ||
|
d7485be259 |
@@ -147,32 +147,52 @@ class Rpc
|
||||
case 1: //负载均衡模式
|
||||
try
|
||||
{
|
||||
$rpcKey = self::$RPC_Key;
|
||||
$type = self::$links[$rpcKey]['type'];
|
||||
echo '选中:负载均衡'.$rpcKey."\n";
|
||||
if( (strpos($torrent,'http://')===0) || (strpos($torrent,'https://')===0) ){
|
||||
echo 'add';
|
||||
$result = self::$links[$rpcKey]['rpc']->add( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子URL添加下载任务
|
||||
}else{
|
||||
echo 'add_metainfo';
|
||||
$result = self::$links[$rpcKey]['rpc']->add_metainfo( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子文件添加下载任务
|
||||
$is_url = false;
|
||||
if( (strpos($torrent,'http://')===0) || (strpos($torrent,'https://')===0) || (strpos($torrent,'magnet:?xt=urn:btih:')===0) ){
|
||||
$is_url = true;
|
||||
}
|
||||
// 负载均衡
|
||||
self::rpcSelect();
|
||||
$rpcKey = self::$RPC_Key;
|
||||
echo '选中:负载均衡'.$rpcKey."\n";
|
||||
self::rpcSelect();
|
||||
// 调试
|
||||
#p($result);
|
||||
// 下载服务器类型 判断
|
||||
$type = self::$links[$rpcKey]['type'];
|
||||
switch($type){
|
||||
case 'transmission':
|
||||
$id = $result->arguments->torrent_added->id;
|
||||
if( $is_url ){
|
||||
echo 'add';
|
||||
$result = self::$links[$rpcKey]['rpc']->add( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子URL添加下载任务
|
||||
}else{
|
||||
echo 'add_metainfo';
|
||||
$result = self::$links[$rpcKey]['rpc']->add_metainfo( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子文件添加下载任务
|
||||
}
|
||||
$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(!$id){
|
||||
print "-----RPC添加种子任务,失败 [{$result->result}] \n\n";
|
||||
}else{
|
||||
print "********RPC添加下载任务成功 [{$result->result}] (id=$id) \n\n";
|
||||
// 新添加的任务,开始
|
||||
self::$links[$rpcKey]['rpc']->start( $id );
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'qBittorrent':
|
||||
if( $is_url ){
|
||||
echo 'add';
|
||||
$result = self::$links[$rpcKey]['rpc']->add( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子URL添加下载任务
|
||||
}else{
|
||||
echo 'add_metainfo';
|
||||
$result = self::$links[$rpcKey]['rpc']->add_metainfo( $torrent, self::$links[$rpcKey]['downloadDir'], $extra_options ); // 种子文件添加下载任务
|
||||
}
|
||||
if ($result === 'Ok.') {
|
||||
print "********RPC添加下载任务成功 [{$result}] \n\n";
|
||||
return true;
|
||||
|
@@ -16,7 +16,7 @@ class hdbug implements decodeBase
|
||||
* 域名
|
||||
* @var string
|
||||
*/
|
||||
const domain = 'hdbug.best';
|
||||
const domain = 'hddisk.life';
|
||||
const HOST = 'https://'.self::domain.'/';
|
||||
// 下载种子的请求类型
|
||||
const METHOD = 'GET';
|
||||
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Beitai::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Brobits::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Btschool::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Chdbits::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
cnscg::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
discfan::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
dmhy::run();
|
@@ -3,7 +3,7 @@
|
||||
* 作用:添加聆音阅听专区30页小包,方便大家赚魔力
|
||||
* 使用方法:放入/app/ 目录下即可。
|
||||
*/
|
||||
require_once __DIR__ . '/init.php';
|
||||
require_once __DIR__ . '/../init.php';
|
||||
$start = 0;
|
||||
$end = 30;
|
||||
$url = 'live.php?inclbookmarked=0&incldead=1&spstate=0&&sort=5&type=asc&page={}';
|
3
app/download/sample.php
Normal file
3
app/download/sample.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../init.php';
|
||||
Mteam::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Eastgame::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
hd4fans::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Hdarea::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
hdbug::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
hdchina::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
hdcity::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Hddolby::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Hdhome::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Hdsky::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
hdstreet::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Hdtime::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
hdzone::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
joyhd::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Keepfrds::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Leaguehd::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Mteam::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Moecat::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Nanyangpt::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
nicept::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
opencd::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
oshen::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Ourbits::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
ptba::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Pterclub::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Pthome::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Ptmsg::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Ptsbao::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Site52pt::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
soulvoice::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Ssd::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Tjupt::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Torrentccf::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Totheglory::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
upxin::run();
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/init.php';
|
||||
Yingk::run();
|
30
download.php
Normal file
30
download.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/app/init.php';
|
||||
global $argv;
|
||||
if(count($argv) < 2){
|
||||
echo "--执行下载命令时,缺少站点参数,请查阅“常见问题”,获取站点参数!!\n\n";
|
||||
exit(1);
|
||||
}
|
||||
$start_file = $argv[0];
|
||||
$command = strtolower(trim($argv[1]));
|
||||
$command2 = isset($argv[2]) ? $argv[2] : '';
|
||||
if(is_file(APP_PATH.DS.'Protocols'.DS.$command.'.php')){
|
||||
switch ($command) {
|
||||
case 'start':
|
||||
break;
|
||||
case 'status':
|
||||
break;
|
||||
case 'stop':
|
||||
break;
|
||||
case 'restart':
|
||||
break;
|
||||
case 'reload':
|
||||
break;
|
||||
default :
|
||||
$command::run();
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
echo '解码文件:'.APP_PATH.DS.'Protocols'.DS.$command.'.php'." 不存在 \n\n";
|
||||
exit(1);
|
||||
}
|
28
iyuu.cn.php
28
iyuu.cn.php
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* IYUU自动辅种脚本
|
||||
* IYUUAutoReseed自动辅种
|
||||
*/
|
||||
use Curl\Curl;
|
||||
require_once __DIR__ . '/app/init.php';
|
||||
@@ -13,7 +13,7 @@ if ( iyuuAutoReseed::$move != null ) {
|
||||
iyuuAutoReseed::call($hashArray);
|
||||
iyuuAutoReseed::wechatMessage();
|
||||
/**
|
||||
* iyuu自动辅种类
|
||||
* IYUUAutoReseed自动辅种类
|
||||
*/
|
||||
class iyuuAutoReseed
|
||||
{
|
||||
@@ -22,23 +22,31 @@ class iyuuAutoReseed
|
||||
* @var string
|
||||
*/
|
||||
const VER = '0.1.0';
|
||||
// RPC连接池
|
||||
/**
|
||||
* RPC连接池
|
||||
* @var array
|
||||
*/
|
||||
public static $links = array();
|
||||
/**
|
||||
* 客户端配置
|
||||
* @var array
|
||||
*/
|
||||
public static $clients = array();
|
||||
/**
|
||||
* 不辅种的站点 'ourbits','hdchina'
|
||||
* @var array
|
||||
*/
|
||||
public static $noReseed = [];
|
||||
/**
|
||||
* 缓存路径
|
||||
* @var string
|
||||
*/
|
||||
public static $cacheDir = TORRENT_PATH.'cache'.DS;
|
||||
public static $cacheHash = TORRENT_PATH.'cachehash'.DS;
|
||||
/**
|
||||
* API接口配置
|
||||
* @var string
|
||||
* @var array
|
||||
*/
|
||||
public static $apiUrl = 'http://iyuu.cn:2122';
|
||||
public static $endpoints = array(
|
||||
@@ -49,14 +57,17 @@ class iyuuAutoReseed
|
||||
);
|
||||
/**
|
||||
* 退出状态码
|
||||
* @var int
|
||||
*/
|
||||
public static $ExitCode = 0;
|
||||
/**
|
||||
* 客户端转移做种 状态码[请把transmission配置为第一个客户端]
|
||||
* @var array
|
||||
*/
|
||||
public static $move = null;
|
||||
/**
|
||||
* 微信消息体
|
||||
* @var array
|
||||
*/
|
||||
public static $wechatMsg = array(
|
||||
'hashCount' => 0, // 提交给服务器的hash总数
|
||||
@@ -70,10 +81,10 @@ class iyuuAutoReseed
|
||||
);
|
||||
/**
|
||||
* 初始化
|
||||
* @return void
|
||||
*/
|
||||
public static function init(){
|
||||
global $configALL;
|
||||
|
||||
self::$clients = isset($configALL['default']['clients']) && $configALL['default']['clients'] ? $configALL['default']['clients'] : array();
|
||||
echo "程序正在初始化运行参数... \n";
|
||||
// 递归删除上次历史记录
|
||||
@@ -90,7 +101,7 @@ class iyuuAutoReseed
|
||||
* 连接远端RPC服务器
|
||||
*
|
||||
* @param string
|
||||
* @return array
|
||||
* @return bool
|
||||
*/
|
||||
public static function links()
|
||||
{
|
||||
@@ -135,6 +146,7 @@ class iyuuAutoReseed
|
||||
}
|
||||
/**
|
||||
* 从客户端获取种子的哈希列表
|
||||
* @var array
|
||||
*/
|
||||
public static function get(){
|
||||
$hashArray = array();
|
||||
@@ -348,7 +360,6 @@ class iyuuAutoReseed
|
||||
// 发起请求
|
||||
echo "正在提交辅种信息…… \n";
|
||||
$res = $curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray);
|
||||
|
||||
$resArray = json_decode($res->response, true);
|
||||
// 写日志
|
||||
if(true){
|
||||
@@ -441,7 +452,6 @@ class iyuuAutoReseed
|
||||
$_url = 'https://' .$sites[$sitesID]['base_url']. '/' . $_url;
|
||||
print "种子下载页:".$_url. "\n";
|
||||
$url = download($_url, $cookie, $userAgent);
|
||||
#$torrentArray = Bencode::decode($url);
|
||||
break;
|
||||
case 'hdcity':
|
||||
if ( empty($configALL[$sites[$sitesID]['site']]['cookie']) ) {
|
||||
@@ -453,6 +463,7 @@ class iyuuAutoReseed
|
||||
$userAgent = $configALL['default']['userAgent'];
|
||||
print "种子:".$_url. "\n";
|
||||
if ( isset($configALL[$sites[$sitesID]['site']]['cuhash']) ) {
|
||||
// 已获取cuhash
|
||||
# code...
|
||||
}else {
|
||||
// 获取cuhash
|
||||
@@ -577,7 +588,8 @@ function filterStatus( $v ){
|
||||
* qBittorrent过滤函数,只保留正常做种
|
||||
*/
|
||||
function qbfilterStatus( $v ){
|
||||
if( isset($v['status']) && in_array($v['state'], array('uploading','stalledUP','pausedUP','queuedUP','checkingUP','forcedUP')) ){
|
||||
if( isset($v['state']) && in_array($v['state'], array('uploading','stalledUP','pausedUP','queuedUP','checkingUP','forcedUP')) ){
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
42
wiki/命令汇总.md
42
wiki/命令汇总.md
@@ -3,45 +3,15 @@ php命令与脚本路径之间是有个空格,请注意!请注意!请注
|
||||
|
||||
|
||||
## 自动辅种命令:
|
||||
php ./iyuu.cn.php
|
||||
`php ./iyuu.cn.php`
|
||||
|
||||
|
||||
## 下载免费种命令:
|
||||
|
||||
- php ./app/beitai.php
|
||||
- php ./app/brobits.php
|
||||
- php ./app/btschool.php
|
||||
- php ./app/chdbits.php
|
||||
- php ./app/dmhy.php
|
||||
- php ./app/eastgame.php
|
||||
- php ./app/hd4fans.php
|
||||
- php ./app/hdarea.php
|
||||
- php ./app/hdbug.php
|
||||
- php ./app/hddolby.php
|
||||
- php ./app/hdhome.php
|
||||
- php ./app/hdsky.php
|
||||
- php ./app/hdstreet.php
|
||||
- php ./app/hdtime.php
|
||||
- php ./app/joyhd.php
|
||||
- php ./app/keepfrds.php
|
||||
- php ./app/leaguehd.php
|
||||
- php ./app/moecat.php
|
||||
- php ./app/m-team.php
|
||||
- php ./app/nanyangpt.php
|
||||
- php ./app/opencd.php
|
||||
- php ./app/ourbits.php
|
||||
- php ./app/ptba.php
|
||||
- php ./app/pterclub.php
|
||||
- php ./app/pthome.php
|
||||
- php ./app/ptmsg.php
|
||||
- php ./app/ptsbao.php
|
||||
- php ./app/site52pt.php
|
||||
- php ./app/soulvoice.php
|
||||
- php ./app/ssd.php
|
||||
- php ./app/tjupt.php
|
||||
- php ./app/torrentccf.php
|
||||
- php ./app/totheglory.php
|
||||
- php ./app/upxin.php
|
||||
- php ./app/yingk.php
|
||||
`php ./download.php 站点参数`
|
||||
|
||||
### 下载免费种支持的站点:
|
||||
|
||||
|
||||
|
||||
### 【重要说明:实际路径,以你实际的为准,切勿生搬硬套!】
|
@@ -69,6 +69,10 @@
|
||||
|
||||
答:为减轻服务器压力,推荐间隔3小时以上(太频繁的调用接口,可能被封禁)。
|
||||
|
||||
#### 问:猫站的Tracker为啥是http,而不是https?
|
||||
|
||||
答:请退出登录,在登录时勾选下面两个SSL的选项,登录后复制cookie,重新配置。
|
||||
|
||||
#### 问:如何反馈问题?
|
||||
|
||||
答:1、点击链接加入群聊【IYUU自动辅种交流】:[https://jq.qq.com/?_wv=1027&k=5JOfOlM][1]
|
||||
|
13
wiki/开发计划.md
13
wiki/开发计划.md
@@ -11,7 +11,16 @@
|
||||
| 自动辅种结束微信通知 | 已完成 | 2019年12月25日 | 2019年12月27日 |
|
||||
| 合集自动拆包辅种 | 暂未开始 | | |
|
||||
| 兼容Reseed辅种 | 暂未开始 | | |
|
||||
| 做种客户端间转移 | 正在开发 | 2019年12月25日 | |
|
||||
| 做种客户端间转移 | 已完成 | 2019年12月25日 | 2020年1月14日 |
|
||||
| WEB页面 | 暂未开始 | | |
|
||||
| 手动辅种文件,按目录分组 | 正在开发 | 2019年12月26日 | |
|
||||
| 手动辅种按目录分组 | 已完成 | 2019年12月26日 | 2020年1月14日 |
|
||||
| 自动下载 | 待完善 | | |
|
||||
| 自动辅种 | 已完成 | | |
|
||||
| 自动删除 | 暂未开始 | | |
|
||||
| 自动转载 | 暂未开始 | | |
|
||||
| 自动转移客户端 | 暂未开始 | | |
|
||||
| 自动认领 | 暂未开始 | | |
|
||||
| 智能管理 | 暂未开始 | | |
|
||||
| 智能任务 | 暂未开始 | | |
|
||||
| | | | |
|
||||
|
||||
|
Reference in New Issue
Block a user