CCFBits辅种时智能启用评论

master
IYUU 5 years ago
parent 3b3289274b
commit 4896e08635
  1. 38
      app/AutoReseed.php
  2. 2
      config/config.sample.php

@ -46,7 +46,7 @@ class AutoReseed
* cookie检查
* @var array
*/
public static $cookieCheck = ['hdchina','hdcity'];
public static $cookieCheck = ['hdchina','hdcity','ccfbits'];
/**
* 缓存路径
* @var string
@ -567,6 +567,39 @@ class AutoReseed
// 城市下载种子时会302转向
$url = download($url, $cookie, $userAgent);
break;
case 'ccfbits':
$_url = 'http://' .$sites[$sitesID]['base_url']. '/' .$download_page;
$cookie = isset($configALL[$siteName]['cookie']) ? $configALL[$siteName]['cookie'] : '';
$userAgent = $configALL['default']['userAgent'];
print "种子:".$_url. "\n";
// 评论url
$commentUrl = 'http://' .$sites[$sitesID]['base_url']. '/comment.php?action=add';
// 评论数据
$data = ['谢谢','谢谢分享','感谢发布者','谢谢分享!','谢谢分享。','感谢分享','感谢分享!','感谢分享。','感谢','谢谢发布者'];
$conut = count($data)-1;
$commentData = [
'body' => $data[mt_rand(0, $conut)],
'tid' => $value['torrent_id'],
];
if (isset($configALL[$siteName]['comment'])) {
// 自动评论
self::$curl->post($commentUrl, $commentData);
sleep(mt_rand(2, 3));
$url = download($_url, $cookie, $userAgent);
}else {
$url = download($_url, $cookie, $userAgent);
// 检查是否需要自动评论
if (strpos($url, '必须填写种子评论后才能下载该种子') != false) {
echo "当前站点您的等级太低,已启用自动评论下载种子功能 \n";
ff($siteName. '站点,辅种时已启用自动评论');
$configALL[$siteName]['comment'] = 1;
//自动评论
self::$curl->post($commentUrl, $commentData);
sleep(mt_rand(2, 3));
$url = download($_url, $cookie, $userAgent);
}
}
break;
default:
// 默认站点:推送给下载器种子URL链接
break;
@ -895,6 +928,9 @@ class AutoReseed
}
$url = $_url."&passkey=". $configALL[$site]['passkey'] . $ip_type. "&https=1";
break;
case 'ccfbits':
$url = $_url;
break;
default:
$url = $_url."&passkey=". $configALL[$site]['passkey'];
break;

@ -373,7 +373,7 @@ return array(
// 如果需要自动辅种,必须配置
'passkey' => '',
),
// upxin 序号:37
// hdu 序号:37
'upxin' => array(
// 如果需要用下载免费种脚本,须配置(只是自动辅种,可以不配置此项)
'cookie' => '',

Loading…
Cancel
Save