From cc3e4d1edd5ee1f9676aa3c0b711b3a8ec988987 Mon Sep 17 00:00:00 2001 From: lededev Date: Mon, 11 Apr 2022 17:32:01 +0800 Subject: [PATCH] str.find() return -1 when fail --- core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core.py b/core.py index 39f4276..51dcc66 100644 --- a/core.py +++ b/core.py @@ -652,8 +652,7 @@ def core_main_no_net_op(movie_path, number): full_nfo = Path(path) / f"{prestr}{part}.nfo" if full_nfo.is_file(): - nfo = full_nfo.read_text(encoding='utf-8') - if nfo.find(r'无码'): + if full_nfo.read_text(encoding='utf-8').find(r'无码') >= 0: uncensored = 1 else: return