{"id":13432410,"url":"https://github.com/shanmiteko/LotteryAutoScript","last_synced_at":"2025-03-16T23:31:24.427Z","repository":{"id":39339031,"uuid":"384606320","full_name":"shanmiteko/LotteryAutoScript","owner":"shanmiteko","description":"Bili动态抽奖助手","archived":false,"fork":false,"pushed_at":"2025-01-16T00:04:31.000Z","size":10351,"stargazers_count":853,"open_issues_count":19,"forks_count":170,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-01-16T01:23:40.334Z","etag":null,"topics":["bilibili","bilibili-lottery","nodejs"],"latest_commit_sha":null,"homepage":"https://gitlab.com/shanmiteko/LotteryAutoScript","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shanmiteko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://i0.hdslb.com/bfs/album/83958a52f62e81c71b93c683c835deff3b973918.png"]}},"created_at":"2021-07-10T04:03:38.000Z","updated_at":"2025-01-16T00:04:33.000Z","dependencies_parsed_at":"2024-03-09T08:29:17.279Z","dependency_job_id":"fd2140a7-10f2-47a2-9452-ac3dfe99ee44","html_url":"https://github.com/shanmiteko/LotteryAutoScript","commit_stats":null,"previous_names":[],"tags_count":126,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanmiteko%2FLotteryAutoScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanmiteko%2FLotteryAutoScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanmiteko%2FLotteryAutoScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanmiteko%2FLotteryAutoScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shanmiteko","download_url":"https://codeload.github.com/shanmiteko/LotteryAutoScript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243949910,"owners_count":20373655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bilibili","bilibili-lottery","nodejs"],"created_at":"2024-07-31T02:01:11.255Z","updated_at":"2025-03-16T23:31:21.434Z","avatar_url":"https://github.com/shanmiteko.png","language":"JavaScript","funding_links":["https://i0.hdslb.com/bfs/album/83958a52f62e81c71b93c683c835deff3b973918.png"],"categories":["其他"],"sub_categories":["直播脚本"],"readme":"# AutoScript\n\n- [AutoScript](#autoscript)\n  - [操作步骤](#操作步骤)\n    - [获取COOKIE](#获取cookie)\n      - [扫码登陆](#扫码登陆)\n      - [手动获取](#手动获取)\n    - [本地运行](#本地运行)\n      - [可执行文件](#可执行文件)\n      - [以源码方式运行](#以源码方式运行)\n    - [Docker](#docker)\n    - [青龙面板](#青龙面板)\n  - [检测中奖](#检测中奖)\n    - [检测未读信息, 已读未读信息](#检测未读信息-已读未读信息)\n    - [中奖推送](#中奖推送)\n  - [设置说明](#设置说明)\n    - [评论验证码识别](#评论验证码识别)\n    - [其他](#其他)\n  - [Awesome](#awesome)\n\n[Github仓库链接](https://github.com/shanmiteko/LotteryAutoScript)\n\n[![Package Node.js project into an executable](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/pkg.yml/badge.svg)](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/pkg.yml)\n\n[![Build and push Docker images](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/docker.yml/badge.svg)](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/docker.yml)\n\n[![Publishing to NPM](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/npmp.yml/badge.svg)](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/npmp.yml)\n\n[![Mirror and run GitLab CI](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/mirror.yml/badge.svg)](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/mirror.yml)\n\n已实现功能:\n\n- 监控用户转发\n- 监控话题页面\n- 监控专栏合集\n- 自动点赞、评论、乱序转发、@好友、带话题、可选随机动态\n- 直播预约抽奖\n- 检测是否中奖\n  - 已读@\n  - 已读私信\n- 清理动态关注\n- 检查更新\n- 更多功能设置请参考配置文件\n\n**声明**: 此脚本仅用于学习和测试，作者本人并不对其负责，请于运行测试完成后自行删除，请勿滥用！\n\n---------------------------------\n\n## 操作步骤\n\n**使用前务必阅读此教程和配置文件内注释**\n\n右上角\u003ckbd\u003e★ Star\u003c/kbd\u003e\n\n↓↓\n\n### 获取COOKIE\n\n#### 扫码登陆\n\n在`env.js`文件填`COOKIE`的对应位置写入`\"DedeUserID=你的UID\"`即可使用`lottery login`扫码自动获取Cookie\n\n`COOKIE`中包含`DedeUserID=你的UID`的都会被自动替换\n\n#### 手动获取\n\n第一种\n进入[B站主页](https://www.bilibili.com/)点击个人头像进入个人主页获取Cookie用于登录\n\nChrome浏览器:\n\n进入个人主页后\n1. `F12`打开控制台\n\n2. F5刷新\n\n3. 根据图中找到network/网络 搜索nav,点击找到的nav,点标头，下滑，找到COOKIE全部复制\n![image](doc/pic/getCookies2.png)\n\n注意！！！！！！！！！！！\n\n注意！！！！！！！！！！！\n\n注意！！！！！！！！！！！\n\n所有网页端获取的COOKIE，每次打开网页端时，都会有概率刷新COOKIE，点击退出账号则会退出当前COOKIE。可以利用Chrome内核的浏览器创建多用户，专门用于获取COOKIE。\n\n注意！！！！！！！！！！！\n\n注意！！！！！！！！！！！\n\n注意！！！！！！！！！！！\n\n\n第二种\n进入[B站主页](https://www.bilibili.com/)获取Cookie用于登录\n\nChrome浏览器:\n\n1. `F12`打开控制台\n\n2. 进入Application找到Cookies栏中的SESSDATA将HttpOnly选项**取消**勾选  \n\n    (此步骤是为了方便后续采用JS获取Cookies,获取完毕后应再次勾选)\n\n![取消httponly](https://raw.githubusercontents.com/shanmiteko/LotteryAutoScript/main/doc/pic/getCookies.png)\n\n3. 在Console中复制以下代码回车  \n\n    ```js\n    /** 自动复制到粘贴板 */\n    document\n      .cookie\n      .split(/\\s*;\\s*/)\n      .map(it =\u003e it.split('='))\n      .filter(it =\u003e ['DedeUserID','bili_jct', 'SESSDATA', 'buvid3'].indexOf(it[0]) \u003e -1)\n      .map(it =\u003e it.join('='))\n      .join('; ')\n      .split()\n      .forEach(it =\u003e copy(it) || console.log(it))\n    ```\n\n也可以采用**其他方式获取**所需的Cookie\n\n只需含有 `DedeUserID=...;SESSDATA=...;bili_jct=...;buvid3=...` 即可\n\nbuvid3亦可不填 使用随机生成值\n\n(分号分割, 不要换行, 顺序随意)\n\n↓↓\n\n### 本地运行\n\n#### 可执行文件\n\n1. [[下载](https://github.com/shanmiteko/LotteryAutoScript/releases)|[cnpmjs镜像下载](https://github.com.cnpmjs.org/shanmiteko/LotteryAutoScript/releases)|[Fastgit镜像下载](https://hub.fastgit.org/shanmiteko/LotteryAutoScript/releases)]压缩包并解压后\n\n   ```\n    ~/nlts-linux-x64\n    =\u003e tree\n    .\n    ├── env.js          (便捷设置环境变量和多账号参数)\n    ├── lottery         (可执行文件)\n    ├── my_config.js    (自定义设置文件) (!使用前必读)\n    └── README.md       (说明文件)\n   ```\n\n2. 用记事本或其他编辑器修改`env.js`和`my_config.js`文件(右键选择用记事本打开)\n3. 在`env.js`中填入`COOKIE`和推送参数\n4. 在`my_config.js`中自定义设置\n5. 在当前目录下**打开终端**运行可执行文件`lottery`(勿直接点击`lottery`)\n  - windows 可直接点击对应的`*.bat`文件\n\n    ```\n    用法: lottery [OPTIONS]\n    \n    OPTIONS:\n            start  启动抽奖\n            check  中奖检查\n            acount 查看帐号信息\n            clear  清理动态和关注\n            update 检查更新\n            login  扫码登录更新CK\n            help   帮助信息\n    ```\n\n1. 运行截图\n    ![lottery_start](https://raw.githubusercontents.com/shanmiteko/LotteryAutoScript/main/doc/pic/lottery_start.png)\n\n#### 以源码方式运行\n\n[点击跳转](doc/run_use_sc.md)\n\n----------------------------------------\n\n### Docker\n\n[点击跳转](doc/run_use_docker.md)\n\n----------------------------------------\n\n### 青龙面板\n\n[点击跳转](doc/run_use_ql.md)\n\n----------------------------------------\n\n## 检测中奖\n\n### 检测未读信息, 已读未读信息\n\n判断依据\n\n- 通过`@`信息判断\n\n- 通过私信判断\n\n关键词有限 可能会有**漏掉**的或**误报**\n\n### 中奖推送\n\n\u003e 填写在env.js内\n\n以下是支持的推送方式\n\n|        Name        |                                        归属                                        | 说明                                                                                                                                                                                                                                                                                         |\n| :----------------: | :--------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n|      `SCKEY`       |                          微信server酱推送(于2021/4月下线)                          | server酱的微信通知[官方文档](http://sc.ftqq.com/3.version)                                                                                                                                                                                                                                   |\n|     `SENDKEY`      |                             微信server酱(Turbo版)推送                              | [获取SENDKEY](https://sct.ftqq.com/sendkey) [选择消息通道](https://sct.ftqq.com/forward)                                                                                                                                                                                                     |\n|    `BARK_PUSH`     | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | IOS用户下载BARK这个APP,填写内容是app提供的`设备码`，例如：\u003chttps://api.day.app/123\u003e ，那么此处的设备码就是`123`，再不懂看 [这个图](https://raw.githubusercontents.com/shanmiteko/LotteryAutoScript/main/doc/pic/bark.jpg)（注：支持自建填完整链接即可）                                      |\n|    `BARK_SOUND`    | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | bark推送声音设置，例如`choo`,具体值请在`bark`-`推送铃声`-`查看所有铃声`                                                                                                                                                                                                                      |\n|   `PUSHDEER_URL`   |                  [Pushdeer](https://github.com/easychen/pushdeer)                  | 推送api 默认: \u003chttps://api2.pushdeer.com/message/push\u003e                                                                                                                                                                                                                                       |\n| `PUSHDEER_PUSHKEY` |                  [Pushdeer](https://github.com/easychen/pushdeer)                  | PushKey                                                                                                                                                                                                                                                                                      |\n|   `TG_BOT_TOKEN`   |                                    telegram推送                                    | tg推送(需设备可连接外网),`TG_BOT_TOKEN`和`TG_USER_ID`两者必需,填写自己申请[@BotFather](https://t.me/BotFather)的Token,如`10xxx4:AAFcqxxxxgER5uw` , [具体教程](doc/TG_PUSH.md)                                                                                                                |\n|    `TG_USER_ID`    |                                    telegram推送                                    | tg推送(需设备可连接外网),`TG_BOT_TOKEN`和`TG_USER_ID`两者必需,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](doc/TG_PUSH.md)                                                                                                                                   |\n|  `TG_PROXY_HOST`   |                                 Telegram 代理的 IP                                 | 代理类型为 http。例子：http代理 \u003chttp://127.0.0.1:1080\u003e 则填写 127.0.0.1                                                                                                                                                                                                                     |\n|  `TG_PROXY_PORT`   |                                Telegram 代理的端口                                 | 例子：http代理 \u003chttp://127.0.0.1:1080\u003e 则填写 1080                                                                                                                                                                                                                                           |\n|   `DD_BOT_TOKEN`   |                                      钉钉推送                                      | 钉钉推送(`DD_BOT_TOKEN`和`DD_BOT_SECRET`两者必需)[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于`=`符号后面的XXX即可                                                                                      |\n|  `DD_BOT_SECRET`   |                                      钉钉推送                                      | (`DD_BOT_TOKEN`和`DD_BOT_SECRET`两者必需) ,密钥，机器人安全设置页面，加签一栏下面显示的SEC开头的`SECXXXXXXXXXX`等字符 , 注:钉钉机器人安全设置只需勾选`加签`即可，其他选项不要勾选,再不懂看 [这个图](https://raw.githubusercontents.com/shanmiteko/LotteryAutoScript/main/doc/pic/DD_bot.png) |\n|  `IGOT_PUSH_KEY`   |                                      iGot推送                                      | iGot聚合推送，支持多方式推送，确保消息可达。 [参考文档](https://wahao.github.io/Bark-MP-helper )                                                                                                                                                                                             |\n|     `QQ_SKEY`      |                                酷推(Cool Push)推送                                 | 推送所需的Skey,登录后获取Skey [参考文档](https://cp.xuthus.cc/)                                                                                                                                                                                                                              |\n|     `QQ_MODE`      |                                酷推(Cool Push)推送                                 | 推送方式(send或group或者wx，默认send) [参考文档](https://cp.xuthus.cc/)                                                                                                                                                                                                                      |\n|     `QYWX_AM`      |                                    企业微信应用                                    | 第一个值是企业id，第二个值是secret，第三个值@all(或者成员id)，第四个值是AgentID (逗号分割) 可查看此[教程](http://note.youdao.com/s/HMiudGkb) [官方文档](https://developer.work.weixin.qq.com/document/path/90236)                                                                            |\n|     `QYWX_KEY`     |                                  企业微信Bot推送                                   | 密钥，企业微信推送 webhook 后面的 key [详见官方说明文档](https://work.weixin.qq.com/api/doc/90000/90136/91770)                                                                                                                                                                               |\n| `PUSH_PLUS_TOKEN`  |                                    pushplus推送                                    | 微信扫码登录后一对一推送或一对多推送下面的token(您的Token) [官方网站](http://pushplus.hxtrip.com/)                                                                                                                                                                                           |\n|  `PUSH_PLUS_USER`  |                                    pushplus推送                                    | 一对多推送的“群组编码”（一对多推送下面-\u003e您的群组(如无则新建)-\u003e群组编码）注:(1、需订阅者扫描二维码 2、如果您是创建群组所属人，也需点击“查看二维码”扫描绑定，否则不能接受群组消息推送)，只填`PUSH_PLUS_TOKEN`默认为一对一推送                                                                  |\n|     `QMSG_KEY`     |                      [Qmsg酱](https://qmsg.zendee.cn)私聊推送                      | [Qmsg注册](https://qmsg.zendee.cn/login.html)                                                                                                                                                                                                                                                |\n|     `QMSG_QQ`      |                       私聊消息推送接口，指定需要接收消息的QQ                       | 指定的QQ号必须在你的[管理台](https://qmsg.zendee.cn/me.html)已添加                                                                                                                                                                                                                           |\n|    `SMTP_HOST`     |                                      电子邮件                                      | smtp服务器的主机名 如: `smtp.qq.com`                                                                                                                                                                                                                                                         |\n|    `SMTP_PORT`     |                                      电子邮件                                      | smtp服务器的端口 如: `465`                                                                                                                                                                                                                                                                   |\n|    `SMTP_USER`     |                                      电子邮件                                      | 发送方的电子邮件   如: `xxxxxxxxx@qq.com`                                                                                                                                                                                                                                                    |\n|    `SMTP_PASS`     |                                      电子邮件                                      | smtp服务对应的授权码                                                                                                                                                                                                                                                                         |\n|   `SMTP_TO_USER`   |                                      电子邮件                                      | 接收方电子邮件                                                                                                                                                                                                                                                                               |\n|    `GOTIFY_URL`    |                                     gotify推送                                     | gotify消息推送地址(例如 http://localhost:8008/message)，[官方文档](https://gotify.net/docs/)                                                                                                                                                                                                 |\n|  `GOTIFY_APPKEY`   |                                     gotify推送                                     | 一个gotify application的token，[官方文档](https://gotify.net/docs/)                                                                                                                                                                                                                          |\n\n----------------------------------------\n\n## 设置说明\n\n### 评论验证码识别\n\n[点击跳转](doc/chat_captcha_orc.md)\n\n### 其他\n\n详见[env.example.js](./env.example.js)文件内部注释\n\n详见[my_config.example.js](./my_config.example.js)文件内部注释\n\n----------------------------------------\n\n## Awesome\n相关项目\n\n- [LotteryAutoScript_Station](https://github.com/spiritLHLS/LotteryAutoScript_Station) - [@spiritLHL](https://github.com/spiritLHLS)\n- [sync_lottery](https://github.com/spiritLHLS/sync_lottery) - [@spiritLHL](https://github.com/spiritLHLS)\n- [BDSF](https://github.com/spiritLHLS/BDSF) - [@spiritLHL](https://github.com/spiritLHLS)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanmiteko%2FLotteryAutoScript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshanmiteko%2FLotteryAutoScript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanmiteko%2FLotteryAutoScript/lists"}