Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44dc5ff1c3 | ||
|
|
0676ee5c8c | ||
|
|
89ddc0551f | ||
|
|
0a8cd83d41 | ||
|
|
cb505074f7 | ||
|
|
e9e16b2bcc | ||
|
|
c596911901 | ||
|
|
275e1a7aa8 | ||
|
|
737095e7fb | ||
|
|
10d9f76f67 | ||
|
|
34a74f28aa | ||
|
|
c3c4827798 | ||
|
|
e930c75e2d | ||
|
|
d5efede758 | ||
|
|
dc9b067d1d | ||
|
|
940e2a7431 |
@@ -1,4 +1,3 @@
|
|||||||
include requirements.txt
|
include requirements.txt
|
||||||
include requirements_test.txt
|
include requirements_test.txt
|
||||||
exclude *.egg-info
|
|
||||||
|
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -13,10 +13,14 @@ Other features:
|
|||||||
+ Quick fetching of initial chat data by generating continuation params
|
+ Quick fetching of initial chat data by generating continuation params
|
||||||
instead of web scraping.
|
instead of web scraping.
|
||||||
|
|
||||||
|
For more detailed information, see [wiki](https://github.com/taizan-hokuto/pytchat/wiki)
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
```python
|
```python
|
||||||
pip install pytchat
|
pip install pytchat
|
||||||
```
|
```
|
||||||
|
## Demo
|
||||||
|

|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
### on-demand mode
|
### on-demand mode
|
||||||
@@ -133,7 +137,12 @@ Structure of each item which got from items() function.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>currency</td>
|
<td>currency</td>
|
||||||
<td>str</td>
|
<td>str</td>
|
||||||
<td>ex. "USD"</td>
|
<td>ISO 4217 currency codes (ex. "USD")</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>bgColor</td>
|
||||||
|
<td>int</td>
|
||||||
|
<td>RGB Int</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>author</td>
|
<td>author</td>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
pytchat is a python library for fetching youtube live chat.
|
pytchat is a python library for fetching youtube live chat.
|
||||||
"""
|
"""
|
||||||
__copyright__ = 'Copyright (C) 2019 taizan-hokuto'
|
__copyright__ = 'Copyright (C) 2019 taizan-hokuto'
|
||||||
__version__ = '0.0.1.9'
|
__version__ = '0.0.2.2'
|
||||||
__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'
|
||||||
@@ -13,6 +13,7 @@ __all__ = ["core_async","core_multithread","processors"]
|
|||||||
from .api import (
|
from .api import (
|
||||||
LiveChat,
|
LiveChat,
|
||||||
LiveChatAsync,
|
LiveChatAsync,
|
||||||
|
ChatProcessor,
|
||||||
CompatibleProcessor,
|
CompatibleProcessor,
|
||||||
SimpleDisplayProcessor,
|
SimpleDisplayProcessor,
|
||||||
JsonfileArchiveProcessor
|
JsonfileArchiveProcessor
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
from .core_async.livechat import LiveChatAsync
|
from .core_async.livechat import LiveChatAsync
|
||||||
from .core_multithread.livechat import LiveChat
|
from .core_multithread.livechat import LiveChat
|
||||||
|
from .processors.chat_processor import ChatProcessor
|
||||||
from .processors.default.processor import DefaultProcessor
|
from .processors.default.processor import DefaultProcessor
|
||||||
from .processors.compatible.processor import CompatibleProcessor
|
from .processors.compatible.processor import CompatibleProcessor
|
||||||
from .processors.simple_display_processor import SimpleDisplayProcessor
|
from .processors.simple_display_processor import SimpleDisplayProcessor
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
class Buffer(asyncio.Queue):
|
class Buffer(asyncio.Queue):
|
||||||
'''
|
'''
|
||||||
チャットデータを格納するバッファの役割を持つLIFOキュー
|
チャットデータを格納するバッファの役割を持つFIFOキュー
|
||||||
|
|
||||||
Parameter
|
Parameter
|
||||||
---------
|
---------
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import aiohttp, asyncio, async_timeout
|
import aiohttp, asyncio
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import queue
|
|||||||
|
|
||||||
class Buffer(queue.Queue):
|
class Buffer(queue.Queue):
|
||||||
'''
|
'''
|
||||||
チャットデータを格納するバッファの役割を持つLIFOキュー
|
チャットデータを格納するバッファの役割を持つFIFOキュー
|
||||||
|
|
||||||
Parameter
|
Parameter
|
||||||
---------
|
---------
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ class ChatProcessor:
|
|||||||
'''
|
'''
|
||||||
def process(self, chat_components: list):
|
def process(self, chat_components: list):
|
||||||
'''
|
'''
|
||||||
チャットデータの加工を表すインターフェース
|
チャットデータの加工を表すインターフェース。
|
||||||
Listenerから呼び出される。
|
LiveChatオブジェクトから呼び出される。
|
||||||
|
|
||||||
Parameter
|
Parameter
|
||||||
----------
|
----------
|
||||||
chat_components: list<component>
|
chat_components: [LIST:component]
|
||||||
component : dict {
|
component : dict {
|
||||||
"video_id" : str
|
"video_id" : str
|
||||||
動画ID
|
動画ID
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ symbols = {
|
|||||||
"PLN\xa0": {"fxtext": "PLN", "jptext": "ポーランド・ズロチ"},
|
"PLN\xa0": {"fxtext": "PLN", "jptext": "ポーランド・ズロチ"},
|
||||||
"R$": {"fxtext": "BRL", "jptext": "ブラジル・レアル"},
|
"R$": {"fxtext": "BRL", "jptext": "ブラジル・レアル"},
|
||||||
"RUB\xa0": {"fxtext": "RUB", "jptext": "ロシア・ルーブル"},
|
"RUB\xa0": {"fxtext": "RUB", "jptext": "ロシア・ルーブル"},
|
||||||
"SEK\xa0": {"fxtext": "SEK", "jptext": "スウェーデン・クローネ"},
|
"SEK\xa0": {"fxtext": "SEK", "jptext": "スウェーデン・クローナ"},
|
||||||
"£": {"fxtext": "GBP", "jptext": "英・ポンド"},
|
"£": {"fxtext": "GBP", "jptext": "英・ポンド"},
|
||||||
"₩": {"fxtext": "KRW", "jptext": "韓国・ウォン"},
|
"₩": {"fxtext": "KRW", "jptext": "韓国・ウォン"},
|
||||||
"€": {"fxtext": "EUR", "jptext": "欧・ユーロ"},
|
"€": {"fxtext": "EUR", "jptext": "欧・ユーロ"},
|
||||||
|
|||||||
14
setup.py
14
setup.py
@@ -31,16 +31,6 @@ assert url
|
|||||||
with open('README.md', encoding='utf-8') as f:
|
with open('README.md', encoding='utf-8') as f:
|
||||||
long_description = f.read()
|
long_description = f.read()
|
||||||
|
|
||||||
class CleanCommand(Command):
|
|
||||||
"""Custom clean command to tidy up the project root."""
|
|
||||||
user_options = []
|
|
||||||
def initialize_options(self):
|
|
||||||
pass
|
|
||||||
def finalize_options(self):
|
|
||||||
pass
|
|
||||||
def run(self):
|
|
||||||
#system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info')
|
|
||||||
system('rmdir /Q /S pytchat.egg-info, dist')
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
@@ -68,7 +58,5 @@ setup(
|
|||||||
'License :: OSI Approved :: MIT License',
|
'License :: OSI Approved :: MIT License',
|
||||||
],
|
],
|
||||||
keywords='youtube livechat asyncio',
|
keywords='youtube livechat asyncio',
|
||||||
cmdclass={
|
|
||||||
'clean': CleanCommand,
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
Reference in New Issue
Block a user