Skip to content

Commit e29e729

Browse files
fix: 更新开场白匹配逻辑以支持多个匹配条件
1 parent f4dc53d commit e29e729

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

flag.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,16 @@ def autosub(videopath, subpath, opType):
470470
match_op_hash = phash(frame)
471471
# print(match_op_hash)
472472
# print(hamming_distance(match_op_hash,opening[0]))
473-
if match_op_hash in opening or (
474-
op_match_times == 0
475-
and hamming_distance(match_op_hash, opening[0]) < 3
473+
if (
474+
match_op_hash in opening
475+
or (
476+
op_match_times == 0
477+
and hamming_distance(match_op_hash, opening[0]) < 3
478+
)
479+
or (
480+
op_match_times == 1
481+
and hamming_distance(match_op_hash, opening[1]) < 3
482+
)
476483
):
477484
op = not op
478485
op_match_times += 1

0 commit comments

Comments
 (0)