[add] ManGa

This commit is contained in:
Lkeme 2020-02-08 17:40:38 +08:00
parent f3ecfe5255
commit e2b09b8ded
38 changed files with 201 additions and 84 deletions

View File

@ -1,6 +1,32 @@
# Release Notes
# 本项目Log
## v0.2.0.200208 alpha (2020-02-08)
### Added
- 哔哩哔哩漫画助手(可选)
-
### Changed
- 补充部分过滤关键字
-
### Fixed
- 修复一处内存异常
-
## v0.1.0.200111 alpha (2020-01-11)
### Added
- 天选时刻奖品过滤
-
### Changed
-
### Fixed
-
## v0.1.0.200128 alpha (2020-01-28)
### Added

60
DOC.md
View File

@ -2,7 +2,7 @@
<p align="center"><img width="300px" src="https://i.loli.net/2018/04/20/5ad97bd395912.jpeg"></p>
<p align="center">
<img src="https://img.shields.io/badge/version-0.1.0.200128 alpha-green.svg?longCache=true&style=for-the-badge">
<img src="https://img.shields.io/badge/version-0.2.0.200208 alpha-green.svg?longCache=true&style=for-the-badge">
<img src="https://img.shields.io/badge/license-mit-blue.svg?longCache=true&style=for-the-badge">
</p>
@ -11,34 +11,33 @@
B 站直播实用脚本
## 功能组件
|plugin |version |description |
|--------------------|--------------------|--------------------|
|Login |19.12.27 |账号登录 |
|Sleep |19.12.27 |休眠控制 |
|MasterSite |19.12.27 |主站助手 |
|Daily |19.12.27 |每日礼包 |
|Heart |19.12.27 |双端心跳 |
|Task |19.12.27 |每日任务 |
|Silver |19.12.27 |银瓜子宝箱 |
|Barrage |19.12.27 |活跃弹幕 |
|Silver2Coin |19.12.27 |银瓜子换硬币 |
|GiftSend |19.12.27 |礼物赠送 |
|GroupSignIn |19.12.27 |友爱社签到 |
|GiftHeart |19.12.27 |心跳礼物 |
|MaterialObject |19.12.27 |实物抽奖 |
|AloneTcpClient |19.12.27 |独立监控 |
|ZoneTcpClient |19.12.27 |分区监控 |
|StormRaffle |20.01.03 |节奏风暴 |
|GiftRaffle |20.01.28 |活动礼物 |
|PkRaffle |20.01.03 |大乱斗 |
|GuardRaffle |20.01.03 |舰长总督 |
|AnchorRaffle |20.01.11 |天选时刻 |
|AwardRecord |19.12.27 |获奖通知 |
|Statistics |19.12.27 |数据统计 |
|Login |20.02.08 |账号登录 |
|Sleep |20.02.08 |休眠控制 |
|MasterSite |20.02.08 |主站助手 |
|Daily |20.02.08 |每日礼包 |
|Heart |20.02.08 |双端心跳 |
|Task |20.02.08 |每日任务 |
|Silver |20.02.08 |银瓜子宝箱 |
|Barrage |20.02.08 |活跃弹幕 |
|Silver2Coin |20.02.08 |银瓜子换硬币 |
|GiftSend |20.02.08 |礼物赠送 |
|GroupSignIn |20.02.08 |友爱社签到 |
|ManGa |20.02.08 |漫画签到分享 |
|GiftHeart |20.02.08 |心跳礼物 |
|MaterialObject |20.02.08 |实物抽奖 |
|AloneTcpClient |20.02.08 |独立监控 |
|ZoneTcpClient |20.02.08 |分区监控 |
|StormRaffle |20.02.08 |节奏风暴 |
|GiftRaffle |20.02.08 |活动礼物 |
|PkRaffle |20.02.08 |大乱斗 |
|GuardRaffle |20.02.08 |舰长总督 |
|AnchorRaffle |20.02.08 |天选时刻 |
|AwardRecord |20.02.08 |获奖通知 |
|Statistics |20.02.08 |数据统计 |
## 打赏赞助
@ -97,12 +96,15 @@ $ cp user.conf.example user.conf
```
$ composer install
```
3. 按照说明修改配置文件 `user.conf`,只需填写帐号密码即可
3. 按照说明修改配置文件 `user.conf`
```
# 默认只需填写帐号密码,按需求开启其他功能即可
```
4. 运行测试
```
$ php index.php
```
> 以下是`多开方案`,单个账户可以无视
> 以下是`多账户多开方案`,单个账户可以无视
5. 复制一份example配置文件修改账号密码即可
```
$ php index.php example.conf
@ -113,14 +115,14 @@ $ php index.php
## 升级指南
> 注意新版本的配置文件是否变动,则需要重新覆盖配置文件,并重新填写设置
1. 进入项目目录
```
$ cd BiliHelper-personal
```
2. 拉取最新代码
```
$ git pull
$ git pull
```
3. 更新依赖库
```

View File

@ -57,6 +57,9 @@ ADD_COIN_AV=33492180
USE_SLEEP=true
SLEEP_SECTION=2,3,4,5,6
# 漫画助手
USE_MANGA=false
#######################
# 基础设置 #
#######################

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Core;
@ -65,6 +65,7 @@ class App
'Sleep',
'MasterSite',
'Daily',
'ManGa',
'Heart',
'Task',
'Silver',

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Core;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Core;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Core;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;
@ -38,11 +38,12 @@ class AnchorRaffle extends BaseRaffle
$default_words = [
'拉黑', '黑名单', '脸皮厚', '没有奖品', '无奖', '脸皮厚', 'ceshi', '测试', '测试', '测试', '脚本',
'抽奖号', '星段位', '星段位', '圣晶石', '圣晶石', '水晶', '水晶', '万兴神剪手', '万兴神剪手',
'自付邮费', '自付邮费', "test", "Test", "TEST", "加密", "QQ", "测试", "測試", "VX", "vx",
"ce", "shi", "这是一个", "lalall", "第一波", "第二波", "第三波", "测试用", "抽奖标题", "策是",
"房间抽奖", "CESHI", "ceshi", "奖品A", "奖品B", "奖品C", "硬币", "无奖品", "白名单", "我是抽奖",
"0.1", "五毛二", "一分", "一毛", "0.52", "0.66", "0.01", "0.77", "0.16", "照片", "", "0.5",
"0.88", "双排"
'自付邮费', '自付邮费', 'test', 'Test', 'TEST', '加密', 'QQ', '测试', '測試', 'VX', 'vx',
'ce', 'shi', '这是一个', 'lalall', '第一波', '第二波', '第三波', '测试用', '抽奖标题', '策是',
'房间抽奖', 'CESHI', 'ceshi', '奖品A', '奖品B', '奖品C', '硬币', '无奖品', '白名单', '我是抽奖',
'0.1', '五毛二', '一分', '一毛', '0.52', '0.66', '0.01', '0.77', '0.16', '照片', '穷', '0.5',
'0.88', '双排', '1毛', '1分', '1角', 'P口罩', '素颜', '写真', '图包', '五毛', '一角', '冥币',
'自拍', '日历', '0.22', '加速器', '越南盾'
];
$custom_words = empty(getenv('ANCHOR_FILTER_WORDS')) ? [] : explode(',', getenv('ANCHOR_FILTER_WORDS'));
$total_words = array_merge($default_words, $custom_words);

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -6,7 +6,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -4,7 +4,7 @@
* Website: https://mudew.com/
* Author: Lkeme
* License: The MIT License
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

71
src/plugin/ManGa.php Normal file
View File

@ -0,0 +1,71 @@
<?php
/**
* Website: https://mudew.com/
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;
use BiliHelper\Core\Log;
use BiliHelper\Core\Curl;
use BiliHelper\Util\TimeLock;
class ManGa
{
use TimeLock;
public static function run()
{
if (self::getLock() > time() || getenv('USE_MANGA') == 'false') {
return;
}
if (self::sign() && self::share()) {
self::setLock(24 * 60 * 60);
return;
}
self::setLock(3600);
}
private static function sign(): bool
{
sleep(1);
$payload = [
'access_key' => getenv('ACCESS_TOKEN'),
'ts' => time()
];
$raw = Curl::post('https://manga.bilibili.com/twirp/activity.v1.Activity/ClockIn', Sign::api($payload));
$de_raw = json_decode($raw, true);
# {"code":0,"msg":"","data":{}}
# {"code":"invalid_argument","msg":"clockin clockin is duplicate","meta":{"argument":"clockin"}}
if (!$de_raw['code']) {
Log::notice('漫画签到: 成功~');
} else {
Log::warning('漫画签到: 失败或者重复操作~');
}
return true;
}
private static function share(): bool
{
sleep(1);
$payload = [];
$url = "https://manga.bilibili.com/twirp/activity.v1.Activity/ShareComic";
$raw = Curl::post($url, Sign::api($payload));
$de_raw = json_decode($raw, true);
# {"code":0,"msg":"","data":{"point":5}}
# {"code":1,"msg":"","data":{"point":0}}
if (!$de_raw['code']) {
Log::notice('漫画分享: 成功~');
} else {
Log::warning('漫画分享: 失败或者重复操作~');
}
return true;
}
}

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;
@ -43,7 +43,10 @@ class MaterialObject
*/
protected static function drawLottery(): bool
{
$block_key_list = ['测试', '加密', 'test', 'TEST', '钓鱼', '炸鱼', '调试'];
$block_key_list = [
'测试', '加密', 'test', 'TEST', '钓鱼', '炸鱼', '调试', "123", "1111", "测试", "測試","Test",
"测一测", "ce-shi", "test", "T-E-S-T", "lala", "我是抽奖标题", "压测", "測一測", "t-e-s-t"
];
$flag = 5;
for ($i = self::$start_aid; $i < self::$end_aid; $i++) {

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;
@ -41,14 +41,8 @@ class Statistics
*/
public static function addPushList(string $key): bool
{
// 初始化三个必要值
if (!array_key_exists($key, self::$push_list)) {
self::$push_list[$key] = [];
self::$join_list[$key] = [];
self::$success_list[$key] = [];
}
array_push(self::$push_list[$key], 1);
self::initKeyValue(self::$push_list, $key);
self::$push_list[$key]++;
return true;
}
@ -60,7 +54,8 @@ class Statistics
*/
public static function addJoinList(string $key): bool
{
array_push(self::$join_list[$key], 1);
self::initKeyValue(self::$join_list, $key);
self::$join_list[$key]++;
return true;
}
@ -72,7 +67,23 @@ class Statistics
*/
public static function addSuccessList(string $key): bool
{
array_push(self::$success_list[$key], 1);
self::initKeyValue(self::$success_list, $key);
self::$success_list[$key]++;
return true;
}
/**
* @use 初始化键值
* @param array $target
* @param string $key
* @param int $value
* @return bool
*/
private static function initKeyValue(array &$target, string $key, $value = 0): bool
{
if (!array_key_exists($key, $target)) {
$target[$key] = $value;
}
return true;
}
@ -85,14 +96,13 @@ class Statistics
{
if (empty(self::$push_list)) {
return false;
} else {
Log::info("-----------密----------封---------线------------");
}
Log::info("-----------密----------封---------线------------");
foreach (self::$push_list as $key => $val) {
$title = $key;
$push_num = count(self::$push_list[$key]);
$join_num = count(self::$join_list[$key]);
$success_num = count(self::$success_list[$key]);
$push_num = isset(self::$push_list[$key]) ? self::$push_list[$key] : 0;
$join_num = isset(self::$join_list[$key]) ? self::$join_list[$key] : 0;
$success_num = isset(self::$success_list[$key]) ? self::$success_list[$key] : 0;
$content = "{$title}: #推送 {$push_num} #参与 {$join_num} #成功 {$success_num}";
Log::notice($content);
}

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Plugin;

View File

@ -5,7 +5,7 @@
* Author: Lkeme
* License: The MIT License
* Email: Useri@live.cn
* Updated: 2019 ~ 2020
* Updated: 2020 ~ 2021
*/
namespace BiliHelper\Util;