File size: 1,863 Bytes
453d345 | 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | import asyncio
import logging
import sys
import os
# Add app to path
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
from app.hunter.strategies.github import GitHubStrategy
from app.hunter.strategies.ai import AIStrategy
from app.hunter.extractor import UniversalExtractor
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("manual_verification")
async def verify_github():
print("\n--- Verifying GitHub Strategy ---")
strategy = GitHubStrategy()
urls = await strategy.discover()
print(f"Found {len(urls)} URLs from GitHub")
if urls:
print(f"Sample: {urls[0]}")
return len(urls) > 0
async def verify_ai():
print("\n--- Verifying AI Strategy ---")
strategy = AIStrategy()
urls = await strategy.discover()
print(f"Found {len(urls)} URLs from AI")
if urls:
print(f"Sample: {urls[0]}")
return (
True # AI might fail if no keys or rate limit, but we want to ensure code runs
)
async def verify_extractor():
print("\n--- Verifying Extractor ---")
sample_content = """
Here is a proxy: 1.1.1.1:80
And a vmess: vmess://eyJhZGQiOiIxMjcuMC4wLjEiLCJwb3J0Ijo0NDN9
"""
proxies = UniversalExtractor.extract_proxies(sample_content)
print(f"Extracted {len(proxies)} proxies")
for p in proxies:
print(f"- {p.protocol}://{p.ip}:{p.port}")
return len(proxies) >= 1
async def main():
print("STARTING MANUAL VERIFICATION")
gh_ok = await verify_github()
ai_ok = await verify_ai()
ext_ok = await verify_extractor()
print("\n--- SUMMARY ---")
print(f"GitHub Strategy: {'[OK]' if gh_ok else '[FAILED/Auth]'}")
print(f"AI Strategy: {'[OK]' if ai_ok else '[FAILED/Auth]'}")
print(f"Extractor: {'[OK]' if ext_ok else '[FAILED]'}")
if __name__ == "__main__":
asyncio.run(main())
|