1
0
ScrapTheChan/scrapthechan/parsers/lainchan.py

26 lines
631 B
Python

from typing import Optional
from scrapthechan.parsers.tinyboardlike import TinyboardLikeParser
__all__ = ["LainchanParser"]
class LainchanParser(TinyboardLikeParser):
"""JSON parser for lainchan.org 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 "lainchan.org"
@property
def json_thread_url(self) -> str:
return "https://lainchan.org/{board}/res/{thread}.json"
@property
def file_base_url(self) -> str:
return "https://lainchan.org/{board}/src/{filename}"