mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-19 01:20:08 +08:00
[update] VipPoint
This commit is contained in:
parent
df8f192ac3
commit
b827132931
19
README.md
19
README.md
@ -1,8 +1,8 @@
|
||||
<p align="center"><img width="300px" src="https://user-images.githubusercontent.com/19500576/118621710-36428180-b7f9-11eb-891d-3f5697347cef.png" alt=""></p>
|
||||
<p style="text-align: center;"><img width="300px" src="https://user-images.githubusercontent.com/19500576/118621710-36428180-b7f9-11eb-891d-3f5697347cef.png" alt=""></p>
|
||||
|
||||
[//]: # (<p align="center"><img width="300px" src="https://i.loli.net/2018/04/20/5ad97bd395912.jpeg"></p>)
|
||||
[//]: # (<p style="text-align: center;"><img width="300px" src="https://i.loli.net/2018/04/20/5ad97bd395912.jpeg"></p>)
|
||||
|
||||
<div align="center">
|
||||
<div style="text-align: center;">
|
||||
|
||||
[](https://github.com/lkeme/ )
|
||||

|
||||
@ -27,7 +27,7 @@
|
||||
[//]: # (<br>)
|
||||
</div>
|
||||
|
||||
<p align="center">
|
||||
<p style="text-align: center;">
|
||||
|
||||
<img src="https://img.shields.io/badge/Version-2.2.0.230806-orange.svg?longCache=true&style=for-the-badge" alt="">
|
||||
<img src="https://img.shields.io/badge/PHP-8.1+-green.svg?longCache=true&style=for-the-badge" alt="">
|
||||
@ -53,8 +53,8 @@
|
||||
|
||||
## 👤 游客访问
|
||||
|
||||
<p align="center">
|
||||
<img alingn="center" src="https://profile-counter.glitch.me/BiliHelper-personal/count.svg" alt=""/>
|
||||
<p style="text-align: center;">
|
||||
<img style="text-align: center;" src="https://profile-counter.glitch.me/BiliHelper-personal/count.svg" alt=""/>
|
||||
|
||||
[//]: # ( <br>)
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
|
||||
如果觉得本项目好用,对你有所帮助,欢迎打赏支持本项目,请作者喝杯奶茶可乐哦。
|
||||
|
||||
<p align="center"><img width="680px" src="https://user-images.githubusercontent.com/19500576/118621834-55d9aa00-b7f9-11eb-9de2-6cfd5e8f20e6.png"></p>
|
||||
<p style="text-align: center;"><img width="680px" src="https://user-images.githubusercontent.com/19500576/118621834-55d9aa00-b7f9-11eb-9de2-6cfd5e8f20e6.png" alt=""></p>
|
||||
|
||||
[comment]: <> ()
|
||||
|
||||
@ -92,7 +92,7 @@ Group: [602815575](https://jq.qq.com/?_wv=1027&k=UaalVexM) | **请不要来问
|
||||
以下任务都是按设定周期自动执行,`true`为正常使用,`false`为暂停使用或抛弃。
|
||||
|
||||
[//]: # (<details open><summary>点击展开</summary>)
|
||||
<details><summary><strong><code>已经藏起来啦~~ 点击展开 嘻嘻~</code></strong></summary></code>
|
||||
<details><summary><strong><code>已经藏起来啦~~ 点击展开 嘻嘻~</code></strong></summary>
|
||||
|
||||
<br>
|
||||
|
||||
@ -117,7 +117,6 @@ Group: [602815575](https://jq.qq.com/?_wv=1027&k=UaalVexM) | **请不要来问
|
||||
| DailyGold | 0.0.1 | 每日电池(APP) | Lkeme | 1114 | 24(小时) | √ |
|
||||
| PolishMedal | 0.0.1 | 点亮灰色勋章 | possible318/Lkeme | 1115 | 1(小时) | √ |
|
||||
|
||||
|
||||
</details>
|
||||
|
||||
## 🖥️星图
|
||||
@ -130,7 +129,7 @@ Group: [602815575](https://jq.qq.com/?_wv=1027&k=UaalVexM) | **请不要来问
|
||||
|
||||
效果图不代表当前版本,请以当前最新版本运行结果为准。
|
||||
|
||||
<p align="center"><img width="680px" src="https://user-images.githubusercontent.com/19500576/118621918-6853e380-b7f9-11eb-8c73-e041c402a56b.png" alt=""></p>
|
||||
<p style="text-align: center;"><img width="680px" src="https://user-images.githubusercontent.com/19500576/118621918-6853e380-b7f9-11eb-8c73-e041c402a56b.png" alt=""></p>
|
||||
|
||||
[comment]: <> ()
|
||||
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
* | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \ じしf_, )ノ
|
||||
* |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\
|
||||
*/
|
||||
|
||||
class JsonFileManager
|
||||
{
|
||||
private string $filename;
|
||||
|
||||
@ -90,6 +90,7 @@ a {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 4px rgb(32 107 196 / 25%);
|
||||
}
|
||||
|
||||
.form-control:disabled {
|
||||
background-color: #f1f5f9;
|
||||
opacity: 1;
|
||||
@ -123,6 +124,7 @@ a {
|
||||
background-color: #437cff;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
#success {
|
||||
background-color: #2fb344;
|
||||
cursor: default;
|
||||
|
||||
@ -258,7 +258,8 @@
|
||||
pt: pt,
|
||||
exception_url: url,
|
||||
error_code: config.error_code
|
||||
}, function (err) {})
|
||||
}, function (err) {
|
||||
})
|
||||
}
|
||||
|
||||
var throwError = function (errorType, config) {
|
||||
|
||||
@ -28,7 +28,6 @@ docker run -itd --rm -e CAPTCHA=1 -e CAPTCHA_HOST=localhost -e CAPTCHA_PORT=5000
|
||||
-e CAPTCHA_PORT=50002 # 验证码手动识别服务地址 默认 50001 需要注意端口映射关系
|
||||
```
|
||||
|
||||
|
||||
> 注意:如果你使用的是`docker-compose`,请参考`docker-compose.yml`文件中的`captcha`服务配置。
|
||||
|
||||
##### 本地用户
|
||||
@ -40,7 +39,6 @@ cd captcha && php -S localhost:50002
|
||||
|
||||
> 验证码处理目录在`captcha`目录下,可以自行修改。
|
||||
|
||||
|
||||
### 如何使用验证码手动识别服务地址
|
||||
|
||||
在开启验证码手动识别服务地址后,登录模块会自动显示手动地址。复制地址到浏览器中打开,会显示相应的界面。
|
||||
|
||||
33
docs/DOC.md
33
docs/DOC.md
@ -1,8 +1,8 @@
|
||||
<p align="center"><img width="300px" src="https://user-images.githubusercontent.com/19500576/118621710-36428180-b7f9-11eb-891d-3f5697347cef.png"></p>
|
||||
<p style="text-align: center;"><img width="300px" src="https://user-images.githubusercontent.com/19500576/118621710-36428180-b7f9-11eb-891d-3f5697347cef.png" alt=""></p>
|
||||
|
||||
[comment]: <> (<p align="center"><img width="300px" src="https://i.loli.net/2018/04/20/5ad97bd395912.jpeg"></p>)
|
||||
[comment]: <> (<p style="text-align: center;"><img width="300px" src="https://i.loli.net/2018/04/20/5ad97bd395912.jpeg"></p>)
|
||||
|
||||
<div align="center">
|
||||
<div style="text-align: center;">
|
||||
|
||||
[](https://github.com/lkeme/ )
|
||||

|
||||
@ -64,7 +64,9 @@
|
||||
<details>
|
||||
<summary>其余镜像 展开查看</summary>
|
||||
<pre><code>
|
||||
|
||||
+ cnpkg(全量镜像)
|
||||
|
||||
```shell script
|
||||
# 使用帮助
|
||||
> https://php.cnpkg.org/
|
||||
@ -108,7 +110,8 @@
|
||||
> composer config -g repos.packagist composer https://packagist.mirrors.sjtug.sjtu.edu.cn
|
||||
```
|
||||
|
||||
</code></pre>
|
||||
</code>
|
||||
</pre>
|
||||
</details>
|
||||
|
||||
## 使用指南
|
||||
@ -176,19 +179,20 @@ $ php app.php
|
||||
9. 单个或者多个插件测试
|
||||
|
||||
```shell
|
||||
$ php app.php test m:d -p plugin
|
||||
$ php app.php test m:d -P plugin,plugin1
|
||||
$ php app.php test m:d -p VipPoint
|
||||
$ php app.php test m:d -p plugin # 单个插件
|
||||
$ php app.php test m:d -p VipPoint # 单个插件示例
|
||||
$ php app.php test m:d -P plugin,plugin1 # 多个插件
|
||||
$ php app.php test m:d -P VipPoint,Lottery # 多个插件
|
||||
```
|
||||
|
||||
<p align="center"><img width="680px" src="https://user-images.githubusercontent.com/19500576/118621472-f8455d80-b7f8-11eb-9fec-500148a566b4.png"></p>
|
||||
<p style="text-align: center;"><img width="680px" src="https://user-images.githubusercontent.com/19500576/118621472-f8455d80-b7f8-11eb-9fec-500148a566b4.png" alt=""></p>
|
||||
|
||||
[comment]: <> (<p align="center"><img width="680px" src="https://i.loli.net/2018/04/21/5adb497dc3ece.png"></p>)
|
||||
[comment]: <> (<p style="text-align: center;"><img width="680px" src="https://i.loli.net/2018/04/21/5adb497dc3ece.png"></p>)
|
||||
|
||||
## Docker使用指南
|
||||
|
||||
<strong>🌐 镜像加速器</strong>(部分网络原因导致拉取镜像失败)<br/><br/>
|
||||
<details><summary><strong><code>已经藏起来啦~~ 点击展开 嘻嘻~</code></strong></summary></code>
|
||||
<details><summary><strong><code> ~</code></strong></summary>
|
||||
|
||||
> 以下是通用系统配置,部分特殊系统修改可能不一样,请自行搜索解决。
|
||||
|
||||
@ -210,10 +214,10 @@ $ php app.php test m:d -p VipPoint
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
<br>
|
||||
</details>
|
||||
|
||||
|
||||
1. 安装好[Docker](https://yeasy.gitbooks.io/docker_practice/content/install/)
|
||||
2. 直接命令行拉取镜像后运行
|
||||
|
||||
@ -231,7 +235,10 @@ $ docker run -itd --rm -e USER_NAME=你的B站登录账号 -e USER_PASSWORD=你
|
||||
|
||||
[//]: # (2. 修改)
|
||||
|
||||
1. 下载 [配置文件夹](https://github.com/lkeme/BiliHelper-personal/tree/master/profile) `注意是文件夹,可以完整下载后提出来`
|
||||
1.
|
||||
|
||||
下载 [配置文件夹](https://github.com/lkeme/BiliHelper-personal/tree/master/profile) `注意是文件夹,可以完整下载后提出来`
|
||||
|
||||
2. 重命名 `profile/example -> profile/user` , 修改 `profile/user/config/user.ini`
|
||||
3. 通过下面的命令进行挂载并运行
|
||||
|
||||
@ -356,7 +363,7 @@ stdout_logfile=/tmp/bilibili.log
|
||||
脚本出现 error 级别的报错,会调用通知地址进行提醒,这里推荐两个服务
|
||||
|
||||
| 服务 | 官网 |
|
||||
|---|---|
|
||||
|-------------|------------------------------------|
|
||||
| Server酱 | https://sc.ftqq.com/ |
|
||||
| TelegramBot | https://core.telegram.org/bots/api |
|
||||
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
* | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \ じしf_, )ノ
|
||||
* |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\
|
||||
*/
|
||||
|
||||
trait Bonus
|
||||
{
|
||||
use CommonTaskInfo;
|
||||
|
||||
39
plugin/VipPoint/Traits/DressBuyAmount.php
Normal file
39
plugin/VipPoint/Traits/DressBuyAmount.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Website: https://mudew.com/
|
||||
* Author: Lkeme
|
||||
* License: The MIT License
|
||||
* Email: Useri@live.cn
|
||||
* Updated: 2023 ~ 2024
|
||||
*
|
||||
* _____ _ _ _ _ _ _____ _ _____ _____ _____
|
||||
* | _ \ | | | | | | | | | | | ____| | | | _ \ | ____| | _ \ & /l、
|
||||
* | |_| | | | | | | | | |_| | | |__ | | | |_| | | |__ | |_| | (゚、 。 7
|
||||
* | _ { | | | | | | | _ | | __| | | | ___/ | __| | _ / \、゙ ~ヽ *
|
||||
* | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \ じしf_, )ノ
|
||||
* |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\
|
||||
*/
|
||||
trait DressBuyAmount
|
||||
{
|
||||
use CommonTaskInfo;
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param string $name
|
||||
* @return bool
|
||||
*/
|
||||
public function dressBuyAmount(array $data, string $name): bool
|
||||
{
|
||||
$title = '日常任务';
|
||||
$code = 'dressbuyamount';
|
||||
//
|
||||
if ($this->isComplete($data, $name, $title, $code)) {
|
||||
return true;
|
||||
}
|
||||
//
|
||||
return $this->worker($data, $name, $title, $code, 4);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
40
plugin/VipPoint/Traits/DressView.php
Normal file
40
plugin/VipPoint/Traits/DressView.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Website: https://mudew.com/
|
||||
* Author: Lkeme
|
||||
* License: The MIT License
|
||||
* Email: Useri@live.cn
|
||||
* Updated: 2023 ~ 2024
|
||||
*
|
||||
* _____ _ _ _ _ _ _____ _ _____ _____ _____
|
||||
* | _ \ | | | | | | | | | | | ____| | | | _ \ | ____| | _ \ & /l、
|
||||
* | |_| | | | | | | | | |_| | | |__ | | | |_| | | |__ | |_| | (゚、 。 7
|
||||
* | _ { | | | | | | | _ | | __| | | | ___/ | __| | _ / \、゙ ~ヽ *
|
||||
* | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \ じしf_, )ノ
|
||||
* |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\
|
||||
*/
|
||||
trait DressView
|
||||
{
|
||||
use CommonTaskInfo;
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param string $name
|
||||
* @return bool
|
||||
*/
|
||||
public function dressView(array $data, string $name): bool
|
||||
{
|
||||
$title = '日常任务';
|
||||
$code = 'dress-view';
|
||||
//
|
||||
if ($this->isComplete($data, $name, $title, $code)) {
|
||||
return true;
|
||||
}
|
||||
//
|
||||
$this->worker($data, $name, $title, $code, 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -26,10 +26,17 @@ trait PointInfo
|
||||
*/
|
||||
public function pointInfo(array $data, string $name): bool
|
||||
{
|
||||
$now = date('Y-m-d H:i:s', $data['data']['current_ts']);
|
||||
$ts = date('Y-m-d H:i:s', $data['data']['current_ts']);
|
||||
$point = $data['data']['point_info']['point'];
|
||||
|
||||
Log::notice("大会员积分@{$name}: 截至 {$now} 您当前拥有 {$point} 个积分");
|
||||
Log::notice("大会员积分@$name: 截至 $ts 您当前拥有 $point 个积分");
|
||||
//
|
||||
$score_limit = $data['data']['task_info']['score_limit'];
|
||||
$score_month = $data['data']['task_info']['score_month'];
|
||||
Log::notice("大会员积分@$name: 本月已经获得 $score_month/$score_limit 大积分");
|
||||
//
|
||||
$base_score = $data['data']['task_info']['sing_task_item']['base_score'];
|
||||
$sign_count = $data['data']['task_info']['sing_task_item']['count'];
|
||||
Log::notice("大会员积分@$name: 已连续签到 $sign_count 天 获取到 $base_score 个大积分");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
* | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \ じしf_, )ノ
|
||||
* |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\
|
||||
*/
|
||||
|
||||
trait Privilege
|
||||
{
|
||||
use CommonTaskInfo;
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
* | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \ じしf_, )ノ
|
||||
* |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\
|
||||
*/
|
||||
|
||||
trait ViewAnimate
|
||||
{
|
||||
use CommonTaskInfo;
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
* | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \ じしf_, )ノ
|
||||
* |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\
|
||||
*/
|
||||
|
||||
trait ViewFilmChannel
|
||||
{
|
||||
use CommonTaskInfo;
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
* | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \ じしf_, )ノ
|
||||
* |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\
|
||||
*/
|
||||
|
||||
trait ViewVipMall
|
||||
{
|
||||
use CommonTaskInfo;
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
|
||||
use Bhp\Api\Api\X\VipPoint\ApiTask;
|
||||
use Bhp\Cache\Cache;
|
||||
use Bhp\Log\Log;
|
||||
use Bhp\Plugin\BasePlugin;
|
||||
@ -39,6 +40,8 @@ class VipPoint extends BasePlugin
|
||||
use BuyVipProduct;
|
||||
use BuyVipMall;
|
||||
use PointInfo;
|
||||
use DressView;
|
||||
use DressBuyAmount;
|
||||
|
||||
/**
|
||||
* 插件信息
|
||||
@ -54,6 +57,16 @@ class VipPoint extends BasePlugin
|
||||
'cycle' => '5(分钟)', // 运行周期
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $home_task = 'https://big.bilibili.com/mobile/bigPoint/task';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $home = 'https://big.bilibili.com/mobile/bigPoint';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@ -69,9 +82,11 @@ class VipPoint extends BasePlugin
|
||||
* @var array|string[]
|
||||
*/
|
||||
protected array $target_tasks = [
|
||||
'signIn' => '签到任务',
|
||||
'bonus' => '福利任务',
|
||||
'privilege' => '体验任务',
|
||||
// 'dressUp' => '使用免费体验装扮权益',
|
||||
|
||||
'signIn' => '每日签到',
|
||||
'bonus' => '大会员福利大积分',
|
||||
'privilege' => '浏览大会员权益页面',
|
||||
'viewAnimate' => '浏览追番频道页10秒',
|
||||
'viewFilmChannel' => '浏览影视频道页10秒',
|
||||
'viewVipMall' => '浏览会员购页面10秒',
|
||||
@ -79,7 +94,9 @@ class VipPoint extends BasePlugin
|
||||
'buyVipVideo' => '购买单点付费影片',
|
||||
'buyVipProduct' => '购买指定大会员产品',
|
||||
'buyVipMall' => '购买指定会员购商品',
|
||||
'pointInfo' => '已有积分'
|
||||
'dressView' => '浏览装扮商城主页',
|
||||
'dressBuyAmount' => '购买装扮',
|
||||
'pointInfo' => '积分信息'
|
||||
];
|
||||
|
||||
/**
|
||||
@ -174,7 +191,7 @@ class VipPoint extends BasePlugin
|
||||
*/
|
||||
protected function getTaskList(): bool
|
||||
{
|
||||
$response = \Bhp\Api\Api\X\VipPoint\ApiTask::combine();
|
||||
$response = ApiTask::combine();
|
||||
if ($response['code']) {
|
||||
Log::warning('大会员积分: 获取任务列表失败');
|
||||
return false;
|
||||
|
||||
@ -62,6 +62,7 @@ class ApiTask
|
||||
$user = User::parseCookie();
|
||||
//
|
||||
$url = 'https://api.bilibili.com/pgc/activity/score/task/receive';
|
||||
// $url = 'https://api.bilibili.com/pgc/activity/score/task/receive/v2';
|
||||
$payload = [
|
||||
'taskCode' => $task_code,
|
||||
'csrf' => $user['csrf'],
|
||||
@ -82,6 +83,7 @@ class ApiTask
|
||||
$user = User::parseCookie();
|
||||
//
|
||||
$url = 'https://api.bilibili.com/pgc/activity/score/task/complete';
|
||||
// $url = 'https://api.bilibili.com/pgc/activity/score/task/complete/v2';
|
||||
$payload = [
|
||||
'taskCode' => $task_code,
|
||||
'csrf' => $user['csrf'],
|
||||
|
||||
@ -43,7 +43,8 @@ class ApiCaptcha
|
||||
* @param array $captcha
|
||||
* @return array
|
||||
*/
|
||||
public static function ocr(array $captcha):array{
|
||||
public static function ocr(array $captcha): array
|
||||
{
|
||||
$url = 'https://captcha-v1.mudew.com:19951/';
|
||||
$payload = [
|
||||
'type' => 'gt3',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user