"""xmoviesforyou.com — direct HTML scrape.

Search: WordPress `?s=<q>` (lub `/page/<n>/?s=<q>` dla pagination).
Scene URL: `https://xmoviesforyou.com/<slug>/` (single segment).
"""
from __future__ import annotations

import re

from app.connectors.direct_scrapers._search_base import BaseSearchScraper


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