mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
请求异常也加入结果
This commit is contained in:
+6
-1
@@ -135,7 +135,7 @@ def get(url, resp_list, session):
|
||||
resp = session.get(url, timeout=timeout, allow_redirects=redirect, proxies=proxy)
|
||||
except Exception as e:
|
||||
logger.log('DEBUG', e.args)
|
||||
return
|
||||
resp = e
|
||||
resp_list.append((url, resp))
|
||||
|
||||
|
||||
@@ -194,6 +194,11 @@ def bulk_request(urls):
|
||||
|
||||
|
||||
def gen_new_info(info, resp):
|
||||
if isinstance(resp, Exception):
|
||||
info['reason'] = str(resp.args)
|
||||
info['request'] = 0
|
||||
info['alive'] = 0
|
||||
return info
|
||||
info['reason'] = resp.reason
|
||||
code = resp.status_code
|
||||
info['status'] = code
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
import re
|
||||
import time
|
||||
from urllib import parse
|
||||
from requests import Response
|
||||
|
||||
from common import utils
|
||||
from common import resolve
|
||||
@@ -192,7 +193,7 @@ def find_subdomains(domain, data):
|
||||
|
||||
resp_data = request.bulk_request(js_urls)
|
||||
for _, resp in resp_data:
|
||||
if not resp:
|
||||
if not isinstance(resp, Response):
|
||||
continue
|
||||
text = utils.decode_resp_text(resp)
|
||||
subdomains.update(find_in_resp(domain, resp.url, text))
|
||||
|
||||
Reference in New Issue
Block a user