SpeedCalculator - taizan-hokuto/pytchat GitHub Wiki
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.