"""latestleaks.co — direct HTML scrape.

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

import re

from app.connectors.direct_scrapers._search_base import BaseSearchScraper


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