1745 wystapien w 291 plikach (backend, scripts, mobile). Dominowal jeden ksztalt, ' — ' laczace zdania, wiec poszedl przecinek; myslnik otwierajacy mysl zdjety; zakresy 0–5 i A–Z na dywiz. Podzial komentarz/kod robil skaner stanow, nie regex, zeby nie ruszyc myslnika stojacego w stringu albo w wyrazeniu regularnym. Potwierdzone maszynowo: po wycieciu komentarzy z wersji HEAD i z dysku obie sa identyczne we wszystkich 291 plikach, czyli poza komentarzami nie zmienilo sie nic. 233 pliki .py parsuja sie bez bledu, tsc ma te same 11 bledow w tych samych 3 plikach co przed zmiana. Dwie rzeczy wymagaly poprawki po automacie: wyrownane listy definicji, gdzie myslnik byl separatorem kolumny (37 miejsc, kolumna przywrocona), i trzy przeniesienia mysli do nowej linii, gdzie zostawal wiszacy przecinek na poczatku (poprawione recznie). Bundla nie republikuje: Hermes i tak nie niesie komentarzy, wiec dla uzytkownika to zero zmiany. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
59 lines
2.2 KiB
Python
59 lines
2.2 KiB
Python
"""Smoke test PornDoeScraper, fetch sample + sprawdz parsing."""
|
|
import logging
|
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
|
|
from app.connectors.direct_scrapers.porndoe import PornDoeScraper
|
|
|
|
|
|
def main():
|
|
scraper = PornDoeScraper()
|
|
print(f"sitetag: {scraper.sitetag}")
|
|
print(f"listing url p1: {scraper._listing_url(1)}")
|
|
print(f"listing url p2: {scraper._listing_url(2)}")
|
|
print()
|
|
|
|
count = 0
|
|
ok_studio = ok_perf = ok_date = ok_dur = ok_thumb = ok_phash = 0
|
|
for scene in scraper.latest_scenes(max_pages=1):
|
|
count += 1
|
|
if scene.studio:
|
|
ok_studio += 1
|
|
if scene.performers:
|
|
ok_perf += 1
|
|
if scene.release_date:
|
|
ok_date += 1
|
|
if scene.duration_sec:
|
|
ok_dur += 1
|
|
if scene.playback_sources and scene.playback_sources[0].thumbnail_url:
|
|
ok_thumb += 1
|
|
if scene.fingerprints:
|
|
ok_phash += 1
|
|
if count <= 5:
|
|
print(f"--- scene {count} ---")
|
|
print(f" ext_id: {scene.external_id}")
|
|
print(f" title: {scene.title[:60]}")
|
|
print(f" studio: {scene.studio.name if scene.studio else None}")
|
|
print(f" perf: {[p.name for p in scene.performers]}")
|
|
print(f" date: {scene.release_date}")
|
|
print(f" duration: {scene.duration_sec}s")
|
|
print(f" tags: {[t.name for t in scene.tags][:5]}")
|
|
print(f" thumb: {(scene.playback_sources[0].thumbnail_url or '')[:70]}")
|
|
print(f" phash: {[f.value for f in scene.fingerprints]}")
|
|
print()
|
|
if count >= 15:
|
|
break
|
|
|
|
print("=" * 50)
|
|
print(f"total scraped: {count}")
|
|
if count:
|
|
print(f" studio: {ok_studio}/{count} ({100*ok_studio//count}%)")
|
|
print(f" performer: {ok_perf}/{count} ({100*ok_perf//count}%)")
|
|
print(f" date: {ok_date}/{count} ({100*ok_date//count}%)")
|
|
print(f" duration: {ok_dur}/{count} ({100*ok_dur//count}%)")
|
|
print(f" thumbnail: {ok_thumb}/{count} ({100*ok_thumb//count}%)")
|
|
print(f" phash: {ok_phash}/{count} ({100*ok_phash//count}%)")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|