Update server.py

This commit is contained in:
Namhyeon Go 2024-02-20 14:49:47 +09:00 committed by GitHub
parent 293ff9dc8b
commit 388c7cfed4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -172,7 +172,7 @@ def proxy_check_filtered(data, webserver, port, scheme, method, url):
# convert to text # convert to text
text = data.decode(client_encoding, errors='ignore') text = data.decode(client_encoding, errors='ignore')
# check ID with VowelRatio10 strategy # check ID with K-Anonymity strategy
pattern = r'\b(?:(?<=\/@)|(?<=acct:))([a-zA-Z0-9]{10})\b' pattern = r'\b(?:(?<=\/@)|(?<=acct:))([a-zA-Z0-9]{10})\b'
matches = list(set(re.findall(pattern, text))) matches = list(set(re.findall(pattern, text)))
if len(matches) > 0: if len(matches) > 0:
@ -190,7 +190,7 @@ def proxy_check_filtered(data, webserver, port, scheme, method, url):
return ratio > 0.2 and ratio < 0.7 return ratio > 0.2 and ratio < 0.7
filtered = not all(map(vowel_ratio_test, matches)) filtered = not all(map(vowel_ratio_test, matches))
# check an attached images (Not-CAPTCHA strategy) # check an attached images (check images with Not-CAPTCHA strategy)
if not filtered and len(matches) > 0 and truecaptcha_userid != '': if not filtered and len(matches) > 0 and truecaptcha_userid != '':
def webp_to_png_base64(url): def webp_to_png_base64(url):
try: try: