新增joyhd、u2

This commit is contained in:
iyuu.cn 2019-12-24 19:16:57 +08:00
parent cf8ee2ab73
commit fabffa1f63
10 changed files with 417 additions and 4 deletions

193
app/Protocols/dmhy.php Normal file
View File

@ -0,0 +1,193 @@
<?php
/**
* dmhy解码类
*/
use phpspider\core\requests;
use phpspider\core\selector;
class dmhy implements decodeBase
{
/**
* 站点标志
* @var string
*/
const SITE = 'dmhy';
/**
* 域名
* @var string
*/
const domain = 'u2.dmhy.org';
const HOST = 'https://'.self::domain.'/';
// 下载种子的请求类型
const METHOD = 'GET';
/**
* 种子存放路径
* @var string
*/
const TORRENT_DIR = TORRENT_PATH . self::SITE . DS;
/**
* 种子下载前缀
*/
const downloadPrefix = 'download.php?id=';
/**
* 种子详情页前缀
*/
const detailsPrefix = 'details.php?id=';
// 网页编码
const encoding = 'UTF-8';
// 超时时间
const CONNECTTIMEOUT = 30;
const TIMEOUT = 600;
/**
* cookie
*/
public static $cookies = '';
/**
* 浏览器 User-Agent
*/
public static $userAgent = '';
/**
* passkey
*/
public static $passkey = '';
/**
* 获取的种子标志
*/
public static $getTorrent = array('class="pro_free');
/**
* H&R 标志
*/
public static $HR = array('class="hitandrun"','alt="H&amp;R"','title="H&amp;R"');
/**
* 解码后种子列表数组
*/
public static $TorrentList = array();
/**
* 初始化配置
*/
public static function init(){
global $configALL;
$config = $configALL[self::SITE];
self::$cookies = $config['cookie'];
self::$userAgent = isset($config['userAgent']) && $config['userAgent'] ? $config['userAgent'] : $configALL['default']['userAgent'];
self::$passkey = isset($config['passkey']) ? '&passkey='.$config['passkey'].'&https=1' : '';
requests::$input_encoding = self::encoding; //输入的网页编码
requests::$output_encoding = self::encoding; //输出的网页编码
requests::set_cookies(self::$cookies, self::domain);
requests::set_useragent([self::$userAgent]);
requests::set_timeout([self::CONNECTTIMEOUT,self::TIMEOUT]);
}
/**
* 执行
*
* @param string
* @return array
*/
public static function run()
{
self::init();
Rpc::init(self::SITE, self::METHOD);
$html = self::get();
#p($html);exit;
if ( $html === null ) {
exit(1);
}
$data = self::decode($html);
#p($data);exit;
Rpc::call($data);
exit(0);
}
/**
* 请求页面
*
* @param string $url
* @return array
*/
public static function get($url = 'torrents.php')
{
// 发起请求
$html = requests::get(self::HOST.$url);
// 获取列表页数据
$data = selector::select($html, "//*[@class='torrentname']");
if(!$data){
echo "登录信息过期,请重新设置! \n";
return null;
}
return $data;
}
/**
* 解码
*
* @param array $data
* @return array
*/
public static function decode($data = array())
{
$downloadStrLen = strlen(self::downloadPrefix); // 前缀长度
$downloadStrEnd = '"'; //种子地址结束标志
$len = $downloadStrLen + 10; // 截取长度
foreach ( $data as $k => $v ){
$arr = array();
// 种子基本信息处理
// 偏移量
$offset = strpos($v,self::downloadPrefix);
// 截取
$urlTemp = substr($v,$offset,$len);
// 种子地址
$arr['url'] = substr($urlTemp,0,strpos($urlTemp,$downloadStrEnd));
// 种子id
$arr['id'] = substr($arr['url'],$downloadStrLen);
// 获取主标题
// 偏移量
$h1_len = strpos($v, '</td><td width="40"');
$h1_temp = substr($v, 0, $h1_len);
$arr['h1'] = selector::select($h1_temp, '//a');
// 获取副标题(倒序算法)
$h2_temp = selector::select($v, "//span[@class='tooltip']");
if ( empty($h2_temp) ) {
$arr['title'] = '';
} else {
//存在副标题
$arr['title'] = $h2_temp;
#$arr['title'] = str_replace("\n","",$arr['title']);
// 第二次过滤
if ( strpos($arr['title'],'</td>') != false ) {
#$arr['title'] = str_replace('</td>',"",$arr['title']);
}
}
// 组合返回数组
self::$TorrentList[$k]['id'] = $arr['id'];
self::$TorrentList[$k]['h1'] = $arr['h1'];
self::$TorrentList[$k]['title'] = isset( $arr['title'] ) && $arr['title'] ? $arr['title'] : '';
self::$TorrentList[$k]['details'] = self::HOST.self::detailsPrefix.$arr['id'];
self::$TorrentList[$k]['download'] = self::HOST.$arr['url'];
self::$TorrentList[$k]['filename'] = $arr['id'].'.torrent';
// 种子促销类型解码
if(strpos($v,self::$getTorrent[0]) === false){
// 不免费
self::$TorrentList[$k]['type'] = 1;
}else{
// 免费种子
self::$TorrentList[$k]['type'] = 0;
}
// 存活时间
// 大小
// 种子数
// 下载数
// 完成数
// 完成进度
}
#p(self::$TorrentList);
return self::$TorrentList;
}
}

198
app/Protocols/joyhd.php Normal file
View File

@ -0,0 +1,198 @@
<?php
/**
* hdarea解码类
*/
use phpspider\core\requests;
use phpspider\core\selector;
class joyhd implements decodeBase
{
/**
* 站点标志
* @var string
*/
const SITE = 'joyhd';
/**
* 域名
* @var string
*/
const domain = 'www.joyhd.net';
const HOST = 'https://'.self::domain.'/';
// 下载种子的请求类型
const METHOD = 'GET';
/**
* 种子存放路径
* @var string
*/
const TORRENT_DIR = TORRENT_PATH . self::SITE . DS;
/**
* 种子下载前缀
*/
const downloadPrefix = 'download.php?id=';
/**
* 种子详情页前缀
*/
const detailsPrefix = 'details.php?id=';
// 网页编码
const encoding = 'UTF-8';
// 超时时间
const CONNECTTIMEOUT = 30;
const TIMEOUT = 600;
/**
* cookie
*/
public static $cookies = '';
/**
* 浏览器 User-Agent
*/
public static $userAgent = '';
/**
* passkey
*/
public static $passkey = '';
/**
* 获取的种子标志
*/
public static $getTorrent = array('class="pro_free');
/**
* H&R 标志
*/
public static $HR = array('class="hitandrun"','alt="H&amp;R"','title="H&amp;R"');
/**
* 解码后种子列表数组
*/
public static $TorrentList = array();
/**
* 初始化配置
*/
public static function init(){
global $configALL;
$config = $configALL[self::SITE];
self::$cookies = $config['cookie'];
self::$userAgent = isset($config['userAgent']) && $config['userAgent'] ? $config['userAgent'] : $configALL['default']['userAgent'];
self::$passkey = isset($config['passkey']) ? '&passkey='.$config['passkey'].'&https=1' : '';
requests::$input_encoding = self::encoding; //输入的网页编码
requests::$output_encoding = self::encoding; //输出的网页编码
requests::set_cookies(self::$cookies, self::domain);
requests::set_useragent([self::$userAgent]);
requests::set_timeout([self::CONNECTTIMEOUT,self::TIMEOUT]);
}
/**
* 执行
*
* @param string
* @return array
*/
public static function run()
{
self::init();
Rpc::init(self::SITE, self::METHOD);
$html = self::get();
#p($html);exit;
if ( $html === null ) {
exit(1);
}
$data = self::decode($html);
#p($data);exit;
Rpc::call($data);
exit(0);
}
/**
* 请求页面
*
* @param string $url
* @return array
*/
public static function get($url = 'torrents.php')
{
// 发起请求
$html = requests::get(self::HOST.$url);
// 获取列表页数据
$data = selector::select($html, "//*[@class='torrentname']");
if(!$data){
echo "登录信息过期,请重新设置! \n";
return null;
}
return $data;
}
/**
* 解码
*
* @param array $data
* @return array
*/
public static function decode($data = array())
{
$downloadStrLen = strlen(self::downloadPrefix); // 前缀长度
$downloadStrEnd = '"'; //种子地址结束标志
$len = $downloadStrLen + 10; // 截取长度
foreach ( $data as $k => $v ){
$arr = array();
// 种子基本信息处理
// 偏移量
$offset = strpos($v,self::downloadPrefix);
// 截取
$urlTemp = substr($v,$offset,$len);
// 种子地址
$arr['url'] = substr($urlTemp,0,strpos($urlTemp,$downloadStrEnd));
// 种子id
$arr['id'] = substr($arr['url'],$downloadStrLen);
// 获取主标题
// 偏移量
$h1_offset = strpos($v, '<a title="') + strlen('<a title="');
$h1_len = strpos($v, '" href="details.php?id=') - $h1_offset;
$arr['h1'] = substr($v, $h1_offset, $h1_len);
// 获取副标题(倒序算法)
// 偏移量
$h2StrStart = '<br />';
$h2StrEnd = '</td><td width="20" class="embedded"';
$h2_endOffset = strpos($v,$h2StrEnd);
$temp = substr($v, 0, $h2_endOffset);
$h2_offset = strrpos($temp,$h2StrStart);
if ($h2_offset === false ) {
$arr['title'] = '';
} else {
$h2_len = strlen($temp) - $h2_offset - strlen($h2StrStart);
//存在副标题
$arr['title'] = substr($temp, $h2_offset + strlen($h2StrStart), $h2_len);
$arr['title'] = str_replace("</b>","",$arr['title']);
// 第二次过滤
if ( strpos($arr['title'],'</td>') != false ) {
#$arr['title'] = str_replace('</td>',"",$arr['title']);
}
}
// 组合返回数组
self::$TorrentList[$k]['id'] = $arr['id'];
self::$TorrentList[$k]['h1'] = $arr['h1'];
self::$TorrentList[$k]['title'] = isset( $arr['title'] ) && $arr['title'] ? $arr['title'] : '';
self::$TorrentList[$k]['details'] = self::HOST.self::detailsPrefix.$arr['id'];
self::$TorrentList[$k]['download'] = self::HOST.$arr['url'];
self::$TorrentList[$k]['filename'] = $arr['id'].'.torrent';
// 种子促销类型解码
if(strpos($v,self::$getTorrent[0]) === false){
// 不免费
self::$TorrentList[$k]['type'] = 1;
}else{
// 免费种子
self::$TorrentList[$k]['type'] = 0;
}
// 存活时间
// 大小
// 种子数
// 下载数
// 完成数
// 完成进度
}
#p(self::$TorrentList);
return self::$TorrentList;
}
}

View File

@ -87,11 +87,11 @@ class Mteam implements decodeBase
* @param string
* @return array
*/
public static function run()
public static function run($url = 'torrents.php')
{
self::init();
Rpc::init(self::SITE, self::METHOD);
$html = self::get();
$html = self::get($url);
if ( $html === null ) {
exit(1);
}

View File

@ -356,6 +356,20 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// joyhd 序号35
'joyhd' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// dmhy 序号36
'dmhy' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// 配置文件结束
);

3
app/dmhy.php Normal file
View File

@ -0,0 +1,3 @@
<?php
require_once __DIR__ . '/init.php';
dmhy::run();

3
app/joyhd.php Normal file
View File

@ -0,0 +1,3 @@
<?php
require_once __DIR__ . '/init.php';
joyhd::run();

View File

@ -17,7 +17,7 @@ IYUU自动辅种工具英文名iyuuAutoReseed是一款PHP语言编
2. qBittorrent
## 支持自动辅种的站点
学校、杜比、家园、天空、朋友、馒头、萌猫、我堡、猫站、铂金家、烧包、北洋、TCCF、南洋、TTG、映客、城市、52pt、brobits、备胎、SSD、CHD、ptmsg、leaguehd、聆音、瓷器、hdarea、eastgame(TLF)、1ptba、hdtime、hd4fans、opencd、hdbug、hdstreet。
学校、杜比、家园、天空、朋友、馒头、萌猫、我堡、猫站、铂金家、烧包、北洋、TCCF、南洋、TTG、映客、城市、52pt、brobits、备胎、SSD、CHD、ptmsg、leaguehd、聆音、瓷器、hdarea、eastgame(TLF)、1ptba、hdtime、hd4fans、opencd、hdbug、hdstreet、joyhd、u2
## 运行环境
所有具备PHP运行环境的所有平台

View File

@ -1,4 +1,5 @@
## 重点讲解Ourbits站点的鉴权配置
博客链接https://www.iyuu.cn/archives/337/
IYUU自动辅种工具、Ourbits双方达成合作可以对使用接口的用户实现认证。
### 申请爱语飞飞微信通知token新用户访问http://iyuu.cn 申请!
1.点击`开始使用`,出现二维码,用`微信扫码`

View File

@ -1,5 +1,5 @@
### 2019年12月24日
新增hdstreet
新增hdstreet、joyhd、u2
------

View File

@ -1,4 +1,5 @@
以下教程以windows为基础进行讲解其他系统同理。
博客链接https://www.iyuu.cn/archives/324/
## 第一步 下载压缩包
从[码云仓库][1]下载最新源码解压缩到D盘的根目录下。