eses 1.0.0__py3-none-any.whl → 1.0.1__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 CHANGED
@@ -1,59 +1,49 @@
1
1
  import requests
2
2
  import time
3
- from itertools import cycle
4
3
  import threading
4
+ from typing import List, Dict
5
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
6
+ # Global state
28
7
  proxies = []
29
- proxy_cycle = None
30
8
  running = False
31
9
  rotation_thread = None
32
10
 
33
- def donate(company_name="EPSAT", country="Bulgaria", war_id="55032"):
11
+ def donate(company_name, country, war_id):
34
12
  """
35
- Send a donation request with customizable parameters
13
+ Send a donation request
36
14
 
37
15
  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
16
+ company_name: Your company name (str)
17
+ country: Country name (str)
18
+ war_id: War ID (str or int)
44
19
  """
45
- params = default_params.copy()
46
- params.update({
47
- "company_name": company_name,
48
- "country": country,
49
- "war_id": war_id
50
- })
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
+ }
51
41
 
52
42
  try:
53
43
  response = requests.get(
54
- api_url,
44
+ "http://52.24.104.170:8086/RestSimulator",
55
45
  params=params,
56
- headers=default_headers,
46
+ headers=headers,
57
47
  timeout=10
58
48
  )
59
49
  return {
@@ -68,120 +58,51 @@ def donate(company_name="EPSAT", country="Bulgaria", war_id="55032"):
68
58
  }
69
59
 
70
60
  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
- """
61
+ """Add a proxy to be used in rotation"""
78
62
  if proxy not in proxies:
79
63
  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
64
 
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):
65
+ def proxyrotate(requests_per_proxy, delay_seconds):
93
66
  """
94
- Rotate through proxies making requests
67
+ Start rotating through proxies
95
68
 
96
69
  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
70
+ requests_per_proxy: How many requests per proxy (int)
71
+ delay_seconds: Seconds to wait between rotations (int)
102
72
  """
103
- global running, proxy_cycle, rotation_thread
73
+ global running, rotation_thread
104
74
 
105
75
  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)
76
+ raise ValueError("No proxies added. Use add_proxy() first")
110
77
 
111
78
  running = True
112
79
 
113
- def rotation_worker():
80
+ def worker():
114
81
  while running:
115
82
  for proxy in proxies:
116
83
  if not running:
117
84
  break
118
85
 
119
- proxy_config = {
120
- 'http': proxy,
121
- 'https': proxy
122
- }
123
-
124
- for i in range(requests_per_proxy):
86
+ for _ in range(requests_per_proxy):
125
87
  if not running:
126
88
  break
127
89
 
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
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
135
94
 
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)
95
+ if running and delay_seconds > 0:
96
+ print(f"Waiting {delay_seconds} seconds...")
97
+ time.sleep(delay_seconds)
142
98
 
143
- rotation_thread = threading.Thread(target=rotation_worker)
99
+ rotation_thread = threading.Thread(target=worker)
144
100
  rotation_thread.daemon = True
145
101
  rotation_thread.start()
146
- return rotation_thread
147
102
 
148
103
  def stop_rotation():
149
104
  """Stop the proxy rotation"""
150
105
  global running
151
106
  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)
107
+ if rotation_thread:
108
+ rotation_thread.join()
eses/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.0.0"
1
+ __version__ = "1.0.1"
@@ -1,15 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eses
3
- Version: 1.0.0
4
- Summary: A library for sending donations through proxies
5
- Author-email: entente <your@email.com>
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,6 @@
1
+ eses/__init__.py,sha256=Ohd-bCi4A2QGP2GwmpIjO2171aI2K9_fZlsbOISvqXo,3073
2
+ eses/version.py,sha256=x7SWnx8ho-VaDHLtK75ItIuboJ9SpcR_vy2GvXNmU4A,21
3
+ eses-1.0.1.dist-info/METADATA,sha256=rhYXygKbgSIH61bFxYY8DqLVWSfUUpvMDhW88bocxNk,471
4
+ eses-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
+ eses-1.0.1.dist-info/top_level.txt,sha256=bhF_PMTvXEr3zbQtvND1twvnv1MQUq2hcn8kREYmePw,5
6
+ eses-1.0.1.dist-info/RECORD,,
@@ -1,6 +0,0 @@
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,,
File without changes