'v0.6'
This commit is contained in:
@@ -119,23 +119,23 @@ def version_information(url, regex):
|
||||
else:
|
||||
r = requests.get(url, stream=True, timeout=config['timeout'], headers=custom_headers, verify=False)
|
||||
if r.status_code == 200:
|
||||
version = None
|
||||
if ('manual.sxw' in url) and not ('Page Not Found' in r.text):
|
||||
return 'check manually'
|
||||
try:
|
||||
for content in r.iter_content(chunk_size=400, decode_unicode=False):
|
||||
for content in r.iter_content(chunk_size=400, decode_unicode=False):
|
||||
try:
|
||||
search = re.search(regex, str(content))
|
||||
version = search.group(1)
|
||||
r.close()
|
||||
return version
|
||||
except:
|
||||
try:
|
||||
search = re.search('([0-9]+-[0-9]+-[0-9]+)', str(content))
|
||||
version = search.group(1)
|
||||
r.close()
|
||||
return version
|
||||
except:
|
||||
try:
|
||||
search = re.search('([0-9]+-[0-9]+-[0-9]+)', str(content))
|
||||
version = search.group(1)
|
||||
except:
|
||||
continue
|
||||
if version:
|
||||
r.close()
|
||||
return None
|
||||
break
|
||||
return version
|
||||
except requests.exceptions.Timeout:
|
||||
print(Fore.RED + ' [x] Connection timed out on "{}"'.format(url) + Fore.RESET)
|
||||
except requests.exceptions.RequestException as e:
|
||||
|
||||
Reference in New Issue
Block a user