eses 1.0.4__py3-none-any.whl → 1.0.5__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 +91 -61
- eses/version.py +1 -1
- {eses-1.0.4.dist-info → eses-1.0.5.dist-info}/METADATA +1 -1
- eses-1.0.5.dist-info/RECORD +7 -0
- eses-1.0.4.dist-info/RECORD +0 -7
- {eses-1.0.4.dist-info → eses-1.0.5.dist-info}/WHEEL +0 -0
- {eses-1.0.4.dist-info → eses-1.0.5.dist-info}/licenses/LICENSE +0 -0
- {eses-1.0.4.dist-info → eses-1.0.5.dist-info}/top_level.txt +0 -0
eses/__init__.py
CHANGED
@@ -1,25 +1,51 @@
|
|
1
1
|
import requests
|
2
2
|
import time
|
3
3
|
import threading
|
4
|
-
from
|
4
|
+
from datetime import datetime
|
5
|
+
from typing import List, Optional, Dict, Any
|
5
6
|
|
7
|
+
# API Configuration
|
6
8
|
api_url = "http://52.24.104.170:8086/RestSimulator"
|
7
|
-
proxies = []
|
9
|
+
proxies: List[str] = []
|
8
10
|
proxy_lock = threading.Lock()
|
9
|
-
active_threads = []
|
11
|
+
active_threads: List[threading.Thread] = []
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
+
# Debug Utilities
|
14
|
+
def _print_debug(msg: str) -> None:
|
15
|
+
"""Print debug messages with timestamps"""
|
16
|
+
timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3]
|
17
|
+
print(f"[{timestamp}] {msg}")
|
18
|
+
|
19
|
+
# Core Functions
|
20
|
+
def addproxy(proxy: str) -> None:
|
21
|
+
"""Add a proxy to the rotation pool"""
|
13
22
|
if not proxy.startswith(('http://', 'https://')):
|
14
23
|
proxy = f"http://{proxy}"
|
24
|
+
|
15
25
|
with proxy_lock:
|
16
26
|
if proxy not in proxies:
|
17
27
|
proxies.append(proxy)
|
18
|
-
|
28
|
+
_print_debug(f"Proxy added: {proxy}")
|
29
|
+
else:
|
30
|
+
_print_debug(f"Proxy already exists: {proxy}")
|
31
|
+
|
32
|
+
def clear_proxies() -> None:
|
33
|
+
"""Clear all registered proxies"""
|
34
|
+
with proxy_lock:
|
35
|
+
proxies.clear()
|
36
|
+
_print_debug("All proxies cleared")
|
19
37
|
|
20
|
-
def donate(
|
21
|
-
|
22
|
-
|
38
|
+
def donate(
|
39
|
+
company_name: str,
|
40
|
+
country: str,
|
41
|
+
war_id: str,
|
42
|
+
donation_sum: str = "100000000000",
|
43
|
+
proxy: Optional[str] = None
|
44
|
+
) -> Optional[Dict[str, Any]]:
|
45
|
+
"""
|
46
|
+
Send a single donation request
|
47
|
+
Returns: JSON response if successful, None otherwise
|
48
|
+
"""
|
23
49
|
params = {
|
24
50
|
"Operation": "postDonation",
|
25
51
|
"available_patriotism": "0",
|
@@ -33,74 +59,78 @@ def donate(company_name: str, country: str, war_id: str,
|
|
33
59
|
"version_code": "22",
|
34
60
|
"war_id": war_id
|
35
61
|
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
"Accept-Encoding": "gzip",
|
41
|
-
"Content-Length": "0"
|
42
|
-
}
|
62
|
+
|
63
|
+
proxy_display = proxy or "DIRECT"
|
64
|
+
_print_debug(f"Starting donation: {company_name} via {proxy_display}")
|
65
|
+
|
43
66
|
try:
|
67
|
+
start_time = time.time()
|
44
68
|
response = requests.post(
|
45
69
|
api_url,
|
46
70
|
params=params,
|
47
|
-
headers=
|
71
|
+
headers={"Content-Length": "0"},
|
48
72
|
proxies={"http": proxy, "https": proxy} if proxy else None,
|
49
73
|
timeout=10
|
50
74
|
)
|
51
|
-
|
75
|
+
elapsed_ms = int((time.time() - start_time) * 1000)
|
76
|
+
|
77
|
+
_print_debug(f"Success ({response.status_code}) in {elapsed_ms}ms")
|
78
|
+
_print_debug(f"Response: {response.text[:200]}")
|
52
79
|
return response.json()
|
53
80
|
except Exception as e:
|
54
|
-
|
81
|
+
_print_debug(f"Failed via {proxy_display}: {str(e)}")
|
55
82
|
return None
|
56
83
|
|
57
|
-
def
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
donate(company_name, country, war_id)
|
65
|
-
time.sleep(delay)
|
66
|
-
continue
|
67
|
-
|
68
|
-
# Use all proxies in sequence
|
69
|
-
for proxy in proxies:
|
70
|
-
for _ in range(times):
|
71
|
-
donate(company_name, country, war_id, proxy=proxy)
|
72
|
-
|
73
|
-
# Delay after full cycle
|
74
|
-
time.sleep(delay)
|
75
|
-
|
76
|
-
def donatewithproxy(company_name: str, country: str, war_id: str, times: int = 1, delay: int = 0):
|
84
|
+
def donatewithproxy(
|
85
|
+
company_name: str,
|
86
|
+
country: str,
|
87
|
+
war_id: str,
|
88
|
+
times: int = 1,
|
89
|
+
delay: int = 0
|
90
|
+
) -> None:
|
77
91
|
"""
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
Example:
|
84
|
-
donatewithproxy("Blackrock", "India", "2382", times=3, delay=20)
|
92
|
+
Start automated donations with proxy rotation
|
93
|
+
Args:
|
94
|
+
times: Requests per proxy per cycle
|
95
|
+
delay: Seconds between full cycles
|
85
96
|
"""
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
97
|
+
def _worker():
|
98
|
+
cycle = 0
|
99
|
+
while True:
|
100
|
+
cycle += 1
|
101
|
+
_print_debug(f"=== START CYCLE {cycle} ===")
|
102
|
+
|
103
|
+
# Get current proxy list (thread-safe)
|
104
|
+
with proxy_lock:
|
105
|
+
current_proxies = proxies.copy() or [None] # None means direct connection
|
106
|
+
|
107
|
+
# Process each proxy
|
108
|
+
for proxy in current_proxies:
|
109
|
+
for attempt in range(1, times + 1):
|
110
|
+
_print_debug(f"Attempt {attempt}/{times} via {proxy or 'DIRECT'}")
|
111
|
+
donate(company_name, country, war_id, proxy=proxy)
|
112
|
+
|
113
|
+
# Cycle complete
|
114
|
+
_print_debug(f"Cycle {cycle} complete. Waiting {delay}s...")
|
115
|
+
time.sleep(delay)
|
116
|
+
|
117
|
+
thread = threading.Thread(target=_worker, daemon=True)
|
91
118
|
thread.start()
|
92
119
|
active_threads.append(thread)
|
93
|
-
|
120
|
+
_print_debug(f"Started donation thread (ID: {thread.ident})")
|
94
121
|
|
95
|
-
def
|
96
|
-
"""
|
97
|
-
with proxy_lock:
|
98
|
-
proxies.clear()
|
99
|
-
print("Proxies cleared")
|
100
|
-
|
101
|
-
def stop_all_donations():
|
102
|
-
"""Stop all active donation threads"""
|
122
|
+
def stop_all_donations() -> None:
|
123
|
+
"""Gracefully stop all active donation threads"""
|
103
124
|
for thread in active_threads:
|
104
125
|
thread.join(timeout=1)
|
105
126
|
active_threads.clear()
|
106
|
-
|
127
|
+
_print_debug("All donation threads stopped")
|
128
|
+
|
129
|
+
# Make functions available at package level
|
130
|
+
__all__ = [
|
131
|
+
'addproxy',
|
132
|
+
'clear_proxies',
|
133
|
+
'donate',
|
134
|
+
'donatewithproxy',
|
135
|
+
'stop_all_donations'
|
136
|
+
]
|
eses/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "1.0.
|
1
|
+
__version__ = "1.0.5
|
@@ -0,0 +1,7 @@
|
|
1
|
+
eses/__init__.py,sha256=tPweWqPFegOItVtG_fCcBfF2AeeiZHHe3fwkTHfQx1g,4223
|
2
|
+
eses/version.py,sha256=e8JJ4MdiO15dQqeUEMek04s0R9lqLAAtJnt0wdJmUf8,20
|
3
|
+
eses-1.0.5.dist-info/licenses/LICENSE,sha256=aG4OK9mj5S-wNkDBtWV4cDftgrzOM901qqYwlGF2Q2U,1085
|
4
|
+
eses-1.0.5.dist-info/METADATA,sha256=ArCgEkeg4BJvB3x7bv_IfnyRp3F8J7YcC2b3opHHoUg,667
|
5
|
+
eses-1.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
+
eses-1.0.5.dist-info/top_level.txt,sha256=bhF_PMTvXEr3zbQtvND1twvnv1MQUq2hcn8kREYmePw,5
|
7
|
+
eses-1.0.5.dist-info/RECORD,,
|
eses-1.0.4.dist-info/RECORD
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
eses/__init__.py,sha256=rZmYeCdHswp8Bv91vIaIAS9SWmkxNPjIGQ0xtdrU6S0,3486
|
2
|
-
eses/version.py,sha256=O-a1T6uLdX0DYXelAnzqY4NDGktopbWdpKZloec7oxY,21
|
3
|
-
eses-1.0.4.dist-info/licenses/LICENSE,sha256=aG4OK9mj5S-wNkDBtWV4cDftgrzOM901qqYwlGF2Q2U,1085
|
4
|
-
eses-1.0.4.dist-info/METADATA,sha256=UFYIqKkt2CweTYfmgI-YaNC-q0N_2gj_lXttJPXrS-8,667
|
5
|
-
eses-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
-
eses-1.0.4.dist-info/top_level.txt,sha256=bhF_PMTvXEr3zbQtvND1twvnv1MQUq2hcn8kREYmePw,5
|
7
|
-
eses-1.0.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|