Giter Site home page Giter Site logo

blive's Issues

有时运行一会就会报错

Task exception was never retrieved
future: <Task finished name='Task-1' coro=<BLiver.listen() done, defined at /opt/homebrew/lib/python3.9/site-packages/blive/framework.py:195> exception=TypeError("'NoneType' object is not subscriptable")>
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/blive/framework.py", line 220, in listen
await asyncio.gather(tasks)
File "/opt/homebrew/lib/python3.9/site-packages/blive/framework.py", line 73, in process
return await asyncio.gather(
[f(ctx) for f in listeners])
File "/Users/huxinzhi/Developer/GitHub/blive/example/webhook.py", line 26, in listen_sc
username = msg.sender['name'] + '(' + str(msg.sender['id']) + ')'
File "/opt/homebrew/lib/python3.9/site-packages/blive/msg.py", line 182, in sender
medal_name=self.body["data"]["medal_info"]["medal_name"],
TypeError: 'NoneType' object is not subscriptable

控制台报错

await self._ws.send_bytes(packman.pack(heartbeat(), Operation.HEARTBEAT))
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
Job "BLiver.heartbeat (trigger: interval[0:00:30], next run at: 2022-02-18 00:14:06 CST)" raised an exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "/usr/local/lib/python3.8/dist-packages/blive/framework.py", line 147, in heartbeat
    await self._ws.send_bytes(packman.pack(heartbeat(), Operation.HEARTBEAT))
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
Job "BLiver.heartbeat (trigger: interval[0:00:30], next run at: 2022-02-18 00:14:36 CST)" raised an exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "/usr/local/lib/python3.8/dist-packages/blive/framework.py", line 147, in heartbeat
    await self._ws.send_bytes(packman.pack(heartbeat(), Operation.HEARTBEAT))
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
Job "BLiver.heartbeat (trigger: interval[0:00:30], next run at: 2022-02-18 00:15:06 CST)" raised an exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "/usr/local/lib/python3.8/dist-packages/blive/framework.py", line 147, in heartbeat
    await self._ws.send_bytes(packman.pack(heartbeat(), Operation.HEARTBEAT))
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/client_ws.py", line 156, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/http_websocket.py", line 688, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
^CTraceback (most recent call last):
  File "main.py", line 44, in <module>
    app.run()
  File "/usr/local/lib/python3.8/dist-packages/blive/framework.py", line 176, in run
    loop.run_forever()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1823, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/lib/python3.8/selectors.py", line 468, in select
    fd_event_list = self._selector.poll(timeout, max_ev)

AttributeError: 'BLiver' object has no attribute 'ws'

Task exception was never retrieved
future: <Task finished name='Task-1' coro=<BLiver.listen() done, defined at /Users/apple/Downloads/blive-main/blive/eeframework.py:91> exception=AttributeError("'BLiver' object has no attribute 'ws'")>
Traceback (most recent call last):
File "/Users/apple/Downloads/blive-main/blive/eeframework.py", line 103, in listen
msg = await self.ws.receive(timeout=60)
AttributeError: 'BLiver' object has no attribute 'ws'

get_blive_room_info使用同步请求导致阻塞过长时间

当用户保证输入是real_room_id的时候,能否提供一个选项跳过get_blive_room_info,每新建一个对象都要走一次网络层,在我本地的机子上大概需要0.2s时间才能init完Bliver对象,我的主播列表创建完毕需要大概43s的时间 实在是有点慢

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.