eses 1.0.5__tar.gz → 1.0.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eses
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: A library for sending donation requests with proxy rotation
5
5
  Author-email: Your Name <your@email.com>
6
6
  Project-URL: Homepage, https://github.com/yourusername/eses
@@ -1,6 +1,7 @@
1
1
  import requests
2
2
  import time
3
3
  import threading
4
+ from concurrent.futures import ThreadPoolExecutor
4
5
  from datetime import datetime
5
6
  from typing import List, Optional, Dict, Any
6
7
 
@@ -86,13 +87,15 @@ def donatewithproxy(
86
87
  country: str,
87
88
  war_id: str,
88
89
  times: int = 1,
89
- delay: int = 0
90
+ delay: int = 0,
91
+ max_workers: int = 10
90
92
  ) -> None:
91
93
  """
92
- Start automated donations with proxy rotation
94
+ Start automated concurrent donations with proxy rotation
93
95
  Args:
94
96
  times: Requests per proxy per cycle
95
97
  delay: Seconds between full cycles
98
+ max_workers: Max concurrent requests (default: 10)
96
99
  """
97
100
  def _worker():
98
101
  cycle = 0
@@ -100,15 +103,32 @@ def donatewithproxy(
100
103
  cycle += 1
101
104
  _print_debug(f"=== START CYCLE {cycle} ===")
102
105
 
103
- # Get current proxy list (thread-safe)
106
+ # Get proxies (thread-safe)
104
107
  with proxy_lock:
105
- current_proxies = proxies.copy() or [None] # None means direct connection
108
+ current_proxies = proxies.copy() or [None]
106
109
 
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)
110
+ # Process all proxies concurrently
111
+ with ThreadPoolExecutor(max_workers=max_workers) as executor:
112
+ # Schedule all requests
113
+ futures = []
114
+ for proxy in current_proxies:
115
+ for _ in range(times):
116
+ futures.append(
117
+ executor.submit(
118
+ donate,
119
+ company_name,
120
+ country,
121
+ war_id,
122
+ proxy=proxy
123
+ )
124
+ )
125
+
126
+ # Wait for completion
127
+ for future in futures:
128
+ try:
129
+ future.result(timeout=30)
130
+ except Exception as e:
131
+ _print_debug(f"Request failed: {str(e)}")
112
132
 
113
133
  # Cycle complete
114
134
  _print_debug(f"Cycle {cycle} complete. Waiting {delay}s...")
@@ -117,7 +137,7 @@ def donatewithproxy(
117
137
  thread = threading.Thread(target=_worker, daemon=True)
118
138
  thread.start()
119
139
  active_threads.append(thread)
120
- _print_debug(f"Started donation thread (ID: {thread.ident})")
140
+ _print_debug(f"Started donation controller (ID: {thread.ident})")
121
141
 
122
142
  def stop_all_donations() -> None:
123
143
  """Gracefully stop all active donation threads"""
@@ -0,0 +1 @@
1
+ __version__ = "1.0.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eses
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: A library for sending donation requests with proxy rotation
5
5
  Author-email: Your Name <your@email.com>
6
6
  Project-URL: Homepage, https://github.com/yourusername/eses
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "eses"
7
- version = "1.0.5" # Must match version.py
7
+ version = "1.0.6"
8
8
  authors = [
9
9
  {name = "Your Name", email = "your@email.com"},
10
10
  ]
@@ -1 +0,0 @@
1
- __version__ = "1.0.5
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes