Merge branch 'develop'

This commit is contained in:
55448286+taizan-hokuto@users.noreply.github.com
2019-11-03 13:14:58 +09:00
4 changed files with 13 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
pytchat is a python library for fetching youtube live chat.
"""
__copyright__ = 'Copyright (C) 2019 taizan-hokuto'
__version__ = '0.0.1.6'
__version__ = '0.0.1.7'
__license__ = 'MIT'
__author__ = 'taizan-hokuto'
__author_email__ = '55448286+taizan-hokuto@users.noreply.github.com'

View File

@@ -122,7 +122,7 @@ def _build(video_id, _ts1, _ts2, _ts3, _ts4, _ts5, topchatonly = False):
)
def _times():
def _times(past_sec):
def unixts_now():
now = datetime.datetime.now(pytz.utc)
@@ -132,12 +132,18 @@ def _times():
_ts1= n - random.uniform(0,1*3)
_ts2= n - random.uniform(0.01,0.99)
_ts3= n - 60*60 + random.uniform(0,1)
_ts3= n - past_sec + random.uniform(0,1)
_ts4= n - random.uniform(10*60,60*60)
_ts5= n - random.uniform(0.01,0.99)
return list(map(lambda x:int(x*1000000),[_ts1,_ts2,_ts3,_ts4,_ts5]))
def getparam(video_id):
return _build(video_id,*_times())
def getparam(video_id,past_sec = 60):
'''
Parameter
---------
past_sec : int
seconds to load past chat data
'''
return _build(video_id,*_times(past_sec))

View File

@@ -16,7 +16,7 @@ class Chatdata:
async def tick_async(self):
if self.interval == 0:
await asyncio.sleep(3)
await asyncio.sleep(0.5)
return
await asyncio.sleep(self.interval/len(self.items))

View File

@@ -29,7 +29,7 @@ with open('README.md', encoding='utf-8') as f:
setup(
name=package_name,
packages=[package_name],
packages=find_packages(),
version=version,