2021-05-03 02:40:21 +04:00
|
|
|
from typing import Optional
|
2020-07-08 22:53:39 +04:00
|
|
|
|
2021-05-03 02:40:21 +04:00
|
|
|
from scrapthechan.parsers.tinyboardlike import TinyboardLikeParser
|
2020-07-08 22:53:39 +04:00
|
|
|
|
|
|
|
__all__ = ["LainchanParser"]
|
|
|
|
|
|
|
|
|
2021-05-03 02:40:21 +04:00
|
|
|
class LainchanParser(TinyboardLikeParser):
|
|
|
|
"""JSON parser for lainchan.org image board."""
|
2020-07-08 22:53:39 +04:00
|
|
|
|
|
|
|
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-08 22:53:39 +04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def imageboard(self) -> str:
|
|
|
|
return "lainchan.org"
|
|
|
|
|
2021-05-03 02:40:21 +04:00
|
|
|
@property
|
|
|
|
def json_thread_url(self) -> str:
|
|
|
|
return "https://lainchan.org/{board}/res/{thread}.json"
|
2020-07-08 22:53:39 +04:00
|
|
|
|
2021-05-03 02:40:21 +04:00
|
|
|
@property
|
|
|
|
def file_base_url(self) -> str:
|
|
|
|
return "https://lainchan.org/{board}/src/{filename}"
|