Compare commits

..

12 Commits

Author SHA1 Message Date
taizan-hokuto
1c817b6476 Merge branch 'release/v0.0.7.2' 2020-05-22 02:39:53 +09:00
taizan-hokuto
18b88200a8 Increment version 2020-05-22 02:29:41 +09:00
taizan-hokuto
c95d70a232 Merge branch 'hotfix/#7_cli_index_outof_range' 2020-05-22 02:28:28 +09:00
taizan-hokuto
7640586591 Merge branch 'master' into develop 2020-05-22 02:28:28 +09:00
taizan-hokuto
f7ec14e166 Fix for #7 2020-05-22 02:27:52 +09:00
taizan-hokuto
a4dacdb7d7 Merge tag 'v0.0.7.1' into develop
v0.0.7.1
2020-05-06 01:24:55 +09:00
taizan-hokuto
785a82b618 Merge branch 'release/v0.0.7.1' 2020-05-06 01:24:54 +09:00
taizan-hokuto
faf886eebd Increment version 2020-05-06 01:24:30 +09:00
taizan-hokuto
8a627414cb Merge tag 'sponsor_text' into develop 2020-05-06 01:23:37 +09:00
taizan-hokuto
d14262cbcb Merge branch 'hotfix/sponsor_text' 2020-05-06 01:23:37 +09:00
taizan-hokuto
da7c694dfb Modify parsing membership 2020-05-06 01:23:19 +09:00
taizan-hokuto
9aa35b9756 Merge tag 'v0.0.7' into develop
v0.0.7
2020-05-05 22:59:16 +09:00
5 changed files with 18 additions and 14 deletions

View File

@@ -2,7 +2,7 @@
pytchat is a python library for fetching youtube live chat without using yt api, Selenium, or BeautifulSoup.
"""
__copyright__ = 'Copyright (C) 2019 taizan-hokuto'
__version__ = '0.0.7'
__version__ = '0.0.7.2'
__license__ = 'MIT'
__author__ = 'taizan-hokuto'
__author_email__ = '55448286+taizan-hokuto@users.noreply.github.com'

View File

@@ -35,6 +35,6 @@ class LiveChatMembershipItemRenderer(BaseRenderer):
}
def get_message(self, renderer):
message = (renderer["headerSubtext"]["runs"][0]["text"]
)+' / '+(renderer["authorName"]["simpleText"])
return message
message = ''.join([mes.get("text", "") for mes in renderer["headerSubtext"]["runs"]])
return message, [message]

View File

@@ -10,6 +10,6 @@ class LiveChatMembershipItemRenderer(BaseRenderer):
self.author.isChatSponsor = True
def get_message(self, renderer):
message = (renderer["headerSubtext"]["runs"][0]["text"]
)+' / '+(renderer["authorName"]["simpleText"])
return message
message = ''.join([mes.get("text", "") for mes in renderer["headerSubtext"]["runs"]])
return message, [message]

View File

@@ -70,7 +70,8 @@ def check_duplicate_offset(chatdata):
if is_duplicate(i,i+1)]
def remove_duplicate_head(blocks):
if len(blocks) == 1 : return blocks
if len(blocks) == 0 or len(blocks) == 1:
return blocks
def is_duplicate_head(index):
@@ -97,7 +98,8 @@ def remove_duplicate_head(blocks):
return ret
def remove_duplicate_tail(blocks):
if len(blocks) == 1 : return blocks
if len(blocks) == 0 or len(blocks) == 1:
return blocks
def is_duplicate_tail(index):
if len(blocks[index].chat_data) == 0:
@@ -126,7 +128,8 @@ def remove_overlap(blocks):
Align the last offset of each block to the first offset
of next block (equals `end` offset of each block).
"""
if len(blocks) == 1 : return blocks
if len(blocks) == 0 or len(blocks) == 1:
return blocks
for block in blocks:
if block.is_last:

View File

@@ -40,10 +40,11 @@ class Extractor:
return self
def _set_block_end(self):
for i in range(len(self.blocks)-1):
self.blocks[i].end = self.blocks[i+1].first
self.blocks[-1].end = self.duration*1000
self.blocks[-1].is_last =True
if len(self.blocks) > 0:
for i in range(len(self.blocks)-1):
self.blocks[i].end = self.blocks[i+1].first
self.blocks[-1].end = self.duration*1000
self.blocks[-1].is_last =True
return self
def _remove_overlap(self):