1
0
mirror of https://github.com/wbt5/real-url.git synced 2025-07-27 11:00:32 +08:00

新增映客直播弹幕

This commit is contained in:
wbt5 2020-07-05 09:57:32 +08:00
parent 3f90ae45c9
commit 2f63951d68

View File

@ -9,6 +9,7 @@ from .kuaishou import KuaiShou
from .huomao import HuoMao
from .egame import eGame
from .huajiao import HuaJiao
from .inke import Inke
__all__ = ['DanmakuClient']
@ -32,7 +33,8 @@ class DanmakuClient:
'huomao.com': HuoMao,
'kuaishou.com': KuaiShou,
'egame.qq.com': eGame,
'huajiao.com': HuaJiao}.items():
'huajiao.com': HuaJiao,
'inke.cn': Inke}.items():
if re.match(r'^(?:http[s]?://)?.*?%s/(.+?)$' % u, url):
self.__site = s
self.__u = u
@ -84,10 +86,17 @@ class DanmakuClient:
await self.__dm_queue.put(m)
count += 1
await self.heartbeats()
async def init_ws_inke(self):
ws_url = await self.__site.get_ws_info(self.__url)
self.__ws = await self.__hs.ws_connect(ws_url)
await self.fetch_danmaku()
async def start(self):
if self.__u == 'huajiao.com':
await self.init_ws_huajiao()
elif self.__u == 'inke.cn':
await self.init_ws_inke()
else:
await self.init_ws()
await asyncio.gather(