Trzy zrodla filmow od tygodnia nie dawaly nic, a watchdog widzial tylko "brak nowych": - streamporn.vip -> 302 streamporn.li; konektor odrzuca linki spoza swojej domeny, wiec lista byla pusta. Id filmu to slug, domena nie robi duplikatow. - mangoporn: /movies/ daje 404, lista z /page/N/; link ma class przed href, tytul w golym <h1> (zapas po itemprop i class="data"); limit 75 s, strona odpowiada z VPS po 30-60 s. - yourdailypornmovies: nowe linie miedzy znacznikami karty, wzorzec bez \s* nie lapal nic przy dzialajacej stronie. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
53 lines
2.9 KiB
Python
53 lines
2.9 KiB
Python
from app.connectors.yourdailypornmovies import _AE_ID_RE, _CARD_RE
|
|
|
|
_OLD = (
|
|
'<div class="movie"><div class="imagen"> <img src="https://imgs1cdn.adultempire.com/products/05/5128705h.jpg" '
|
|
'alt="Ramming Into Her" width="100%" height="100%" /> <a href="https://yourdailypornmovies.ws/ramming-into-her/">'
|
|
'<span class="player"></span></a></div><h2>Ramming Into Her</h2> <span class="year">2026</span></div>'
|
|
)
|
|
_NEW = (
|
|
'<div class="movie"><div class="imagen"> <img src="https://imgs4cdn.adultempire.com/movie/5136742?w=500&h=700&fit=cover" '
|
|
'alt="Big Butts Drive Me Nuts 8" width="100%" height="100%" /> <a href="https://yourdailypornmovies.ws/big-butts-drive-me-nuts-8/">'
|
|
'<span class="player"></span></a></div><h2>Big Butts Drive Me Nuts 8</h2> <span class="year">2026</span></div>'
|
|
)
|
|
_IBB = (
|
|
'<div class="movie"><div class="imagen"> <img src="https://i.ibb.co/DHDd9pm9/Private-POV.jpg" alt="Private POV" '
|
|
'width="100%" height="100%" /> <a href="https://yourdailypornmovies.ws/private-pov/"><span class="player"></span></a>'
|
|
'</div><h2>Private POV</h2> <span class="year">2026</span></div>'
|
|
)
|
|
_NO_IMG = (
|
|
'<div class="movie"><div class="imagen"> <a href="https://yourdailypornmovies.ws/no-cover/"><span class="player">'
|
|
'</span></a></div><h2>No Cover</h2> <span class="year">2025</span></div>'
|
|
)
|
|
|
|
|
|
def test_all_card_variants_parse():
|
|
cards = list(_CARD_RE.finditer(_OLD + _NEW + _IBB + _NO_IMG))
|
|
assert [c.group("title") for c in cards] == [
|
|
"Ramming Into Her", "Big Butts Drive Me Nuts 8", "Private POV", "No Cover"
|
|
]
|
|
assert cards[3].group("poster") is None
|
|
assert cards[3].group("url") == "https://yourdailypornmovies.ws/no-cover/"
|
|
|
|
|
|
def test_adultempire_id_from_both_poster_formats():
|
|
old = _AE_ID_RE.search("https://imgs1cdn.adultempire.com/products/05/5128705h.jpg")
|
|
new = _AE_ID_RE.search("https://imgs4cdn.adultempire.com/movie/5136742?w=500&h=700&fit=cover")
|
|
assert (old.group(1) or old.group(2)) == "5128705"
|
|
assert (new.group(1) or new.group(2)) == "5136742"
|
|
assert _AE_ID_RE.search("https://i.ibb.co/DHDd9pm9/Private-POV.jpg") is None
|
|
|
|
|
|
_MULTILINE = (
|
|
'<div class="movie">\n<div class="imagen">\n'
|
|
'<img src="https://imgs4cdn.adultempire.com/movie/2755934?w=500&h=700&fit=cover" alt="Busty Treats Vol. 2" '
|
|
'width="100%" height="100%" />\n<a href="https://yourdailypornmovies.ws/busty-treats-vol-2/"><span class="player"></span></a>\n'
|
|
'</div>\n<h2>Busty Treats Vol. 2</h2>\n<span class="year">2026</span></div>'
|
|
)
|
|
|
|
|
|
def test_card_with_newlines_between_tags():
|
|
# Uklad strony od 2026-10: nowe linie miedzy znacznikami (0 filmow do poprawki).
|
|
cards = list(_CARD_RE.finditer(_MULTILINE + _MULTILINE.replace("busty-treats-vol-2", "b2")))
|
|
assert [c.group("title") for c in cards] == ["Busty Treats Vol. 2", "Busty Treats Vol. 2"]
|
|
assert cards[0].group("url").endswith("/busty-treats-vol-2/")
|