"""siska.video — direct HTML scrape.

Search: `https://siska.video/page/<n>/?s=<q>`.
Scene URL: `https://siska.video/<slug>/`.
"""
from __future__ import annotations

import re

from app.connectors.direct_scrapers._search_base import BaseSearchScraper


class SiskaScraper(BaseSearchScraper):
    sitetag = "siskavideo"
    _search_url_template = "https://siska.video/page/{page}/?s={query}"
    _scene_url_re = re.compile(
        r'href="(?P<url>https://siska\.video/(?P<slug>[a-z0-9][a-z0-9\-]+))/"',
        re.IGNORECASE,
    )
