1
0
ScrapTheChan/scrapthechan/parsers/eightkun.py

26 lines
617 B
Python

from typing import Optional
from scrapthechan.parsers.tinyboardlike import TinyboardLikeParser
__all__ = ["EightKunParser"]
class EightKunParser(TinyboardLikeParser):
"""JSON parser for 8kun.top image board."""
def __init__(self, board: str, thread: str,
skip_posts: Optional[int] = None) -> None:
super().__init__(board, thread, skip_posts)
@property
def imageboard(self) -> str:
return "8kun.top"
@property
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}"