eses 1.0.6__py3-none-any.whl → 1.0.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- eses/__init__.py +21 -98
- eses/version.py +1 -1
- {eses-1.0.6.dist-info → eses-1.0.7.dist-info}/METADATA +1 -1
- eses-1.0.7.dist-info/RECORD +7 -0
- eses-1.0.6.dist-info/RECORD +0 -7
- {eses-1.0.6.dist-info → eses-1.0.7.dist-info}/WHEEL +0 -0
- {eses-1.0.6.dist-info → eses-1.0.7.dist-info}/licenses/LICENSE +0 -0
- {eses-1.0.6.dist-info → eses-1.0.7.dist-info}/top_level.txt +0 -0
eses/__init__.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import requests
|
2
2
|
import time
|
3
3
|
import threading
|
4
|
-
from concurrent.futures import ThreadPoolExecutor
|
4
|
+
from concurrent.futures import ThreadPoolExecutor, as_completed
|
5
5
|
from datetime import datetime
|
6
6
|
from typing import List, Optional, Dict, Any
|
7
7
|
|
@@ -13,74 +13,10 @@ active_threads: List[threading.Thread] = []
|
|
13
13
|
|
14
14
|
# Debug Utilities
|
15
15
|
def _print_debug(msg: str) -> None:
|
16
|
-
"""Print debug messages with timestamps"""
|
17
16
|
timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3]
|
18
17
|
print(f"[{timestamp}] {msg}")
|
19
18
|
|
20
|
-
# Core Functions
|
21
|
-
def addproxy(proxy: str) -> None:
|
22
|
-
"""Add a proxy to the rotation pool"""
|
23
|
-
if not proxy.startswith(('http://', 'https://')):
|
24
|
-
proxy = f"http://{proxy}"
|
25
|
-
|
26
|
-
with proxy_lock:
|
27
|
-
if proxy not in proxies:
|
28
|
-
proxies.append(proxy)
|
29
|
-
_print_debug(f"Proxy added: {proxy}")
|
30
|
-
else:
|
31
|
-
_print_debug(f"Proxy already exists: {proxy}")
|
32
|
-
|
33
|
-
def clear_proxies() -> None:
|
34
|
-
"""Clear all registered proxies"""
|
35
|
-
with proxy_lock:
|
36
|
-
proxies.clear()
|
37
|
-
_print_debug("All proxies cleared")
|
38
|
-
|
39
|
-
def donate(
|
40
|
-
company_name: str,
|
41
|
-
country: str,
|
42
|
-
war_id: str,
|
43
|
-
donation_sum: str = "100000000000",
|
44
|
-
proxy: Optional[str] = None
|
45
|
-
) -> Optional[Dict[str, Any]]:
|
46
|
-
"""
|
47
|
-
Send a single donation request
|
48
|
-
Returns: JSON response if successful, None otherwise
|
49
|
-
"""
|
50
|
-
params = {
|
51
|
-
"Operation": "postDonation",
|
52
|
-
"available_patriotism": "0",
|
53
|
-
"company_id": "4456964",
|
54
|
-
"company_name": company_name,
|
55
|
-
"country": country,
|
56
|
-
"donation_sum": donation_sum,
|
57
|
-
"donation_type": "0",
|
58
|
-
"sender_company_id": "4456964",
|
59
|
-
"user_id": "3CE57CF11AFA43A1ABB7DB10431C2234",
|
60
|
-
"version_code": "22",
|
61
|
-
"war_id": war_id
|
62
|
-
}
|
63
|
-
|
64
|
-
proxy_display = proxy or "DIRECT"
|
65
|
-
_print_debug(f"Starting donation: {company_name} via {proxy_display}")
|
66
|
-
|
67
|
-
try:
|
68
|
-
start_time = time.time()
|
69
|
-
response = requests.post(
|
70
|
-
api_url,
|
71
|
-
params=params,
|
72
|
-
headers={"Content-Length": "0"},
|
73
|
-
proxies={"http": proxy, "https": proxy} if proxy else None,
|
74
|
-
timeout=10
|
75
|
-
)
|
76
|
-
elapsed_ms = int((time.time() - start_time) * 1000)
|
77
|
-
|
78
|
-
_print_debug(f"Success ({response.status_code}) in {elapsed_ms}ms")
|
79
|
-
_print_debug(f"Response: {response.text[:200]}")
|
80
|
-
return response.json()
|
81
|
-
except Exception as e:
|
82
|
-
_print_debug(f"Failed via {proxy_display}: {str(e)}")
|
83
|
-
return None
|
19
|
+
# Core Functions (keep all existing functions exactly the same until donatewithproxy)
|
84
20
|
|
85
21
|
def donatewithproxy(
|
86
22
|
company_name: str,
|
@@ -88,28 +24,29 @@ def donatewithproxy(
|
|
88
24
|
war_id: str,
|
89
25
|
times: int = 1,
|
90
26
|
delay: int = 0,
|
91
|
-
max_workers: int =
|
27
|
+
max_workers: int = 50 # High concurrency for fast bursts
|
92
28
|
) -> None:
|
93
29
|
"""
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
30
|
+
Send ALL requests in parallel bursts:
|
31
|
+
1. Send (proxies × times) requests ALL AT ONCE
|
32
|
+
2. Wait for ALL to complete
|
33
|
+
3. Delay
|
34
|
+
4. Repeat
|
99
35
|
"""
|
100
36
|
def _worker():
|
101
37
|
cycle = 0
|
102
38
|
while True:
|
103
39
|
cycle += 1
|
104
|
-
_print_debug(f"===
|
40
|
+
_print_debug(f"=== BURST CYCLE {cycle} ===")
|
105
41
|
|
106
|
-
# Get proxies
|
42
|
+
# Get current proxies
|
107
43
|
with proxy_lock:
|
108
44
|
current_proxies = proxies.copy() or [None]
|
45
|
+
total_requests = len(current_proxies) * times
|
46
|
+
_print_debug(f"Preparing {total_requests} concurrent requests...")
|
109
47
|
|
110
|
-
#
|
48
|
+
# Send ALL requests in parallel
|
111
49
|
with ThreadPoolExecutor(max_workers=max_workers) as executor:
|
112
|
-
# Schedule all requests
|
113
50
|
futures = []
|
114
51
|
for proxy in current_proxies:
|
115
52
|
for _ in range(times):
|
@@ -123,34 +60,20 @@ def donatewithproxy(
|
|
123
60
|
)
|
124
61
|
)
|
125
62
|
|
126
|
-
#
|
127
|
-
for future in futures:
|
63
|
+
# Just wait for ALL to complete (don't process results)
|
64
|
+
for future in as_completed(futures):
|
128
65
|
try:
|
129
66
|
future.result(timeout=30)
|
130
|
-
except
|
131
|
-
|
67
|
+
except:
|
68
|
+
pass # Errors already logged by donate()
|
132
69
|
|
133
|
-
#
|
134
|
-
_print_debug(f"
|
70
|
+
# Burst complete
|
71
|
+
_print_debug(f"Burst {cycle} complete ({total_requests} requests). Waiting {delay}s...")
|
135
72
|
time.sleep(delay)
|
136
73
|
|
137
74
|
thread = threading.Thread(target=_worker, daemon=True)
|
138
75
|
thread.start()
|
139
76
|
active_threads.append(thread)
|
140
|
-
_print_debug(f"Started
|
141
|
-
|
142
|
-
def stop_all_donations() -> None:
|
143
|
-
"""Gracefully stop all active donation threads"""
|
144
|
-
for thread in active_threads:
|
145
|
-
thread.join(timeout=1)
|
146
|
-
active_threads.clear()
|
147
|
-
_print_debug("All donation threads stopped")
|
77
|
+
_print_debug(f"Started burst-mode controller (ID: {thread.ident})")
|
148
78
|
|
149
|
-
#
|
150
|
-
__all__ = [
|
151
|
-
'addproxy',
|
152
|
-
'clear_proxies',
|
153
|
-
'donate',
|
154
|
-
'donatewithproxy',
|
155
|
-
'stop_all_donations'
|
156
|
-
]
|
79
|
+
# Keep all other existing functions EXACTLY THE SAME
|
eses/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "1.0.
|
1
|
+
__version__ = "1.0.7"
|
@@ -0,0 +1,7 @@
|
|
1
|
+
eses/__init__.py,sha256=rgWTvoS0kL1TDFa9JEBAHOnAKe8IoszKZRuVT64dOSM,2771
|
2
|
+
eses/version.py,sha256=98rTj2jvgnCZhTIeHpbml7e2xuhIqt_9BJNSWkWEQb8,21
|
3
|
+
eses-1.0.7.dist-info/licenses/LICENSE,sha256=aG4OK9mj5S-wNkDBtWV4cDftgrzOM901qqYwlGF2Q2U,1085
|
4
|
+
eses-1.0.7.dist-info/METADATA,sha256=KOr56rpLFiXh58DbEUiPY8h2euv3kn8LH48zxTVdYmA,667
|
5
|
+
eses-1.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
+
eses-1.0.7.dist-info/top_level.txt,sha256=bhF_PMTvXEr3zbQtvND1twvnv1MQUq2hcn8kREYmePw,5
|
7
|
+
eses-1.0.7.dist-info/RECORD,,
|
eses-1.0.6.dist-info/RECORD
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
eses/__init__.py,sha256=PeLhnDFbWOqRovn-qaK4YvDfU-Icpd2juHXHQ7WuxUE,4975
|
2
|
-
eses/version.py,sha256=fCDDAyG3nMZcE_hvt1RHdxkiFN3DfNSyU_k-rLUDrpE,21
|
3
|
-
eses-1.0.6.dist-info/licenses/LICENSE,sha256=aG4OK9mj5S-wNkDBtWV4cDftgrzOM901qqYwlGF2Q2U,1085
|
4
|
-
eses-1.0.6.dist-info/METADATA,sha256=7COZDlfSMlu7GuFdkYghkJzAJ246dn3JYiiGUOoGYLk,667
|
5
|
-
eses-1.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
-
eses-1.0.6.dist-info/top_level.txt,sha256=bhF_PMTvXEr3zbQtvND1twvnv1MQUq2hcn8kREYmePw,5
|
7
|
-
eses-1.0.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|