randydev commited on
Commit
169a936
·
verified ·
1 Parent(s): 1e5e9c7
Files changed (1) hide show
  1. helper_regex.py +5 -2
helper_regex.py CHANGED
@@ -18,8 +18,11 @@ def check_anti_word_by_ryzenth(text: str):
18
  f"https://randydev-ryu-js.hf.space/api/v1/ai/akenox/antidevai?query={text}",
19
  headers={"x-api-key": "akeno_UKQEQMt991kh2Ehh7JqJYKapx8CCyeC"}
20
  ).json()
21
- ok = json.loads(response["results"])
22
- return ok["is_detect"]
 
 
 
23
 
24
  def contains_stylish_with_whitelist(text: str) -> bool:
25
  emoji_pattern = re.compile(
 
18
  f"https://randydev-ryu-js.hf.space/api/v1/ai/akenox/antidevai?query={text}",
19
  headers={"x-api-key": "akeno_UKQEQMt991kh2Ehh7JqJYKapx8CCyeC"}
20
  ).json()
21
+ try:
22
+ ok = json.loads(response["results"])
23
+ return ok["is_detect"]
24
+ except json.decoder.JSONDecodeError:
25
+ return False
26
 
27
  def contains_stylish_with_whitelist(text: str) -> bool:
28
  emoji_pattern = re.compile(