proxytranslate in updateDomains e timeout di 60 secondi nei test

This commit is contained in:
mac12m99
2021-01-31 20:30:17 +01:00
parent e0fcc9c11c
commit feaf9fb826
5 changed files with 18 additions and 5 deletions
+12
View File
@@ -61,6 +61,18 @@ if __name__ == '__main__':
if rslt['redirect'].endswith('/'):
rslt['redirect'] = rslt['redirect'][:-1]
result[chann] = rslt['redirect']
# cloudflare...
elif rslt['code'] in [429, 503, 403]:
from lib import proxytranslate
import re
print('Cloudflare riconosciuto')
try:
data = proxytranslate.process_request_proxy(host).get('data', '')
result[chann] = re.search('<base href="([^"]+)', data).group(1)
except Exception as e:
import traceback
traceback.print_last()
# non-existent site
elif rslt['code'] == -2:
print('Host Sconosciuto - '+ str(rslt['code']) +' - '+ host)