eses 1.0.0__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 ADDED
@@ -0,0 +1,187 @@
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/version.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = "1.0.0"
@@ -0,0 +1,15 @@
1
+ Metadata-Version: 2.4
2
+ Name: eses
3
+ Version: 1.0.0
4
+ Summary: A library for sending donations through proxies
5
+ Author-email: entente <your@email.com>
6
+ Project-URL: Homepage, https://github.com/yourusername/eses
7
+ Project-URL: Bug-Tracker, https://github.com/yourusername/eses/issues
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Software Development :: Libraries
13
+ Requires-Python: >=3.7
14
+ Description-Content-Type: text/markdown
15
+ Requires-Dist: requests>=2.25.0
@@ -0,0 +1,6 @@
1
+ eses/__init__.py,sha256=I7BxNQHWFA1D9Aaq6GyVQeIZWEK0iX8dEAJDwsqacbs,5436
2
+ eses/version.py,sha256=Aj77VL1d5Mdku7sgCgKQmPuYavPpAHuZuJcy6bygQZE,21
3
+ eses-1.0.0.dist-info/METADATA,sha256=2Dezt7vC14EO2GqlG7BzndzFTnQhF34jgqiMRzg2K28,629
4
+ eses-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
+ eses-1.0.0.dist-info/top_level.txt,sha256=bhF_PMTvXEr3zbQtvND1twvnv1MQUq2hcn8kREYmePw,5
6
+ eses-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ eses