Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb0edef136 | ||
|
|
e03d39475e | ||
|
|
2462b8aca0 | ||
|
|
a1024c8734 | ||
|
|
6b3ca00d35 |
11
README.md
11
README.md
@@ -27,7 +27,7 @@ pip install pytchat
|
|||||||
```python
|
```python
|
||||||
from pytchat import LiveChat
|
from pytchat import LiveChat
|
||||||
|
|
||||||
chat = LiveChat("rsHWP7IjMiw")
|
chat = LiveChat("DSGyEsJ17cI")
|
||||||
while chat.is_alive():
|
while chat.is_alive():
|
||||||
data = chat.get()
|
data = chat.get()
|
||||||
for c in data.items:
|
for c in data.items:
|
||||||
@@ -47,7 +47,7 @@ def display(data):
|
|||||||
data.tick()
|
data.tick()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
chat = LiveChat("rsHWP7IjMiw", callback = display)
|
chat = LiveChat("DSGyEsJ17cI", callback = display)
|
||||||
while chat.is_alive():
|
while chat.is_alive():
|
||||||
#other background operation.
|
#other background operation.
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
@@ -61,7 +61,7 @@ from concurrent.futures import CancelledError
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
chat = LiveChatAsync("rsHWP7IjMiw", callback = func)
|
chat = LiveChatAsync("DSGyEsJ17cI", callback = func)
|
||||||
while chat.is_alive():
|
while chat.is_alive():
|
||||||
#other background operation.
|
#other background operation.
|
||||||
await asyncio.sleep(3)
|
await asyncio.sleep(3)
|
||||||
@@ -86,7 +86,7 @@ if __name__ == '__main__':
|
|||||||
from pytchat import LiveChat, CompatibleProcessor
|
from pytchat import LiveChat, CompatibleProcessor
|
||||||
import time
|
import time
|
||||||
|
|
||||||
chat = LiveChat("rsHWP7IjMiw",
|
chat = LiveChat("DSGyEsJ17cI",
|
||||||
processor = CompatibleProcessor() )
|
processor = CompatibleProcessor() )
|
||||||
|
|
||||||
while chat.is_alive():
|
while chat.is_alive():
|
||||||
@@ -108,7 +108,8 @@ from pytchat import LiveChat
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
#seektime (seconds): start position of chat.
|
#seektime (seconds): start position of chat.
|
||||||
chat = ReplayChat("ojes5ULOqhc", seektime = 60*30)
|
chat = LiveChat("ojes5ULOqhc", seektime = 60*30)
|
||||||
|
print('Replay from 30:00')
|
||||||
while chat.is_alive():
|
while chat.is_alive():
|
||||||
data = chat.get()
|
data = chat.get()
|
||||||
for c in data.items:
|
for c in data.items:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
pytchat is a python library for fetching youtube live chat without using yt api, Selenium, or BeautifulSoup.
|
pytchat is a python library for fetching youtube live chat without using yt api, Selenium, or BeautifulSoup.
|
||||||
"""
|
"""
|
||||||
__copyright__ = 'Copyright (C) 2019 taizan-hokuto'
|
__copyright__ = 'Copyright (C) 2019 taizan-hokuto'
|
||||||
__version__ = '0.0.4.9'
|
__version__ = '0.0.5.0'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__author__ = 'taizan-hokuto'
|
__author__ = 'taizan-hokuto'
|
||||||
__author_email__ = '55448286+taizan-hokuto@users.noreply.github.com'
|
__author_email__ = '55448286+taizan-hokuto@users.noreply.github.com'
|
||||||
|
|||||||
@@ -10,13 +10,9 @@ class LiveChatPaidMessageRenderer(BaseRenderer):
|
|||||||
|
|
||||||
def get_snippet(self):
|
def get_snippet(self):
|
||||||
super().get_snippet()
|
super().get_snippet()
|
||||||
|
|
||||||
self.author.name = self.renderer["authorName"]["simpleText"]
|
|
||||||
|
|
||||||
amountDisplayString, symbol, amount =(
|
amountDisplayString, symbol, amount =(
|
||||||
self.get_amountdata(self.renderer)
|
self.get_amountdata(self.renderer)
|
||||||
)
|
)
|
||||||
self.message = self.get_message(self.renderer)
|
|
||||||
self.amountValue= amount
|
self.amountValue= amount
|
||||||
self.amountString = amountDisplayString
|
self.amountString = amountDisplayString
|
||||||
self.currency= currency.symbols[symbol]["fxtext"] if currency.symbols.get(symbol) else symbol
|
self.currency= currency.symbols[symbol]["fxtext"] if currency.symbols.get(symbol) else symbol
|
||||||
|
|||||||
@@ -10,13 +10,9 @@ class LiveChatPaidStickerRenderer(BaseRenderer):
|
|||||||
|
|
||||||
def get_snippet(self):
|
def get_snippet(self):
|
||||||
super().get_snippet()
|
super().get_snippet()
|
||||||
|
|
||||||
self.author.name = self.renderer["authorName"]["simpleText"]
|
|
||||||
|
|
||||||
amountDisplayString, symbol, amount =(
|
amountDisplayString, symbol, amount =(
|
||||||
self.get_amountdata(self.renderer)
|
self.get_amountdata(self.renderer)
|
||||||
)
|
)
|
||||||
self.message = ""
|
|
||||||
self.amountValue = amount
|
self.amountValue = amount
|
||||||
self.amountString = amountDisplayString
|
self.amountString = amountDisplayString
|
||||||
self.currency = currency.symbols[symbol]["fxtext"] if currency.symbols.get(symbol) else symbol
|
self.currency = currency.symbols[symbol]["fxtext"] if currency.symbols.get(symbol) else symbol
|
||||||
|
|||||||
Reference in New Issue
Block a user