Add 'timestmpText' to DefaultProcessor

This commit is contained in:
taizan-hokuto
2019-11-12 22:14:56 +09:00
parent 3ad0d1a61e
commit 0aa45109a5
3 changed files with 8 additions and 9 deletions

View File

@@ -8,12 +8,9 @@ import urllib.parse
'''
Generate continuation parameter of youtube replay chat.
Author: taizan-hokuto (2019)
Author: taizan-hokuto (2019) @taizan205
ver 0.0.1 2019.10.05
if you use/copy this module
please tell me -> https://twitter.com/taizan205
'''
def _gen_vid(video_id):

View File

@@ -7,12 +7,9 @@ import urllib.parse
'''
Generate continuation parameter of youtube live chat.
Author: taizan-hokuto (2019)
Author: taizan-hokuto (2019) @taizan205
https://twitter.com/taizan205
ver 0.0.1 2019.10.05
if you use/copy this module
please tell me -> https://twitter.com/taizan205
'''
def _gen_vid(video_id):
"""generate video_id parameter.

View File

@@ -13,6 +13,11 @@ class BaseRenderer:
self.id = self.renderer.get('id')
timestampUsec = int(self.renderer.get("timestampUsec",0))
self.timestamp = int(timestampUsec/1000)
tst = self.renderer.get("timestampText")
if tst:
self.timestampText = tst.get("simpleText")
else:
self.timestampText = ""
self.datetime = self.get_datetime(timestampUsec)
self.message = self.get_message(self.renderer)
self.id = self.renderer.get('id')