29 lines
1.2 KiB
Python
29 lines
1.2 KiB
Python
import sys, json
|
|
sys.path.insert(0,'.')
|
|
from concurrent.futures import ThreadPoolExecutor
|
|
from omni import net
|
|
|
|
URLS = [
|
|
"https://darknetlive.com/feed/", "https://darknetlive.com/rss/", "https://darknetlive.com/rss.xml",
|
|
"https://www.volexity.com/blog/feed/", "https://cxsecurity.com/rss/",
|
|
"https://www.debian.org/security/", "https://www.openwall.com/lists/oss-security/",
|
|
"https://www.t00ls.com/", "https://xz.aliyun.com/",
|
|
"https://t.me/s/TheHackersNews", "https://t.me/s/thehackernews", "https://t.me/s/SecAtor",
|
|
"https://t.me/s/true_secator", "https://t.me/s/databreaches", "https://t.me/s/cybersecuritynews",
|
|
]
|
|
def one(u):
|
|
try:
|
|
r = net.get(u, timeout=25)
|
|
t = r.text or ""
|
|
return {"u":u,"st":r.status,"n":len(t),
|
|
"ct":(r.headers or {}).get("content-type","")[:40],
|
|
"item":t.count("<item"),"entry":t.count("<entry"),
|
|
"tgmsg":t.count("tgme_widget_message_wrap"),
|
|
"hdr":t.count('tgme_channel_info_header_title'),
|
|
"head": " ".join(t[:200].split())[:120]}
|
|
except Exception as e:
|
|
return {"u":u,"st":0,"err":str(e)[:90]}
|
|
with ThreadPoolExecutor(6) as ex:
|
|
for r in ex.map(one, URLS):
|
|
print(json.dumps(r, ensure_ascii=False))
|