-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdebug_features.py
More file actions
64 lines (53 loc) · 1.79 KB
/
debug_features.py
File metadata and controls
64 lines (53 loc) · 1.79 KB
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
import sys
import os
import asyncio
import traceback
sys.path.append(os.getcwd())
try:
from src.config.config import ConfigManager
print("Imported ConfigManager")
except ImportError:
print("Failed to import ConfigManager")
traceback.print_exc()
try:
from src.network.proxy_checker import ProxyChecker
print("Imported ProxyChecker")
except ImportError:
print("Failed to import ProxyChecker")
traceback.print_exc()
try:
from src.core.account_checker import AccountValidator
print("Imported AccountValidator")
except ImportError:
print("Failed to import AccountValidator")
traceback.print_exc()
async def test_proxies():
print("\n--- Testing Proxy Checker ---")
try:
cm = ConfigManager()
config = cm.load_config()
print(f"Config loaded. Proxies enabled: {config.proxy.enabled}")
checker = ProxyChecker(config)
print("Initialized ProxyChecker")
results = await checker.check_all(max_concurrent=5)
print(f"Checked {len(results)} proxies")
print(results[0] if results else "No results")
except Exception as e:
print(f"Error in test_proxies: {e}")
traceback.print_exc()
async def test_accounts():
print("\n--- Testing Account Validator ---")
try:
cm = ConfigManager()
config = cm.load_config()
validator = AccountValidator(config)
print("Initialized AccountValidator")
results = await validator.check_all()
print(f"Checked {len(results)} accounts")
print(results[0] if results else "No results")
except Exception as e:
print(f"Error in test_accounts: {e}")
traceback.print_exc()
if __name__ == "__main__":
asyncio.run(test_proxies())
asyncio.run(test_accounts())