From 3c42d2d4e2d9fe87bd7fc689540df5e19bbafe4e Mon Sep 17 00:00:00 2001 From: Denozordec Date: Fri, 6 Nov 2026 19:02:37 +0700 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=B8=D0=B4=D0=B5=D0=BE:=2010-bit,=20DV?= =?UTF-8?q?=20=D0=B8=20=D0=BF=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D1=8C=20DV=20?= =?UTF-8?q?=D0=B8=D0=B7=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit На nnm строка «Видео» не называет битность и HDR — они только в заголовке («[4K, HDR10, DV 8.1, 10-bit]»). - bit_depth: если в строке «Видео» нет, ищется в заголовке - «DV» считается Dolby Vision (\b не цепляет DVD/DVDRip) - профиль из «DV 8.1», «DV P7», «DoVi P5»; только реальные профили, «DV 10-bit» — не профиль - тесты: раздача nnm «В поисках Дори», DVDRip / DV 10-bit, DV P7 Co-Authored-By: Claude Opus 5.5 --- src/techinfo.py | 9 ++++++--- tests/run_tests.py | 8 ++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/techinfo.py b/src/techinfo.py index e92f073..df43ee9 100644 --- a/src/techinfo.py +++ b/src/techinfo.py @@ -51,8 +51,10 @@ RE_FPS = re.compile(r"(?i)(? dict | None: size = RE_SIZE.search(src) or RE_SIZE.search(extra) width, height = (int(size.group(1)), int(size.group(2))) if size else (None, None) fps = RE_FPS.search(src) - depth = RE_DEPTH.search(src) - dv = RE_DV_PROFILE.search(src) or RE_DV_PROFILE.search("\n".join(_field(text, r"HDR\s*format"))) + depth = RE_DEPTH.search(src) or RE_DEPTH.search(title or "") # nnm: «10-bit» бывает только в заголовке + dv = (RE_DV_PROFILE.search(src) or RE_DV_PROFILE.search("\n".join(_field(text, r"HDR\s*format"))) + or RE_DV_SHORT.search(src) or RE_DV_SHORT.search(title or "")) hdr = hdr_flags(src, *_field(text, r"HDR\s*format"), release_quality(text), title) return { "codec": codec, diff --git a/tests/run_tests.py b/tests/run_tests.py index 2278c11..9ae3d43 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -420,6 +420,14 @@ check("видео: «5763 Mбит/с» — на деле килобиты", _rat check("видео: кадр 1920x800 — всё равно 1080p; fps 23.809523 целиком", (lambda v: v["resolution"] == "1080p" and v["fps"] == 23.809523)(video_info("Видео: AVC, 1920x800, 23.809523 fps, 1776 Kbps"))) check("видео: строки «Видео» нет -> None", video_info("Аудио: AC3, 2 ch") is None) +_vn = video_info("Видео: HEVC/H.265, 3840x2160, ~21.4 Mbps", + "В поисках Дори / Finding Dory (2016) UHD BDRip [H.265/2160p] [4K, HDR10, DV 8.1, 10-bit]") +check("видео nnm: 10-bit и «DV 8.1» только в заголовке -> bit_depth 10, Dolby Vision, профиль 8.1", + (_vn["bit_depth"], _vn["hdr"], _vn["dv_profile"]) == (10, ["Dolby Vision", "HDR10"], "8.1"), str(_vn)) +check("видео: «DVDRip», «DV 10-bit» — не Dolby Vision-профиль", + (lambda a, b: a["hdr"] == [] and a["dv_profile"] is None and b["dv_profile"] is None and b["bit_depth"] == 10)( + video_info("Видео: XviD, 720x400", "Фильм [2001, DVDRip]"), video_info("Видео: HEVC, 3840x2160", "Фильм [DV 10-bit]"))) +check("видео: «DV P7» в заголовке -> профиль 7", video_info("Видео: HEVC, 3840x2160", "Film 2160p DV P7 HDR10")["dv_profile"] == "7") check("релиз: «18 x ~ 00:20:00» и список файлов — без duration_sec", release_info("Продолжительность: 18 x ~ 00:20:00")["duration_sec"] is None and release_info("Продолжительность: 01:31:25, 01:25:23")["duration_sec"] is None)