dawnnnnnn / bilibili-live-tools Goto Github PK
View Code? Open in Web Editor NEWpython实现的bilibili直播助手
License: MIT License
python实现的bilibili直播助手
License: MIT License
log显示这样
检测到房间 36979 的活动抽奖
移动端活动抽奖结果: 辣条X1
网页端活动抽奖状态: 加入成功
移动端活动抽奖结果: 辣条X1
网页端活动抽奖状态: 加入成功
当前时间: 2018-03-24 11:11:29
检测到房间 36979 的活动抽奖
移动端活动抽奖结果: 辣条X1
网页端活动抽奖状态: 加入成功
当前时间: 2018-03-24 11:11:31
检测到房间 36979 的活动抽奖
两三个小时后崩溃了……日志:
[2018-05-28 20:41:47] 心跳
[2018-05-28 20:42:38] 房间 96136 小电视道具抽奖结果: 辣条X2
[2018-05-28 20:43:38] 房间4256665下播!将切换监听房间
Fatal Python error: Cannot recover from stack overflow.
Thread 0x464b7470 (most recent call first):
File "/threading.py", line 295 in wait
File "/queue.py", line 164 in get
File "/thread.py", line 67 in _worker
File "/threading.py", line 864 in run
File "/threading.py", line 916 in _bootstrap_inner
File "/threading.py", line 884 in _bootstrap
Thread 0x45c96470 (most recent call first):
File "/threading.py", line 295 in wait
File "/queue.py", line 164 in get
File "/thread.py", line 67 in _worker
File "/threading.py", line 864 in run
File "/threading.py", line 916 in _bootstrap_inner
File "/threading.py", line 884 in _bootstrap
Thread 0x4548d470 (most recent call first):
File "/threading.py", line 295 in wait
File "/queue.py", line 164 in get
File "/thread.py", line 67 in _worker
File "/threading.py", line 864 in run
File "/threading.py", line 916 in _bootstrap_inner
File "/threading.py", line 884 in _bootstrap
Thread 0x44c1e470 (most recent call first):
File "/threading.py", line 295 in wait
File "/queue.py", line 164 in get
File "/thread.py", line 67 in _worker
File "/threading.py", line 864 in run
File "/threading.py", line 916 in _bootstrap_inner
File "/threading.py", line 884 in _bootstrap
Thread 0x44363470 (most recent call first):
File "/threading.py", line 295 in wait
File "/queue.py", line 164 in get
File "/thread.py", line 67 in _worker
File "/threading.py", line 864 in run
File "/threading.py", line 916 in _bootstrap_inner
File "/threading.py", line 884 in _bootstrap
Thread 0x43b63470 (most recent call first):
File "/threading.py", line 295 in wait
File "/queue.py", line 164 in get
File "/thread.py", line 67 in _worker
File "/threading.py", line 864 in run
File "/threading.py", line 916 in _bootstrap_inner
File "/threading.py", line 884 in _bootstrap
Thread 0x432ff470 (most recent call first):
File "/threading.py", line 295 in wait
File "/queue.py", line 164 in get
File "/thread.py", line 67 in _worker
File "/threading.py", line 864 in run
File "/threading.py", line 916 in _bootstrap_inner
File "/threading.py", line 884 in _bootstrap
Thread 0x428ff470 (most recent call first):
File "/threading.py", line 295 in wait
File "/queue.py", line 164 in get
File "/thread.py", line 67 in _worker
File "/threading.py", line 864 in run
File "/threading.py", line 916 in _bootstrap_inner
File "/threading.py", line 884 in _bootstrap
Thread 0x41eff470 (most recent call first):
File "/threading.py", line 295 in wait
File "/queue.py", line 164 in get
File "/thread.py", line 67 in _worker
File "/threading.py", line 864 in run
File "/threading.py", line 916 in _bootstrap_inner
File "/threading.py", line 884 in _bootstrap
Thread 0x41567470 (most recent call first):
File "/threading.py", line 295 in wait
File "/queue.py", line 164 in get
File "/thread.py", line 67 in _worker
File "/threading.py", line 864 in run
File "/threading.py", line 916 in _bootstrap_inner
File "/threading.py", line 884 in _bootstrap
Current thread 0x40031000 (most recent call first):
File "/threading.py", line 226 in __init__
File "/queue.py", line 39 in __init__
File "/opt/lib/python3.6/site-packages/urllib3/connectionpool.py", line 181 in __init__
File "/opt/lib/python3.6/site-packages/urllib3/connectionpool.py", line 769 in __init__
File "/opt/lib/python3.6/site-packages/urllib3/poolmanager.py", line 195 in _new_pool
File "/opt/lib/python3.6/site-packages/urllib3/poolmanager.py", line 261 in connection_from_pool_key
File "/opt/lib/python3.6/site-packages/urllib3/poolmanager.py", line 240 in connection_from_context
File "/opt/lib/python3.6/site-packages/urllib3/poolmanager.py", line 227 in connection_from_host
File "/opt/lib/python3.6/site-packages/urllib3/poolmanager.py", line 279 in connection_from_url
File "/opt/lib/python3.6/site-packages/requests/adapters.py", line 309 in get_connection
File "/opt/lib/python3.6/site-packages/requests/adapters.py", line 405 in send
File "/opt/lib/python3.6/site-packages/requests/sessions.py", line 618 in send
File "/opt/lib/python3.6/site-packages/requests/sessions.py", line 508 in request
File "/opt/lib/python3.6/site-packages/requests/api.py", line 58 in request
File "/opt/lib/python3.6/site-packages/requests/api.py", line 72 in get
File "/tmp/mnt/sda2/entware/usr/bilibili-live-tools/MultiRoom.py", line 14 in game_area
File "/tmp/mnt/sda2/entware/usr/bilibili-live-tools/MultiRoom.py", line 36 in get_all
File "/tmp/mnt/sda2/entware/usr/bilibili-live-tools/MultiRoom.py", line 41 in get_all
File "/tmp/mnt/sda2/entware/usr/bilibili-live-tools/MultiRoom.py", line 41 in get_all
File "/tmp/mnt/sda2/entware/usr/bilibili-live-tools/MultiRoom.py", line 41 in get_all
File "/tmp/mnt/sda2/entware/usr/bilibili-live-tools/MultiRoom.py", line 41 in get_all
File "/tmp/mnt/sda2/entware/usr/bilibili-live-tools/MultiRoom.py", line 41 in get_all
大佬我也学python我能监控到房间信息但是发送弹幕无法抽奖,你能把代码更新上来或者发我邮箱不 [email protected] 求一份
B站的免流卡绑定的账号每天观看视频,可以的流量
Mark
刚学习python想一起学习一下大佬登陆部分的源码能写出来不
貌似是一个抢节奏风暴的一个东西
里面其他文件也没调用storm.py
单运行就会不断输出 {'message': '', 'code': 0, 'data': [], 'msg': ''}
总督领取有一定几率,返回空信息,怀疑是请求过快
user.conf
中的 [account]
改成数组方便吗
Traceback (most recent call last):
File "applogin.py", line 4, in
from Crypto.PublicKey import RSA
ModuleNotFoundError: No module named 'Crypto'
我pip install crypto了 还是报错...
近24小时后崩了……日志:
[2018-05-29 23:30:02] 心跳
[2018-05-29 23:32:42] 房间 20815 广播道具抽奖结果: 辣条X1
[2018-05-29 23:34:00] 房间 4100738 下播!将切换监听房间
'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/tmp/mnt/sda2/entware/usr/bilibili-live-tools/connect.py", line 35, in recreate
connect.roomids.append(tmp[i][0])
TypeError: 'NoneType' object is not subscriptable
[2018-05-29 23:35:02] 心跳
[2018-05-29 23:40:03] 心跳
[2018-05-29 23:45:03] 心跳
[2018-05-29 23:50:04] 心跳
[2018-05-29 23:55:04] 心跳
[2018-05-30 00:00:05] 心跳
yjqiang#4
这里面的rgb显示方式不同平台支持不一样,比如我用的ios pythonista是console.set_color(),但是其他的平台是print(“0m”)(类似的,忘记了。。。),但是ios平台可以随意设置rgb,而其余平台只能指定有限10个颜色左右。
怎么处理不同平台问题?
https://api.live.bilibili.com/gift/v2/gift/bag_list
利用这个api,查询剩余礼物,与抽取礼物功能对应。就是不清楚应该写在哪里,是定时显示还是作为查询接口?
b站这么搞笑么……连是否满足“每日使用移动端和网页端(双端)分别登录观看任意直播5分钟”都不判断?
搜了一圈没搜到
比如appkey和app_secret,感觉使用默认的,很容易被针对封号额。。。
还有其他参数,也不太好猜,每个配置干嘛的。。。。
添加登陆提示功能
包括密码错误、验证码等
#37
目前加入对reader的timeout检测,即外面包裹一层wait,如果35s(30s一次心跳,心跳包会有反馈包)超过且未读到值,那么就是超时。
reset也加入
fin的检测有个诡异的现象,fin是远程发送的,但有时手动关闭wifi会马上fin(reader在接受fin会返回长度为0的bytes),很诡异
每次不要求登录,只求可以看每次抽奖谁中大奖了
”pc端”以及”app端”建议改成”网页端”和”移动端”
参与活动抽奖显示的”加入成功”和参与小电视的”ok”建议统一改为”已加入,待开奖”
我用邮箱登录会报错
keyerror:'data'
但是我换成了手机号登录貌似就没问题了。
请问节奏风暴需要在哪登陆的?这个风暴礼物是自动领的吗?
不是很懂源码怎么用就是了((
要不再更新一下?
有用户反馈一段时间后会出现监听不到消息的bug,怀疑是与弹幕服务器的连接断开,重连机制提上日程。
请问有可能实现每日对当前佩戴勋章的直播间满亲密度自动赠送辣条的功能吗?目前手动输入道具编号有些扎心,输入错误后出现错误代码,之后便无法输入任何内容。
什么鬼
Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
RESTART: C:\Users\Administrator\Desktop\bilibili-live-tools-master\applogin.py
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\bilibili-live-tools-master\applogin.py", line 4, in
from Crypto.PublicKey import RSA
ModuleNotFoundError: No module named 'Crypto'
apk下载链接: https://pan.baidu.com/s/1C_9REUqFPYhhFIdKBPPXBw 密码: bxj3
使用最新版本注意:安装下面运行库前安装wheel库,否则安装aiohttp会报错
安装第三方库 这版本: -r https://is.gd/bltpip 或 https://biu.ee/bltpip
---------------分支yj版: -r https://is.gd/ybltpip 或 https://biu.ee/ybltpip
下载releases的Source code (zip) 或 master.zip(短链)
下载后全部解压
运行
添加后错误代码又变了
Traceback (most recent call last):
File "C:\Users\Dee丶\Desktop\bilibili-live-tools-master\login.py", line 42, in success
response = requests.post(url, data=payload, headers=headersprint(response.json()))
NameError: name 'headersprint' is not defined
为啥要半小时后检查呢?难道不应该6小时检查之类的吗?
猜测:如果抽奖次数参与过多、过于频繁,可能导致被检测。
猜测:不必要的检测是否中奖结果
模拟进入房间操作
猜测:过快的参与活动,没有什么延迟
猜测:夜晚凌晨时抽奖,高度类似机器人
python3 main.py
start OK!
Traceback (most recent call last):
File "run.py", line 1, in <module>
from OnlineHeart import OnlineHeart
File "/home/pi/bilibili-live-tools/OnlineHeart.py", line 16
async def apppost_heartbeat(self):
^
SyntaxError: invalid syntax
弹幕打印并发性太低
但是printf_danmu_msg实现里面 不能允许异步
代码是不是对没有领过任何主播勋章的做判断,刚刚尝试登录后会直接抛出异常
Traceback (most recent call last): File ".\run.py", line 22, in <module> utils.fetch_medal() File "E:\Sublime Text 3\program\bilibili-live-tools\utils.py", line 54, in fetch_medal return roomid,today_feed,day_limit UnboundLocalError: local variable 'roomid' referenced before assignment
开通总督即可触发抽奖,又到了加功能的时候
B站是乎针对服务器ip进行封号,建议添加IP代理
抽奖状态:访问被拒绝
Task exception was never retrieved
future: <Task finished coro=<bilibiliClient.connectServer() done, defined at /private/var/mobile/Containers/Shared/AppGroup/6477072F-46E3-43B7-9C2B-4877AD7187C2/File Provider Storage/Repositories/bilibili-live-tools/bilibiliCilent.py:21> exception=error('unpack requires a bytes object of length 4',)>
Traceback (most recent call last):
File "/var/containers/Bundle/Application/9F565D30-C54B-4210-902B-874D7A5AB814/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/private/var/mobile/Containers/Shared/AppGroup/6477072F-46E3-43B7-9C2B-4877AD7187C2/File Provider Storage/Repositories/bilibili-live-tools/bilibiliCilent.py", line 29, in connectServer
await self.ReceiveMessageLoop()
File "/private/var/mobile/Containers/Shared/AppGroup/6477072F-46E3-43B7-9C2B-4877AD7187C2/File Provider Storage/Repositories/bilibili-live-tools/bilibiliCilent.py", line 58, in ReceiveMessageLoop
expr, = unpack('!I', tmp)
struct.error: unpack requires a bytes object of length 4
显示活动已结束了2333
是正则取bag_id 然后 根据gift_id来循环赠送 如果检测到当日亲密度 = 或者> 今日上限就停止循环嘛
debug字段可以方便我们调试
后续的platform可以直接自己改
简单api的修改可以丢到这里面
选择运行任务可以扔到里面(本次是想读取弹幕还是挂件抽奖)
bilibili文件的一部分可以丢过来
如果是后面挂代理也可以丢配置过来
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.