【问题标题】:RuntimeWarning: coroutine 'BaseClient.__send_pings' was never awaitedRuntimeWarning: coroutine \'BaseClient.__send_pings\' 从未等待
【发布时间】:2022-10-22 01:53:24
【问题描述】:

我试图在不阻塞主线程的情况下从 Tiktok 用户那里抓取一些数据,但我不断收到此错误。 它工作了大约 5 秒钟,然后我收到了那个错误。

import pygame
from TikTokLive import TikTokLiveClient
from TikTokLive.types.events import GiftEvent
import asyncio
from asyncio import AbstractEventLoop


client = TikTokLiveClient("upfollowers.co.id")
w=False

@client.on("gift")
async def on_gift(event: GiftEvent):
    global w
  
    try:
        
        if event.gift.streakable:
            if not event.gift.streaking:
                print(f"{event.user.uniqueId} sent {event.gift.repeat_count}x \"{event.gift.extended_gift.name}\"")
                if event.gift.repeat_count =='Rose':
                    w=True
     
        else:
            print(f"{event.user.uniqueId} sent \"{event.gift.extended_gift.name}\"")
    except:
        print('ok')
        
    

if __name__=='__main__':
    asyncio.run(client.start())

【问题讨论】:

    标签: python python-3.x asynchronous async-await python-asyncio


    【解决方案1】:

    你找到解决办法了吗? 那么请给我写电报:cracepc

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-10-26
      • 2021-08-01
      • 2021-10-22
      • 2022-01-16
      • 2019-12-15
      • 2021-10-15
      • 1970-01-01
      相关资源
      最近更新 更多