"""fpoxxx — direct HTML scrape search results.

UWAGA: dokładna domena fpoxxx (sitetag w bazie) niekoniecznie zawiera "com" ani
"net" — porn-app DEFAULT_SITETAGS używa "fpoxxx" jako sitetag. Best-guess: fpo.xxx.

Search: `https://fpo.xxx/page/<n>/?s=<q>` (WordPress).
Scene URL: `https://fpo.xxx/<slug>/`.
"""
from __future__ import annotations

import re

from app.connectors.direct_scrapers._search_base import BaseSearchScraper


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