This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
SpeedCalculator
taizan-hokuto edited this page Jan 13, 2020
·
8 revisions
SpeedCalculator object
- calculates speed of chatdata (per minute).
from pytchat import LiveChat, SpeedCalculator
chat = LiveChat(video_id = "xxxxxxxxxxx", processor = SpeedCalculator(capacity = 20))
while chat.is_alive():
speed = chat.get()
print(speed)
time.sleep(3)
from pytchat import LiveChat, SpeedCalculator
chat = LiveChat("xxxxxxxxxxx",
processor = SpeedCalculator(),
callback = disp_speed)
while chat.is_alive():
time.sleep(3)
def disp_speed(speed):
print(speed)
(default value = 10)
the max capacity of speed data for calculating speed.
Speed data
has numbers of chat data, and start time / end time of chat.
Each speed data are stored to ring queue, so if the count of speed data exseeds capacity,
oldest item is overwritten by new one.