paijo77 commited on
Commit
453d345
·
verified ·
1 Parent(s): 67732b2

update scripts/verify_hunter.py

Browse files
Files changed (1) hide show
  1. scripts/verify_hunter.py +66 -0
scripts/verify_hunter.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import asyncio
2
+ import logging
3
+ import sys
4
+ import os
5
+
6
+ # Add app to path
7
+ sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
8
+
9
+ from app.hunter.strategies.github import GitHubStrategy
10
+ from app.hunter.strategies.ai import AIStrategy
11
+ from app.hunter.extractor import UniversalExtractor
12
+
13
+ logging.basicConfig(level=logging.INFO)
14
+ logger = logging.getLogger("manual_verification")
15
+
16
+
17
+ async def verify_github():
18
+ print("\n--- Verifying GitHub Strategy ---")
19
+ strategy = GitHubStrategy()
20
+ urls = await strategy.discover()
21
+ print(f"Found {len(urls)} URLs from GitHub")
22
+ if urls:
23
+ print(f"Sample: {urls[0]}")
24
+ return len(urls) > 0
25
+
26
+
27
+ async def verify_ai():
28
+ print("\n--- Verifying AI Strategy ---")
29
+ strategy = AIStrategy()
30
+ urls = await strategy.discover()
31
+ print(f"Found {len(urls)} URLs from AI")
32
+ if urls:
33
+ print(f"Sample: {urls[0]}")
34
+ return (
35
+ True # AI might fail if no keys or rate limit, but we want to ensure code runs
36
+ )
37
+
38
+
39
+ async def verify_extractor():
40
+ print("\n--- Verifying Extractor ---")
41
+ sample_content = """
42
+ Here is a proxy: 1.1.1.1:80
43
+ And a vmess: vmess://eyJhZGQiOiIxMjcuMC4wLjEiLCJwb3J0Ijo0NDN9
44
+ """
45
+ proxies = UniversalExtractor.extract_proxies(sample_content)
46
+ print(f"Extracted {len(proxies)} proxies")
47
+ for p in proxies:
48
+ print(f"- {p.protocol}://{p.ip}:{p.port}")
49
+ return len(proxies) >= 1
50
+
51
+
52
+ async def main():
53
+ print("STARTING MANUAL VERIFICATION")
54
+
55
+ gh_ok = await verify_github()
56
+ ai_ok = await verify_ai()
57
+ ext_ok = await verify_extractor()
58
+
59
+ print("\n--- SUMMARY ---")
60
+ print(f"GitHub Strategy: {'[OK]' if gh_ok else '[FAILED/Auth]'}")
61
+ print(f"AI Strategy: {'[OK]' if ai_ok else '[FAILED/Auth]'}")
62
+ print(f"Extractor: {'[OK]' if ext_ok else '[FAILED]'}")
63
+
64
+
65
+ if __name__ == "__main__":
66
+ asyncio.run(main())