This commit is contained in:
marco
2020-04-30 15:51:41 +02:00
parent 7d32bde60d
commit fcb3bc3a5a

View File

@@ -12,15 +12,15 @@ from platformcode import logger, config
def findhost():
page = httptools.downloadpage('https://cb01-nuovo-indirizzo.info/', follow_redirects=False)
permUrl = page.headers
if 'location' in permUrl:
if 'google' in permUrl['location']:
host = permUrl['location'].replace('https://www.google.it/search?q=site:', '')
else:
host = permUrl['location']
else:
host = support.match(page.data, patron=r'<a href="([^"]+)" title="nuovo indirizzo cb01').match
page = httptools.downloadpage('https://cb01.uno/')
# permUrl = page.headers
# if 'location' in permUrl:
# if 'google' in permUrl['location']:
# host = permUrl['location'].replace('https://www.google.it/search?q=site:', '')
# else:
# host = permUrl['location']
# else:
host = support.match(page.data, patron=r'<a href="([^"]+)').match
return host