From 19d5b74beb129c8ab428a265a146b09f62dffee5 Mon Sep 17 00:00:00 2001 From: taizan-hokouto <55448286+taizan-hokuto@users.noreply.github.com> Date: Thu, 5 Nov 2020 00:14:36 +0900 Subject: [PATCH] Update README --- README.md | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index eb0f948..b590e8a 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,11 @@ pip install pytchat ### CLI -One-liner command. ++ One-liner command. -Save chat data to html with embedded custom emojis. ++ Save chat data to html with embedded custom emojis. -Show chat stream (--echo option). ++ Show chat stream (--echo option). ```bash $ pytchat -v https://www.youtube.com/watch?v=uIx8l2xlYVY -o "c:/temp/" @@ -40,7 +40,7 @@ $ pytchat -v https://www.youtube.com/watch?v=uIx8l2xlYVY -o "c:/temp/" ``` -### On-demand mode with simple non-buffered object. +### Fetch chat data (see [wiki](https://github.com/taizan-hokuto/pytchat/wiki/PytchatCore)) ```python import pytchat chat = pytchat.create(video_id="uIx8l2xlYVY") @@ -48,9 +48,9 @@ while chat.is_alive(): for c in chat.get().sync_items(): print(f"{c.datetime} [{c.author.name}]- {c.message}") ``` -see [wiki](https://github.com/taizan-hokuto/pytchat/wiki/PytchatCore) -### Output JSON format (feature of [DefaultProcessor](https://github.com/taizan-hokuto/pytchat/wiki/DefaultProcessor) + +### Output JSON format string (feature of [DefaultProcessor](https://github.com/taizan-hokuto/pytchat/wiki/DefaultProcessor)) ```python import pytchat import time @@ -68,28 +68,14 @@ while chat.is_alive(): ### other -#### Fetch chat with buffer. -[LiveChat](https://github.com/taizan-hokuto/pytchat/wiki/LiveChat) ++ Fetch chat with a buffer ([LiveChat](https://github.com/taizan-hokuto/pytchat/wiki/LiveChat)) -#### Use with asyncio. -[LiveChatAsync](https://github.com/taizan-hokuto/pytchat/wiki/LiveChatAsync) ++ Use with asyncio ([LiveChatAsync](https://github.com/taizan-hokuto/pytchat/wiki/LiveChatAsync)) -#### [YT API compatible chat processor](https://github.com/taizan-hokuto/pytchat/wiki/CompatibleProcessor) ++ YT API compatible chat processor ([CompatibleProcessor](https://github.com/taizan-hokuto/pytchat/wiki/CompatibleProcessor)) -### [Extract archived chat data](https://github.com/taizan-hokuto/pytchat/wiki/Extractor) -```python -from pytchat import HTMLArchiver, Extractor ++ Extract archived chat data ([Extractor](https://github.com/taizan-hokuto/pytchat/wiki/Extractor)) -video_id = "*******" -ex = Extractor( - video_id, - div=10, - processor=HTMLArchiver("c:/test.html") -) - -ex.extract() -print("finished.") -``` ## Structure of Default Processor Each item can be got with `sync_items()` function.