1
0
ScrapTheChan/scrapthechan/parsers/lainchan.py

26 lines
631 B
Python
Raw Normal View History

from typing import Optional
2020-07-08 22:53:39 +04:00
from scrapthechan.parsers.tinyboardlike import TinyboardLikeParser
2020-07-08 22:53:39 +04:00
__all__ = ["LainchanParser"]
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:
super().__init__(board, thread, skip_posts)
2020-07-08 22:53:39 +04:00
@property
def imageboard(self) -> str:
return "lainchan.org"
@property
def json_thread_url(self) -> str:
return "https://lainchan.org/{board}/res/{thread}.json"
2020-07-08 22:53:39 +04:00
@property
def file_base_url(self) -> str:
return "https://lainchan.org/{board}/src/{filename}"