forked from 0lh/DirScan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dirscan.py
29 lines (25 loc) · 784 Bytes
/
dirscan.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import asyncio
import httpx
import time
from core.core import judge_path_status
from lib.queue_put import q, queue_put
from lib.cmdline import parse_args
from conf.config import COROS_NUM
async def main():
'''
main函数
:return:
'''
async with httpx.AsyncClient(verify=False) as client: # 创建session
tasks = []
for _ in range(COROS_NUM):
task = judge_path_status(client, q)
tasks.append(task)
await asyncio.wait(tasks)
if __name__ == '__main__':
start_time = time.time()
argv = parse_args()
urls_file, dict_file, filename_dict = argv.target, argv.dirs, argv.filenames
queue_put(urls_file, dict_file, filename_dict)
asyncio.run(main())
print(f'Cost time: {time.time() - start_time}')