fix updateDomains

This commit is contained in:
mac12m99
2021-02-03 18:21:01 +01:00
parent b8b7d26542
commit 5cc9f96b4b

View File

@@ -58,8 +58,6 @@ if __name__ == '__main__':
# redirect
elif str(rslt['code']).startswith('3'):
# result[chann] = str(rslt['code']) +' - '+ rslt['redirect'][:-1]
if rslt['redirect'].endswith('/'):
rslt['redirect'] = rslt['redirect'][:-1]
result[chann] = rslt['redirect']
# cloudflare...
elif rslt['code'] in [429, 503, 403]:
@@ -69,7 +67,7 @@ if __name__ == '__main__':
print('Cloudflare riconosciuto')
try:
page_data = proxytranslate.process_request_proxy(host).get('data', '')
result[chann] = re.search('<base href="([^"]+)/', page_data).group(1)
result[chann] = re.search('<base href="([^"]+)', page_data).group(1)
rslt['code_new'] = 200
except Exception as e:
import traceback
@@ -85,6 +83,8 @@ if __name__ == '__main__':
print('Errore Sconosciuto - '+str(rslt['code']) +' - '+ host)
print("check #### FINE #### rslt :%s " % (rslt))
if result[chann].endswith('/'):
result[chann] = result[chann][:-1]
result = {'findhost': data['findhost'], 'direct': result}
# I write the updated file