mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-25 20:37:48 +08:00
添加结果排序
This commit is contained in:
+3
-1
@@ -1,6 +1,7 @@
|
|||||||
import json
|
import json
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
|
from operator import attrgetter
|
||||||
|
|
||||||
import tqdm
|
import tqdm
|
||||||
import requests
|
import requests
|
||||||
@@ -243,7 +244,8 @@ def run_request(domain, data, port):
|
|||||||
new_data = gen_new_data(req_data, resp_list)
|
new_data = gen_new_data(req_data, resp_list)
|
||||||
count = utils.count_alive(new_data)
|
count = utils.count_alive(new_data)
|
||||||
logger.log('INFOR', f'Found that {domain} has {count} alive subdomains')
|
logger.log('INFOR', f'Found that {domain} has {count} alive subdomains')
|
||||||
return new_data
|
sorted_data = utils.sort_by_subdomain(new_data)
|
||||||
|
return sorted_data
|
||||||
|
|
||||||
|
|
||||||
def save_db(name, data):
|
def save_db(name, data):
|
||||||
|
|||||||
@@ -723,3 +723,7 @@ def decode_resp_text(resp):
|
|||||||
# 最后尝试自动解码
|
# 最后尝试自动解码
|
||||||
content = str(content, errors='replace')
|
content = str(content, errors='replace')
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
||||||
|
def sort_by_subdomain(data):
|
||||||
|
return sorted(data, key=lambda item: item.get('subdomain'))
|
||||||
|
|||||||
Reference in New Issue
Block a user