only scan webpages

This commit is contained in:
Somdev Sangwan
2024-04-01 09:18:01 +05:30
parent 538d5608a7
commit 6d86371113

View File

@@ -77,8 +77,9 @@ def stable_request(url, headers):
verify=False, verify=False,
timeout=10, timeout=10,
allow_redirects=redirects_allowed) allow_redirects=redirects_allowed)
if not response.headers.get('Content-Type', '').startswith('text/'): content = response.headers.get('Content-Type', '')
print('%s URL doesn\'t seem to be a webpage. Skipping.' % info) if not ('text' in content or 'html' in content or 'json' in content or 'xml' in content):
print('%s URL doesn\t seem to be a webpage. Skipping.' % info)
return None return None
return response.url return response.url
except Exception as e: except Exception as e: