KeyHunter parser v10 + 18 scanners + tests (synthetic fixtures only, no keys/db/tokens)
This commit is contained in:
21
dbg_sg.py
Normal file
21
dbg_sg.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import requests
|
||||
|
||||
H = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/128",
|
||||
"Accept": "text/event-stream"}
|
||||
q = "DEEPSEEK_API_KEY"
|
||||
r = requests.get("https://sourcegraph.com/.api/search/stream",
|
||||
params={"q": f'{q} count:20', "v": "V3", "t": "literal", "display": "20"},
|
||||
headers=H, timeout=30, stream=True)
|
||||
print("status:", r.status_code, r.headers.get("content-type", "")[:40])
|
||||
n = 0
|
||||
chunk = []
|
||||
for line in r.iter_lines(decode_unicode=True):
|
||||
if line is None:
|
||||
continue
|
||||
chunk.append(line)
|
||||
n += 1
|
||||
if n > 40:
|
||||
break
|
||||
text = "\n".join(chunk)
|
||||
print("lines:", n)
|
||||
print(text[:800])
|
||||
Reference in New Issue
Block a user