diff --git a/composer.json b/composer.json index 3bbde41..9fcf37d 100644 --- a/composer.json +++ b/composer.json @@ -1,63 +1,81 @@ { - "name": "lkeme/bilihelper-personal", - "description": "B 站自动领瓜子、直播助手、直播挂机脚本、主站助手 - PHP 版(Personal)", - "type": "project", - "version": "2.*.*-dev", - "minimum-stability": "stable", - "license": "MIT", - "authors": [ - { - "name": "Lkeme", - "email": "Useri@live.cn", - "homepage": "https://mudew.com", - "role": "Developer" - } - ], - "keywords": [], - "homepage": "https://github.com/lkeme/BiliHelper-personal", - "readme": "https://github.com/lkeme/BiliHelper-personal/blob/master/README.md", - "support": { - "issues": "https://github.com/lkeme/BiliHelper-personal/issues?state=open", - "wiki": "https://github.com/lkeme/BiliHelper-personal/wiki", - "source": "https://github.com/lkeme/BiliHelper-personal" - }, - "repositories": [ - { - "description": "PhpComposer(全量)", - "type": "composer", - "url": "https://packagist.phpcomposer.com", - "canonical": false - } - ], - "require": { - "php": ">=8.1", - "ext-curl": "*", - "ext-openssl": "*", - "ext-sockets": "*", - "ext-json": "*", - "ext-zlib": "*", - "ext-mbstring": "*", - "monolog/monolog": "dev-main", - "bramus/monolog-colored-line-formatter": "dev-master", - "symfony/yaml": "^6.0", - "toolkit/stdlib": "*", - "adhocore/cli": "dev-main", - "lkeme/data": "4.x-dev", - "grasmash/expander": "dev-main", - "amphp/amp": "3.x-dev", - "fire015/flintstone": "dev-master", - "overtrue/pinyin": "dev-master", - "guzzlehttp/guzzle": "^7.0", - "toolkit/pflag": "dev-main", - "symfony/console": "^6.0", - "malios/php-to-ascii-table": "dev-master" - }, - "autoload": { - "psr-4": { - "Bhp\\": "src/" + "name": "lkeme/bilihelper-personal", + "description": "B 站自动领瓜子、直播助手、直播挂机脚本、主站助手 - PHP 版(Personal)", + "type": "project", + "version": "2.*.*-dev", + "minimum-stability": "stable", + "license": "MIT", + "authors": [ + { + "name": "Lkeme", + "email": "Useri@live.cn", + "homepage": "https://mudew.com", + "role": "Developer" + } + ], + "keywords": [], + "homepage": "https://github.com/lkeme/BiliHelper-personal", + "readme": "https://github.com/lkeme/BiliHelper-personal/blob/master/README.md", + "support": { + "issues": "https://github.com/lkeme/BiliHelper-personal/issues?state=open", + "wiki": "https://github.com/lkeme/BiliHelper-personal/wiki", + "source": "https://github.com/lkeme/BiliHelper-personal" }, - "files": [ - "src/Helpers.php" - ] - } + "repositories": [ + { + "description": "PhpComposer", + "type": "composer", + "url": "https://packagist.phpcomposer.com", + "canonical": false + }, + { + "description": "TencentCloud", + "type": "composer", + "url": "https://mirrors.tencent.com/composer/", + "canonical": false + }, + { + "description": "packagist.kr", + "type": "composer", + "url": "https://packagist.kr", + "canonical": false + }, + { + "description": "AliCloud", + "type": "composer", + "url": "https://mirrors.aliyun.com/composer/", + "canonical": false + } + ], + "require": { + "php": ">=8.1", + "ext-curl": "*", + "ext-openssl": "*", + "ext-sockets": "*", + "ext-json": "*", + "ext-zlib": "*", + "ext-mbstring": "*", + "monolog/monolog": "dev-main", + "bramus/monolog-colored-line-formatter": "dev-master", + "symfony/yaml": "^6.0", + "toolkit/stdlib": "*", + "adhocore/cli": "dev-main", + "lkeme/data": "4.x-dev", + "grasmash/expander": "dev-main", + "amphp/amp": "3.x-dev", + "fire015/flintstone": "dev-master", + "overtrue/pinyin": "dev-master", + "guzzlehttp/guzzle": "^7.0", + "toolkit/pflag": "dev-main", + "symfony/console": "^6.0", + "malios/php-to-ascii-table": "dev-master" + }, + "autoload": { + "psr-4": { + "Bhp\\": "src/" + }, + "files": [ + "src/Helpers.php" + ] + } } diff --git a/docs/DOC.md b/docs/DOC.md index bb2fddf..02cbfb6 100644 --- a/docs/DOC.md +++ b/docs/DOC.md @@ -251,7 +251,7 @@ $ -e VERSION=2 # 使用 版本 V2.x.x(默认选项) > 以下加速镜像均为网络收集,感谢公益提供者,如有问题请联系删除 ```shell script -$ -e MIRRORS=0 # 使用 github.com(RAW|CDN +$ -e MIRRORS=0 # 使用 github.com(RAW|源站|默认) $ -e MIRRORS=1 # 使用 ghproxy.com(KR|韩国) $ -e MIRRORS=2 # 使用 gitclone.com(CN|中国) $ -e MIRRORS=3 # 使用 hub.gitfast.tk(US|美国) diff --git a/plugin/Login/Login.php b/plugin/Login/Login.php index 3645bdb..43a836e 100644 --- a/plugin/Login/Login.php +++ b/plugin/Login/Login.php @@ -368,6 +368,33 @@ class Login extends BasePlugin $this->loginAfter($mode, $response['code'], $response); } + /** + * @param string $qr + * @return void + */ + protected function qrcodeLoginShow(string $qr): void + { + Log::info("1.终端直接显示(输入:1)"); + Log::info("2.浏览器链接访问(输入:2)"); + $option = $this->cliInput("请输入二维码显示方式: "); + switch ($option) { + case '1': + // + $this->cliInput("请尝试放大窗口,以确保二维码完整显示,回车继续"); + Qrcode::show($qr); + break; + case '2': + Log::info("请使用浏览器访问下面的链接,以确保二维码完整显示"); +// $url = 'https://cli.im/api/qrcode/code?text=' . urlencode($qr) . '&mhid='; + $url = 'https://cli.im/api/qrcode/code?text=' . urlencode($qr); + Log::info($url); + break; + default: + failExit('无效的选项'); + } + } + + /** * 扫码登录 * @param string $mode @@ -377,12 +404,10 @@ class Login extends BasePlugin { Log::info("尝试 $mode 登录"); // - $this->cliInput("请尝试放大窗口,以确保二维码完整显示,回车继续"); - // $response = $this->fetchQrAuthCode(); $auth_code = $response['auth_code']; // - Qrcode::show($response['url']); + $this->qrcodeLoginShow($response['url']); // max 180 step 3 foreach (range(0, 180, 3) as $_) { sleep(3); diff --git a/profile/example/config/user.ini b/profile/example/config/user.ini index 2aadc75..84741fe 100644 --- a/profile/example/config/user.ini +++ b/profile/example/config/user.ini @@ -112,11 +112,11 @@ enable = false ; 动态抽奖&预约直播抽奖 [lottery] -enable = true +enable = false ; 抽奖模式 0.从最新Id开始抽奖 1.从最新Id的前2400个开始抽奖 lottery_mode = 0 ; 直播预约抽奖 -live_enable = true +live_enable = false ; 每日电池 对应直播间ID和直播间UID [daily_gold]