GithubHelp home page GithubHelp logo

bilive / bilive_client Goto Github PK

View Code? Open in Web Editor NEW
457.0 38.0 109.0 828 KB

基于Node.JS的bilibili账号活跃系统

License: MIT License

TypeScript 94.06% JavaScript 5.85% Dockerfile 0.09%
bilibili bilibili-live

bilive_client's People

Contributors

lyzhang0113 avatar lzghzr avatar putegg avatar shugen002 avatar tzhongyan avatar vector000 avatar zsnmwy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bilive_client's Issues

作者你好~

作者你的挂机很好用,我想问下你有群么?很多人想反应或者提交意见都无处可寻~

B站又乱改返回值

今天上线的新活动,实测发现B站对dataJson.giftId的返回值进行了修改

我将listener.js:47中的if (dataJson.giftId === 103)修改为if (dataJson.giftId === 106)后可以正常抽火力票,大大可以更新一波

嘛,破站就知道瞎改ㄟ( ▔, ▔ )ㄏ

多账号刷新验证码过快导致无法获取cookie【可能】

前几个账号还好,正常更新,后面的就出现
Nov 18 2017 18:24:06 : shenjingzhi Token更新失败 { ts: 1511000666, message: 'CAPTCHA is not match', code: -105 }
我看账号和账号之间的更新时间几乎没有延时,也许每个账号更新增加点时间间隔比较好吧?

网络状况不佳时,程序会崩溃退出

控制台信息:

Jan 28 2018 20:59:27 : 尝试重连弹幕服务器失败,五分钟后再次重新连接
Jan 28 2018 21:02:30 : http://api.live.bilibili.com/YunYing/roomEvent?event_type=newspring-4539&room_id=939654&access_key=45f10954ee61e618be0652bd9d37fa16&actionKey=appkey&appkey=1d8b6e7d45233436&build=521200&mobi_app=android&platform=android&ts=1517144069&sign=eb6c0e0e5e28ec9e2fef2a2cc1c89240 { Error: read ECONNABORTED
    at _errnoException (util.js:1024:11)
    at TCP.onread (net.js:615:25) code: 'ECONNABORTED', errno: 'ECONNABORTED', syscall: 'read' }
Jan 28 2018 21:02:30 : http://api.live.bilibili.com/User/userOnlineHeart { Error: read ECONNABORTED
    at _errnoException (util.js:1024:11)
    at TCP.onread (net.js:615:25) code: 'ECONNABORTED', errno: 'ECONNABORTED', syscall: 'read' }
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: connect ENETUNREACH 101.200.58.11:80 - Local (0.0.0.0:0)
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at internalConnect (net.js:971:16)
    at emitLookup (net.js:1106:7)
    at options.lookup (/data/data/com.termux/files/home/bilive_client/bilive/lib/tools.js:50:24)
    at lookupAndConnect (net.js:1087:3)
    at Socket.connect (net.js:1028:5)
    at Object.connect (net.js:103:35)
    at Agent.IP.httpAgent.createConnection (/data/data/com.termux/files/home/bilive_client/bilive/lib/tools.js:52:24)
    at Agent.createSocket (_http_agent.js:237:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

2018-01-28T13_02_30_711Z-debug.log

活动高能没触发抽奖(bilibili live-star活动)

如题,在各位巨佬各显神通的情况下,我发现如果直播间的抽奖高能是被“嗨翻全场”道具触发,挂机系统就不会触发抽奖;225x哔哩星的就没问题

我怀疑是giftID返值不同的原因,尝试过翻看数据,但我找不到有关于giftID的信息,希望作者大佬可以注意一下,或者给介绍下是哪个GET/POST资源的返值呢?

今天更新之后出现应援团错误跟日常错误

Dec 08 2017 01:00:55 : 1 应援团签到 获取应援团列表失败 { code: 0, msg: '', message: '', data: { list: [] } }
Dec 08 2017 01:00:55 : 3 日常活动 签名校验错误
Dec 08 2017 01:00:55 : 2 日常活动 签名校验错误
Dec 08 2017 01:00:55 : 3 每日签到 已签到
Dec 08 2017 01:00:55 : 2 应援团签到 获取应援团列表失败 { code: 0, msg: '', message: '', data: { list: [] } }
是什么情况?

意见反馈及常见问题整理

  1. 下载以后无法运行 #8 #16 #24
    不懂得nodejs以及npm的, 到releases下载编译好的版本
    按照README上的操作一步一步完成
  2. 需要在其他平台运行 #1 #28
    因为我只在Windows和Debian上测试过, 对于其他没有root权限的云平台不是很了解
    建议在百度或者谷歌搜索此平台nodejs的搭建步骤, 以及ip和端口绑定的方法
  3. 因为版本更新导致新版无法使用 #20 #26 #31
    因为一直跟着nodejs的LTS版本更新, 当nodejs改动较大时, 之前引用的模块会失效, 此时只要重新安装新版nodejs以及npm install即可
  4. 因为版本更新导致报错 #12 #34 #36
    当有一些新的点子但是受限于之前的配置文件时就会调整结构导致不可用或者报错
    在更新中没有明确说明需要重新配置的, 一般会在下一个签到周期(8小时)自动修复
    有明确说明需要重新配置, 又对json不熟的, 不要尝试直接修改文件
  5. 因为B站改版或者B站服务器爆炸而无法挂机 #13 #27 #29 #33
    服务器爆炸这个我也没办法
    如果是改版的话可以在下面告知, 感兴趣的也可以提一个PR, 我也在努力的朝app方面迁移, 毕竟app为了兼容改动不会太大也不会太频繁
  6. 需要新功能 #30 #37
    我认为有必要而且能做到的, 我会努力去做, 当然能赏个PR更好了
    要说一下我并不是程序员, 也完全不懂编程, 做这个东西只是兴趣而已

其他小问题, 认为几句话就可以说清的在下面反馈即可
觉得问题很复杂而上面也没有解决方法的, 欢迎提issue, 我也可以为上面的内容做补充

请教树莓派的挂机问题

大佬您好,我在win系统下可以正常使用您的程序,现在想在树莓派上运行,可以更加低耗稳定,不知您有没有相关教程,我始终无法成功,谢谢您!

意见反馈及常见问题整理 2

第一期 #39

  1. 自动领取活动挂机礼物
    B站改版以后挂机就会自动得,也就是程序默认开启
  2. 后端开启TLS加密
    目前没有这个打算,想要传输安全一点的可以用nginx反代
  3. 双端任务无法完成 #59
    目前应该是修复了
  4. 加入开奖信息
    这个功能比较麻烦,不过B站封号和这个有关的话,会做的
  5. 节奏风暴 #67
    目前心情比较好,你可以通过捐赠找我代挂,但是限制数量的哦,打算每天限制在50个,当然目前没有限制
  6. 类似于贴吧签到助手的多用户支持
    目前不打算做这个功能
  7. 统计功能
    可能会做,不过以目前的程序结构来看,统计功能使用json存储的话,性能应该会下降,还要调整结构,好麻烦
  8. 主站分享,投硬币,登录等
    bilive_client = bilibili live client 所以不会特意做主站的功能
  9. 程序app请求的实现
    推荐看 @czp3009这篇文章
  10. 可用ip数量为0 #61
    没有太大影响
  11. 实物抽奖
    此功能暂不开放,主要是依靠房间监听功能,和节奏风暴实现原理类似,故不开放
  12. 挂机没有经验
    关于哔哩哔哩直播经验值获取途径改版公告(更新)
  13. 消息提醒 #65
    已经做了,目前只支持Server酱,将来可能会支持邮件提醒
  14. 抽奖被限制 #66
    恭喜你被封了,一般一天之后自动解除
  15. 总督亲密度
    测试完成就更新

我加了自动送礼物的功能,能给push权限吗

/**
   * 赠送礼物
   * 
   * @private
   * @param {string} uid
   * @memberof Online
   */
  private async _SendGift(uid: string) {
    let userData = _options.user[uid], 
      roomID = _options.config.giftRoomID,
      //获取房间信息(ruid)
        getRoomInfo = {
            uri: `${apiLiveOrigin}/room/v1/Room/room_init?id=${roomID}`,
            jar: cookieJar[uid],
            json: true,
            headers: {
                'Referer': `https://live.bilibili.com/${roomID}`
            }
        }, roomInfoResponse = await tools.XHR(getRoomInfo)
            .catch((reject) => { tools.Error(userData.nickname, reject); })
    if (roomInfoResponse != null && roomInfoResponse.body.code === 0) {
        let ruid = roomInfoResponse.body.data.uid, 
          //获取礼物信息
          getGiftInfo = {
                uri: `${apiLiveOrigin}/gift/v2/gift/bag_list`,
                jar: cookieJar[uid],
                json: true,
                headers: {
                    'Referer': `https://live.bilibili.com/${roomID}`
                }
          }, giftInfoResponse = await tools.XHR(getGiftInfo)
              .catch((reject) => { tools.Error(userData.nickname, reject); })
        if (giftInfoResponse != null && giftInfoResponse.body.code === 0) {
            let nowTime = giftInfoResponse.body.data.time, 
              giftInfos = giftInfoResponse.body.data.list
            for(let listId in giftInfos) {
                let giftInfo = giftInfos[listId]
                //判断礼物过期时间,赠送当日过期的礼物
                if ((giftInfo.expire_at-nowTime) / 3600 <= 24) {
                    let rnd = Math.floor(Date.now() / 1000 - 60 - 300 * Math.random()), 
                      bili_jct = userData.cookie.match(new RegExp("(^| )bili_jct=([^;]*)(;|$)"))[2], 
                DedeUserID = userData.cookie.match(new RegExp("(^| )DedeUserID=([^;]*)(;|$)"))[2],
                      sendData = `uid=${DedeUserID}&gift_id=${giftInfo.gift_id}&ruid=${ruid}&gift_num=${giftInfo.gift_num}&bag_id=${giftInfo.bag_id}&platform=pc&biz_code=live&biz_id=${roomID}&rnd==${rnd}&storm_beat_id=0&metadata=&token=&csrf_token=${bili_jct}`, 
                      sendGift = {
                          method: 'POST',
                          uri: `${apiLiveOrigin}/gift/v2/live/bag_send`,
                          body: sendData,
                          jar: cookieJar[uid],
                          json: true,
                          headers: {
                              'Content-Type': `application/x-form-urlencoded`
                          }
                      }, sendGiftResponse = await tools.XHR(sendGift)
                          .catch((reject) => { tools.Error(userData.nickname, reject); })
                    if (sendGiftResponse != null && sendGiftResponse.body.code === 0)
                        tools.Log(userData.nickname,`成功向 ${roomID} 赠送 ${giftInfo.gift_num}${giftInfo.gift_name}`)
                }
            }
        }
    }
  }

运行node app.js 出错

module.js:457
throw err;
^

Error: Cannot find module '/root/node-v6.4.0/bilive_client/app.js'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3

1.1.1 node:688

(node:688) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: First argument should be a valid curve name
(node:688) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
这是什么意思 ?

(`・ω・´)

作者(`・ω・´)有沒有甚麼方法開機執行 node app.js ?
比如 做個執行檔 放到啟動資料夾

请教一些问题

想知道这个bilive_client的这个地址和apikey是在哪获得的

请问lzghzr大大heroku上现在怎么修改,感谢

原来大大教把options.js那行改成
this._http.listen(process.env.PORT, () => {
一直连接很好,现在版本options.js heroku报错
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
Error: EROFS: read-only file system, mkdir '/app/bilive/lib/../../../options/'
at Object.fs.mkdirSync (fs.js:885:18)
at Options.Promise (/app/bilive/lib/tools.js:71:16)
at new Promise ()
at Object.Options (/app/bilive/lib/tools.js:68:12)
at BiLive.Start (/app/bilive/index.js:14:34)
at Object. (/app/app.js:4:8)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)

然后
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
我很笨试着把以前能运行的options.js复制回去还是一样的提示
我本身能力有限,修改了多次无法成功,只能求助下大大了。
马飞难受!lzghzr牛逼!!!

请问如何在远程管理挂机。

我在vps上挂的程序,想在本地访问设置界面。可能是因为我运行了nginx和别的签到站什么的,在设置网页输入: wx://vps地址:10080 这样是连不上的,请问我如何可以(能不能)实现远程控制呢?

感谢作者大大。

謝謝作者(°∀°)ノ

今天節奏風暴我拿到了45個億圓~
前幾天都完全拿不到 不知今天是怎麼了(`・ω・´)

网页端设置的问题

网页设置连接后网页空白,看控制台访问127.0.0.1:10080一直是Pending,状态是101;
直接访问http://127.0.0.1:10080 是可以访问的;
nodejs版本是8.5,npm版本是5.3;
还有npm install 一直少装一个库,加上参数-g 才装上.

路径是不是还有问题?

module.js:487
throw err;
^

Error: Cannot find module '/root/bilive_client/bilive/index'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (/root/bilive_client/app.ts:1:78)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)

B站小电视参与方法的修改

昨晚晚些时候发现client的log只能监听小电视信息但不能参与抽奖,怀疑B站对参与方法进行了修改。于是使用浏览器f12查看,发现参与小电视抽奖的方法似乎换了。

现在的是http://api.live.bilibili.com/gift/v2/smalltv/join?roomid=$(RoomID)&id=$(raffleID)
而之前的是http://api.live.bilibili.com/SmallTV/join/roomid=${this._roomID}&id=${this._raffleId}&_=${Date.now()}
另外发现获取抽奖结果返回值的方法亦有修改,现在的是http://api.live.bilibili.com/gift/v2/smalltv/notice?roomid=$(RoomID)&raffleId=$(raffleID)

以上方法在我的chrome上测试通过,能够参与并获取小电视抽奖及其结果。然而我萌新,没办法完成对现行js脚本的修改= ̄ω ̄=希望大佬完成

BTW,貌似祭典活动也修改了?现在的进入好像是http://api.live.bilibili.com/activity/v1/Raffle/join?roomid=$(RoomID)&raffleId=$(raffleID)
跟之前的比对发现时间项${Date.now()}貌似没用了2333

另外发现小电视礼物返回值格式也改了,向祭典礼物看齐,看来B站是要统一礼物格式了

大大我的这个是什么问题。

at Object._errnoException (util.js:1031:13)
at _exceptionWithHostPort (util.js:1052:20)
at Server.setupListenHandle [as _listen2] (net.js:1367:14)
at listenInCluster (net.js:1408:12)
at Server.listen (net.js:1496:7)
at Options._HttpServer (/home/wwwroot/bilive_client/bilive/options.js:28:20)
at Options.Start (/home/wwwroot/bilive_client/bilive/options.js:15:14)
at BiLive.Options (/home/wwwroot/bilive_client/bilive/index.js:29:18)
at BiLive.Start (/home/wwwroot/bilive_client/bilive/index.js:22:18)
at <anonymous>

errno: 'EADDRINUSE',
code: 'EADDRINUSE',
syscall: 'listen',
address: '::',
port: 10080 }
昨天还行
node 9.2.0

关于账号的疑问

小白想请教一下 npm start后登陆的账号是自己浏览器上登陆的账号吧
我想尝试2个账号登陆抽奖 可以么
另外 这个有抽奖反馈么
50mti_gaqfnuzbggm6b44 m

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.