eses 1.0.0__tar.gz → 1.0.1__tar.gz
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-1.0.0 → eses-1.0.1}/PKG-INFO +3 -6
- eses-1.0.1/eses/__init__.py +108 -0
- eses-1.0.1/eses/version.py +1 -0
- {eses-1.0.0 → eses-1.0.1}/eses.egg-info/PKG-INFO +3 -6
- {eses-1.0.0 → eses-1.0.1}/pyproject.toml +4 -7
- eses-1.0.0/eses/__init__.py +0 -187
- eses-1.0.0/eses/version.py +0 -1
- {eses-1.0.0 → eses-1.0.1}/eses.egg-info/SOURCES.txt +0 -0
- {eses-1.0.0 → eses-1.0.1}/eses.egg-info/dependency_links.txt +0 -0
- {eses-1.0.0 → eses-1.0.1}/eses.egg-info/requires.txt +0 -0
- {eses-1.0.0 → eses-1.0.1}/eses.egg-info/top_level.txt +0 -0
- {eses-1.0.0 → eses-1.0.1}/setup.cfg +0 -0
- {eses-1.0.0 → eses-1.0.1}/tests/test_basic.py +0 -0
@@ -1,15 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: eses
|
3
|
-
Version: 1.0.
|
4
|
-
Summary: A library for sending
|
5
|
-
Author-email:
|
3
|
+
Version: 1.0.1
|
4
|
+
Summary: A library for sending donation requests with proxy rotation
|
5
|
+
Author-email: Your Name <your@email.com>
|
6
6
|
Project-URL: Homepage, https://github.com/yourusername/eses
|
7
|
-
Project-URL: Bug-Tracker, https://github.com/yourusername/eses/issues
|
8
7
|
Classifier: Programming Language :: Python :: 3
|
9
8
|
Classifier: License :: OSI Approved :: MIT License
|
10
9
|
Classifier: Operating System :: OS Independent
|
11
|
-
Classifier: Intended Audience :: Developers
|
12
|
-
Classifier: Topic :: Software Development :: Libraries
|
13
10
|
Requires-Python: >=3.7
|
14
11
|
Description-Content-Type: text/markdown
|
15
12
|
Requires-Dist: requests>=2.25.0
|
@@ -0,0 +1,108 @@
|
|
1
|
+
import requests
|
2
|
+
import time
|
3
|
+
import threading
|
4
|
+
from typing import List, Dict
|
5
|
+
|
6
|
+
# Global state
|
7
|
+
proxies = []
|
8
|
+
running = False
|
9
|
+
rotation_thread = None
|
10
|
+
|
11
|
+
def donate(company_name, country, war_id):
|
12
|
+
"""
|
13
|
+
Send a donation request
|
14
|
+
|
15
|
+
Args:
|
16
|
+
company_name: Your company name (str)
|
17
|
+
country: Country name (str)
|
18
|
+
war_id: War ID (str or int)
|
19
|
+
"""
|
20
|
+
params = {
|
21
|
+
"Operation": "postDonation",
|
22
|
+
"available_patriotism": "0",
|
23
|
+
"company_id": "4456964",
|
24
|
+
"company_name": str(company_name),
|
25
|
+
"country": str(country),
|
26
|
+
"donation_sum": "100000000000",
|
27
|
+
"donation_type": "0",
|
28
|
+
"sender_company_id": "4456964",
|
29
|
+
"user_id": "3CE57CF11AFA43A1ABB7DB10431C2234",
|
30
|
+
"version_code": "22",
|
31
|
+
"war_id": str(war_id)
|
32
|
+
}
|
33
|
+
|
34
|
+
headers = {
|
35
|
+
"Host": "52.24.104.170:8086",
|
36
|
+
"Connection": "Keep-Alive",
|
37
|
+
"User-Agent": "android-async-http",
|
38
|
+
"Accept-Encoding": "gzip",
|
39
|
+
"Content-Length": "0"
|
40
|
+
}
|
41
|
+
|
42
|
+
try:
|
43
|
+
response = requests.get(
|
44
|
+
"http://52.24.104.170:8086/RestSimulator",
|
45
|
+
params=params,
|
46
|
+
headers=headers,
|
47
|
+
timeout=10
|
48
|
+
)
|
49
|
+
return {
|
50
|
+
"status": "success",
|
51
|
+
"status_code": response.status_code,
|
52
|
+
"response": response.text
|
53
|
+
}
|
54
|
+
except Exception as e:
|
55
|
+
return {
|
56
|
+
"status": "error",
|
57
|
+
"error": str(e)
|
58
|
+
}
|
59
|
+
|
60
|
+
def add_proxy(proxy):
|
61
|
+
"""Add a proxy to be used in rotation"""
|
62
|
+
if proxy not in proxies:
|
63
|
+
proxies.append(proxy)
|
64
|
+
|
65
|
+
def proxyrotate(requests_per_proxy, delay_seconds):
|
66
|
+
"""
|
67
|
+
Start rotating through proxies
|
68
|
+
|
69
|
+
Args:
|
70
|
+
requests_per_proxy: How many requests per proxy (int)
|
71
|
+
delay_seconds: Seconds to wait between rotations (int)
|
72
|
+
"""
|
73
|
+
global running, rotation_thread
|
74
|
+
|
75
|
+
if not proxies:
|
76
|
+
raise ValueError("No proxies added. Use add_proxy() first")
|
77
|
+
|
78
|
+
running = True
|
79
|
+
|
80
|
+
def worker():
|
81
|
+
while running:
|
82
|
+
for proxy in proxies:
|
83
|
+
if not running:
|
84
|
+
break
|
85
|
+
|
86
|
+
for _ in range(requests_per_proxy):
|
87
|
+
if not running:
|
88
|
+
break
|
89
|
+
|
90
|
+
# Using hardcoded values as per your example
|
91
|
+
result = donate(company_name, country, war_id)
|
92
|
+
print(f"[{proxy}] Status: {result['status']}")
|
93
|
+
time.sleep(1) # 1 second between requests
|
94
|
+
|
95
|
+
if running and delay_seconds > 0:
|
96
|
+
print(f"Waiting {delay_seconds} seconds...")
|
97
|
+
time.sleep(delay_seconds)
|
98
|
+
|
99
|
+
rotation_thread = threading.Thread(target=worker)
|
100
|
+
rotation_thread.daemon = True
|
101
|
+
rotation_thread.start()
|
102
|
+
|
103
|
+
def stop_rotation():
|
104
|
+
"""Stop the proxy rotation"""
|
105
|
+
global running
|
106
|
+
running = False
|
107
|
+
if rotation_thread:
|
108
|
+
rotation_thread.join()
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "1.0.1"
|
@@ -1,15 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: eses
|
3
|
-
Version: 1.0.
|
4
|
-
Summary: A library for sending
|
5
|
-
Author-email:
|
3
|
+
Version: 1.0.1
|
4
|
+
Summary: A library for sending donation requests with proxy rotation
|
5
|
+
Author-email: Your Name <your@email.com>
|
6
6
|
Project-URL: Homepage, https://github.com/yourusername/eses
|
7
|
-
Project-URL: Bug-Tracker, https://github.com/yourusername/eses/issues
|
8
7
|
Classifier: Programming Language :: Python :: 3
|
9
8
|
Classifier: License :: OSI Approved :: MIT License
|
10
9
|
Classifier: Operating System :: OS Independent
|
11
|
-
Classifier: Intended Audience :: Developers
|
12
|
-
Classifier: Topic :: Software Development :: Libraries
|
13
10
|
Requires-Python: >=3.7
|
14
11
|
Description-Content-Type: text/markdown
|
15
12
|
Requires-Dist: requests>=2.25.0
|
@@ -4,24 +4,21 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "eses"
|
7
|
-
version = "1.0.
|
7
|
+
version = "1.0.1" # Must match version.py
|
8
8
|
authors = [
|
9
|
-
{name = "
|
9
|
+
{name = "Your Name", email = "your@email.com"},
|
10
10
|
]
|
11
|
-
description = "A library for sending
|
11
|
+
description = "A library for sending donation requests with proxy rotation"
|
12
12
|
readme = "README.md"
|
13
13
|
requires-python = ">=3.7"
|
14
14
|
classifiers = [
|
15
15
|
"Programming Language :: Python :: 3",
|
16
16
|
"License :: OSI Approved :: MIT License",
|
17
17
|
"Operating System :: OS Independent",
|
18
|
-
"Intended Audience :: Developers",
|
19
|
-
"Topic :: Software Development :: Libraries",
|
20
18
|
]
|
21
19
|
dependencies = [
|
22
20
|
"requests>=2.25.0",
|
23
21
|
]
|
24
22
|
|
25
23
|
[project.urls]
|
26
|
-
Homepage = "https://github.com/yourusername/eses"
|
27
|
-
Bug-Tracker = "https://github.com/yourusername/eses/issues"
|
24
|
+
Homepage = "https://github.com/yourusername/eses"
|
eses-1.0.0/eses/__init__.py
DELETED
@@ -1,187 +0,0 @@
|
|
1
|
-
import requests
|
2
|
-
import time
|
3
|
-
from itertools import cycle
|
4
|
-
import threading
|
5
|
-
|
6
|
-
# Default configuration
|
7
|
-
api_url = "http://52.24.104.170:8086/RestSimulator"
|
8
|
-
default_params = {
|
9
|
-
"Operation": "postDonation",
|
10
|
-
"available_patriotism": "0",
|
11
|
-
"company_id": "4456964",
|
12
|
-
"donation_sum": "100000000000",
|
13
|
-
"donation_type": "0",
|
14
|
-
"sender_company_id": "4456964",
|
15
|
-
"user_id": "3CE57CF11AFA43A1ABB7DB10431C2234",
|
16
|
-
"version_code": "22"
|
17
|
-
}
|
18
|
-
|
19
|
-
default_headers = {
|
20
|
-
"Host": "52.24.104.170:8086",
|
21
|
-
"Connection": "Keep-Alive",
|
22
|
-
"User-Agent": "android-async-http",
|
23
|
-
"Accept-Encoding": "gzip",
|
24
|
-
"Content-Length": "0"
|
25
|
-
}
|
26
|
-
|
27
|
-
# Proxy management
|
28
|
-
proxies = []
|
29
|
-
proxy_cycle = None
|
30
|
-
running = False
|
31
|
-
rotation_thread = None
|
32
|
-
|
33
|
-
def donate(company_name="EPSAT", country="Bulgaria", war_id="55032"):
|
34
|
-
"""
|
35
|
-
Send a donation request with customizable parameters
|
36
|
-
|
37
|
-
Args:
|
38
|
-
company_name (str): Name of the company (default: "EPSAT")
|
39
|
-
country (str): Country name (default: "Bulgaria")
|
40
|
-
war_id (str): War ID (default: "55032")
|
41
|
-
|
42
|
-
Returns:
|
43
|
-
dict: Dictionary containing status, status_code, and response/error
|
44
|
-
"""
|
45
|
-
params = default_params.copy()
|
46
|
-
params.update({
|
47
|
-
"company_name": company_name,
|
48
|
-
"country": country,
|
49
|
-
"war_id": war_id
|
50
|
-
})
|
51
|
-
|
52
|
-
try:
|
53
|
-
response = requests.get(
|
54
|
-
api_url,
|
55
|
-
params=params,
|
56
|
-
headers=default_headers,
|
57
|
-
timeout=10
|
58
|
-
)
|
59
|
-
return {
|
60
|
-
"status": "success",
|
61
|
-
"status_code": response.status_code,
|
62
|
-
"response": response.text
|
63
|
-
}
|
64
|
-
except Exception as e:
|
65
|
-
return {
|
66
|
-
"status": "error",
|
67
|
-
"error": str(e)
|
68
|
-
}
|
69
|
-
|
70
|
-
def add_proxy(proxy):
|
71
|
-
"""
|
72
|
-
Add a proxy to the proxy list
|
73
|
-
|
74
|
-
Args:
|
75
|
-
proxy (str): Proxy address in format 'http://host:port' or
|
76
|
-
'http://username:password@host:port'
|
77
|
-
"""
|
78
|
-
if proxy not in proxies:
|
79
|
-
proxies.append(proxy)
|
80
|
-
global proxy_cycle
|
81
|
-
proxy_cycle = cycle(proxies)
|
82
|
-
return f"Proxy added: {proxy}"
|
83
|
-
return f"Proxy already exists: {proxy}"
|
84
|
-
|
85
|
-
def clear_proxies():
|
86
|
-
"""Clear all proxies from the proxy list"""
|
87
|
-
global proxies, proxy_cycle
|
88
|
-
proxies = []
|
89
|
-
proxy_cycle = None
|
90
|
-
return "All proxies cleared"
|
91
|
-
|
92
|
-
def proxyrotate(requests_per_proxy=3, delay_between_rotations=20):
|
93
|
-
"""
|
94
|
-
Rotate through proxies making requests
|
95
|
-
|
96
|
-
Args:
|
97
|
-
requests_per_proxy (int): Number of requests to make per proxy (default: 3)
|
98
|
-
delay_between_rotations (int): Seconds to wait between full rotations (default: 20)
|
99
|
-
|
100
|
-
Returns:
|
101
|
-
threading.Thread: The rotation thread object
|
102
|
-
"""
|
103
|
-
global running, proxy_cycle, rotation_thread
|
104
|
-
|
105
|
-
if not proxies:
|
106
|
-
raise ValueError("No proxies available. Add proxies using add_proxy()")
|
107
|
-
|
108
|
-
if proxy_cycle is None:
|
109
|
-
proxy_cycle = cycle(proxies)
|
110
|
-
|
111
|
-
running = True
|
112
|
-
|
113
|
-
def rotation_worker():
|
114
|
-
while running:
|
115
|
-
for proxy in proxies:
|
116
|
-
if not running:
|
117
|
-
break
|
118
|
-
|
119
|
-
proxy_config = {
|
120
|
-
'http': proxy,
|
121
|
-
'https': proxy
|
122
|
-
}
|
123
|
-
|
124
|
-
for i in range(requests_per_proxy):
|
125
|
-
if not running:
|
126
|
-
break
|
127
|
-
|
128
|
-
try:
|
129
|
-
result = donate()
|
130
|
-
print(f"[Proxy: {proxy}] Request {i+1}/{requests_per_proxy}: {result['status']} (Status: {result.get('status_code', 'N/A')})")
|
131
|
-
except Exception as e:
|
132
|
-
print(f"[Proxy: {proxy}] Request {i+1}/{requests_per_proxy} failed: {str(e)}")
|
133
|
-
|
134
|
-
time.sleep(1) # Small delay between requests
|
135
|
-
|
136
|
-
if running:
|
137
|
-
print(f"Rotation complete. Waiting {delay_between_rotations} seconds...")
|
138
|
-
for _ in range(delay_between_rotations):
|
139
|
-
if not running:
|
140
|
-
break
|
141
|
-
time.sleep(1)
|
142
|
-
|
143
|
-
rotation_thread = threading.Thread(target=rotation_worker)
|
144
|
-
rotation_thread.daemon = True
|
145
|
-
rotation_thread.start()
|
146
|
-
return rotation_thread
|
147
|
-
|
148
|
-
def stop_rotation():
|
149
|
-
"""Stop the proxy rotation"""
|
150
|
-
global running
|
151
|
-
running = False
|
152
|
-
if rotation_thread and rotation_thread.is_alive():
|
153
|
-
rotation_thread.join(timeout=2)
|
154
|
-
return "Rotation stopped"
|
155
|
-
|
156
|
-
def get_proxy_list():
|
157
|
-
"""Get the current list of proxies"""
|
158
|
-
return proxies.copy()
|
159
|
-
|
160
|
-
def set_default_param(key, value):
|
161
|
-
"""
|
162
|
-
Set a default parameter value
|
163
|
-
|
164
|
-
Args:
|
165
|
-
key (str): Parameter key
|
166
|
-
value (str): Parameter value
|
167
|
-
"""
|
168
|
-
if key in default_params:
|
169
|
-
default_params[key] = value
|
170
|
-
return f"Updated {key}"
|
171
|
-
else:
|
172
|
-
raise KeyError(f"Invalid parameter key: {key}")
|
173
|
-
|
174
|
-
def set_default_header(key, value):
|
175
|
-
"""
|
176
|
-
Set a default header value
|
177
|
-
|
178
|
-
Args:
|
179
|
-
key (str): Header key
|
180
|
-
value (str): Header value
|
181
|
-
"""
|
182
|
-
default_headers[key] = value
|
183
|
-
return f"Updated {key}"
|
184
|
-
|
185
|
-
# Initialize proxy cycle if proxies exist
|
186
|
-
if proxies:
|
187
|
-
proxy_cycle = cycle(proxies)
|
eses-1.0.0/eses/version.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "1.0.0"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|