"""eporner.com — direct HTML scrape search results.

Search: `https://www.eporner.com/search/<q>/<page>/` (1-indexed pages).
Scene URL: `https://www.eporner.com/hd-porn/<id>/<slug>/` lub `/video-<id>/<slug>/`.
"""
from __future__ import annotations

import re

from app.connectors.direct_scrapers._search_base import BaseSearchScraper


class EpornerScraper(BaseSearchScraper):
    sitetag = "epornercom"
    _search_url_template = "https://www.eporner.com/search/{query}/{page}/"
    _scene_url_re = re.compile(
        r'href="(?P<url>/(?:hd-porn|video-[a-z0-9]+)/(?:[a-zA-Z0-9]+/)?(?P<slug>[a-zA-Z0-9_\-]+))/?"',
    )
