Ссылка lostfilm.tv: сразу MVO LostFilm без загрузки страницы
docker / build (push) Successful in 1m26s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
DenozordecandClaude Sonnet 5.5 committed 2026-11-01 21:32:35 +07:00
1 parent 111e854789
commit 5bd3b94b46
5 files changed
+40 -6

No files matched your search

+12
View File
@@ -1105,6 +1105,18 @@ check("токен: Bearer и X-API-Key принимаются",
check("без DUB_API_TOKEN /predict открыт, /health показывает segmenter и auth",
TestClient(create_app(_Stub())).post("/predict", json={"text": "a"}).status_code == 200
and _c.get("/health").json()["auth"] is True and _c.get("/health").json()["segmenter"] == "rules")
_lf = _c.post("/predict", json={"url": "https://www.lostfilm.tv/series/X/season_1/episode_2/"},
headers={"X-API-Key": "tok"})
_lfj = _lf.json() if _lf.status_code == 200 else {}
check("ссылка lostfilm.tv: сразу MVO LostFilm без загрузки страницы",
_lfj.get("tracker") == "lostfilm" and _lfj["studios"][0]["studio"] == "LostFilm"
and _lfj["studios"][0]["translation_type"] == "проф. многоголосый" and _lfj["tracks"][0]["lang"] == "RUS",
str(_lf.status_code))
from src.fetch import is_lostfilm # noqa: E402
check("is_lostfilm: lostfilm.tv и поддомены да, rutracker и подделка в пути нет",
is_lostfilm("https://lostfilm.tv/x") and is_lostfilm("https://www.lostfilm.tv/x")
and not is_lostfilm("https://rutracker.org/forum/viewtopic.php?t=1&u=lostfilm.tv")
and not is_lostfilm("https://evil.com/lostfilm.tv"))
import src.service as _svc8 # noqa: E402
_fetch_calls: list = []
_orig_fetch = _svc8.fetch_html