Update robust.py

fix errors caused by duckduckgo_search changing their syntax
main
witchdocsec 2024-05-21 21:12:57 +01:00 committed by GitHub
parent ff75a4a356
commit c045065502
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
#imports #imports
import requests import requests
from duckduckgo_search import ddg from duckduckgo_search import DDGS
import tldextract import tldextract
import numpy as np import numpy as np
import threading import threading
@ -53,7 +53,7 @@ def runrobust(args):
return(np.array_split(a, n)) return(np.array_split(a, n))
keywords = "filetype:TXT +inurl:\"robots.txt\"" keywords = "filetype:TXT +inurl:\"robots.txt\""
results = ddg(keywords, max_results=250) results = DDGS().text(keywords, max_results=250)
results=(href for href in (res["href"] for res in results)) results=(href for href in (res["href"] for res in results))
results=[*results] results=[*results]
results=split(results,5) results=split(results,5)