"""watchporn.to — direct HTML scrape.

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

import re

from app.connectors.direct_scrapers._search_base import BaseSearchScraper


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