You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
'''Display the total result up to that point at regular intervals. video_id can be both live and archived.'''importasynciofromconcurrent.futuresimportCancelledErrorfrompytchatimport (LiveChatAsync,
DefaultProcessor, SuperchatCalculator)
video_id="_i_AxXSfceM"asyncdefmain():
chat=LiveChatAsync(video_id, callback=display,
processor=DefaultProcessor(), SuperchatCalculator() )
whilechat.is_alive():
awaitasyncio.sleep(3)
asyncdefdisplay(data, amount):
print(data.items[-1].elapsedTime, amount)
if__name__=='__main__':
loop=asyncio.get_event_loop()
try:
loop.run_until_complete(main())
exceptasyncio.CancelledError:
pass