2021-05-03 02:40:21 +04:00
|
|
|
from typing import Optional
|
2020-07-20 03:45:51 +04:00
|
|
|
|
2021-05-03 02:40:21 +04:00
|
|
|
from scrapthechan.parsers.tinyboardlike import TinyboardLikeParser
|
2020-07-20 03:45:51 +04:00
|
|
|
|
|
|
|
__all__ = ["EightKunParser"]
|
|
|
|
|
|
|
|
|
2021-05-03 02:40:21 +04:00
|
|
|
class EightKunParser(TinyboardLikeParser):
|
2020-07-20 03:45:51 +04:00
|
|
|
"""JSON parser for 8kun.top image board."""
|
|
|
|
|
|
|
|
def __init__(self, board: str, thread: str,
|
|
|
|
skip_posts: Optional[int] = None) -> None:
|
2021-05-03 02:40:21 +04:00
|
|
|
super().__init__(board, thread, skip_posts)
|
2020-07-20 03:45:51 +04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def imageboard(self) -> str:
|
|
|
|
return "8kun.top"
|
|
|
|
|
|
|
|
@property
|
2021-05-03 02:40:21 +04:00
|
|
|
def json_thread_url(self) -> str:
|
|
|
|
return "https://8kun.top/{board}/res/{thread}.json"
|
|
|
|
|
|
|
|
@property
|
|
|
|
def file_base_url(self) -> str:
|
|
|
|
return "https://media.8kun.top/file_dl/{filename}"
|