1
0
mirror of https://github.com/wbt5/real-url.git synced 2025-06-17 08:25:25 +08:00
zhibo-url/danmu/main.py
2020-08-18 21:53:10 +08:00

44 lines
1.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 部分弹幕功能代码来自项目https://github.com/IsoaSFlus/danmaku感谢大佬
# 快手弹幕代码来源及思路https://github.com/py-wuhao/ks_barrage感谢大佬
# 仅抓取用户弹幕,不包括入场提醒、礼物赠送等。
import asyncio
import danmaku
async def printer(q):
while True:
m = await q.get()
if m['msg_type'] == 'danmaku':
print(f'{m["name"]}{m["content"]}')
async def main(url):
q = asyncio.Queue()
dmc = danmaku.DanmakuClient(url, q)
asyncio.create_task(printer(q))
await dmc.start()
a = input('请输入直播间地址:\n')
asyncio.run(main(a))
# 虎牙直播https://www.huya.com/11352915
# 斗鱼直播https://www.douyu.com/85894
# B站直播https://live.bilibili.com/70155
# 快手直播https://live.kuaishou.com/u/jjworld126
# 火猫直播:
# 企鹅电竞https://egame.qq.com/383204988
# 花椒直播https://www.huajiao.com/l/303344861?qd=hu
# 映客直播https://www.inke.cn/liveroom/index.html?uid=87493223&id=1593906372018299
# CC直播https://cc.163.com/363936598/
# 酷狗直播https://fanxing.kugou.com/1676290
# 战旗直播:
# 龙珠直播http://star.longzhu.com/wsde135864219
# PPS奇秀直播https://x.pps.tv/room/208337
# 搜狐千帆直播https://qf.56.com/520208a
# 来疯直播https://v.laifeng.com/656428
# LOOK直播https://look.163.com/live?id=196257915
# AcFun直播https://live.acfun.cn/live/23682490
# 艺气山直播http://www.173.com/96