|
@@ -154,10 +154,19 @@ class GPT4o():
|
|
match = pattern.search(content)
|
|
match = pattern.search(content)
|
|
if match:
|
|
if match:
|
|
pw = match.group(1)
|
|
pw = match.group(1)
|
|
- return pw
|
|
|
|
|
|
+ # 检查文本中是否包含英文字母
|
|
|
|
+ if re.search(r'[a-zA-Z]', pw):
|
|
|
|
+ cleaned_text = re.sub(r'[a-zA-Z]', '', pw)
|
|
|
|
+ else:
|
|
|
|
+ cleaned_text = pw
|
|
|
|
+ return cleaned_text
|
|
else:
|
|
else:
|
|
if content:
|
|
if content:
|
|
- return content
|
|
|
|
|
|
+ if re.search(r'[a-zA-Z]', content):
|
|
|
|
+ cleaned_text = re.sub(r'[a-zA-Z]', '', content)
|
|
|
|
+ else:
|
|
|
|
+ cleaned_text = content
|
|
|
|
+ return cleaned_text
|
|
if attempt == max_retries - 1:
|
|
if attempt == max_retries - 1:
|
|
return None
|
|
return None
|
|
except Exception:
|
|
except Exception:
|
|
@@ -166,5 +175,5 @@ class GPT4o():
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
- title = '女子每天打卡喊雷军"老公"被禁言'
|
|
|
|
- GPT4o.get_ai_title(title)
|
|
|
|
|
|
+ title = '劝自己少生气'
|
|
|
|
+ GPT4o.get_ai_pw(title)
|