CliRemote 1.7.14__tar.gz → 1.8.3__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.
Files changed (47) hide show
  1. {cliremote-1.7.14 → cliremote-1.8.3}/CliRemote.egg-info/PKG-INFO +1 -1
  2. {cliremote-1.7.14 → cliremote-1.8.3}/PKG-INFO +1 -1
  3. {cliremote-1.7.14 → cliremote-1.8.3}/pyproject.toml +1 -1
  4. cliremote-1.8.3/remote/precise_engine.py +19 -0
  5. {cliremote-1.7.14 → cliremote-1.8.3}/remote/spammer.py +5 -32
  6. {cliremote-1.7.14 → cliremote-1.8.3}/setup.py +1 -1
  7. cliremote-1.7.14/remote/precise_engine.py +0 -45
  8. {cliremote-1.7.14 → cliremote-1.8.3}/CliRemote.egg-info/SOURCES.txt +0 -0
  9. {cliremote-1.7.14 → cliremote-1.8.3}/CliRemote.egg-info/dependency_links.txt +0 -0
  10. {cliremote-1.7.14 → cliremote-1.8.3}/CliRemote.egg-info/requires.txt +0 -0
  11. {cliremote-1.7.14 → cliremote-1.8.3}/CliRemote.egg-info/top_level.txt +0 -0
  12. {cliremote-1.7.14 → cliremote-1.8.3}/LICENSE +0 -0
  13. {cliremote-1.7.14 → cliremote-1.8.3}/MANIFEST.in +0 -0
  14. {cliremote-1.7.14 → cliremote-1.8.3}/README.md +0 -0
  15. {cliremote-1.7.14 → cliremote-1.8.3}/remote/__init__.py +0 -0
  16. {cliremote-1.7.14 → cliremote-1.8.3}/remote/account_manager.py +0 -0
  17. {cliremote-1.7.14 → cliremote-1.8.3}/remote/account_viewer.py +0 -0
  18. {cliremote-1.7.14 → cliremote-1.8.3}/remote/admin_manager.py +0 -0
  19. {cliremote-1.7.14 → cliremote-1.8.3}/remote/analytics_manager.py +0 -0
  20. {cliremote-1.7.14 → cliremote-1.8.3}/remote/batch_manager.py +0 -0
  21. {cliremote-1.7.14 → cliremote-1.8.3}/remote/block_manager.py +0 -0
  22. {cliremote-1.7.14 → cliremote-1.8.3}/remote/caption_manager.py +0 -0
  23. {cliremote-1.7.14 → cliremote-1.8.3}/remote/cleaner.py +0 -0
  24. {cliremote-1.7.14 → cliremote-1.8.3}/remote/client_manager.py +0 -0
  25. {cliremote-1.7.14 → cliremote-1.8.3}/remote/client_picker.py +0 -0
  26. {cliremote-1.7.14 → cliremote-1.8.3}/remote/config.py +0 -0
  27. {cliremote-1.7.14 → cliremote-1.8.3}/remote/device_manager.py +0 -0
  28. {cliremote-1.7.14 → cliremote-1.8.3}/remote/file_sender.py +0 -0
  29. {cliremote-1.7.14 → cliremote-1.8.3}/remote/getcode_controller.py +0 -0
  30. {cliremote-1.7.14 → cliremote-1.8.3}/remote/health.py +0 -0
  31. {cliremote-1.7.14 → cliremote-1.8.3}/remote/help_menu.py +0 -0
  32. {cliremote-1.7.14 → cliremote-1.8.3}/remote/init.py +0 -0
  33. {cliremote-1.7.14 → cliremote-1.8.3}/remote/join_controller.py +0 -0
  34. {cliremote-1.7.14 → cliremote-1.8.3}/remote/joiner.py +0 -0
  35. {cliremote-1.7.14 → cliremote-1.8.3}/remote/leave_controller.py +0 -0
  36. {cliremote-1.7.14 → cliremote-1.8.3}/remote/lefter.py +0 -0
  37. {cliremote-1.7.14 → cliremote-1.8.3}/remote/mention_manager.py +0 -0
  38. {cliremote-1.7.14 → cliremote-1.8.3}/remote/profile_info.py +0 -0
  39. {cliremote-1.7.14 → cliremote-1.8.3}/remote/profile_media.py +0 -0
  40. {cliremote-1.7.14 → cliremote-1.8.3}/remote/profile_privacy.py +0 -0
  41. {cliremote-1.7.14 → cliremote-1.8.3}/remote/speed_manager.py +0 -0
  42. {cliremote-1.7.14 → cliremote-1.8.3}/remote/stop_manager.py +0 -0
  43. {cliremote-1.7.14 → cliremote-1.8.3}/remote/text_manager.py +0 -0
  44. {cliremote-1.7.14 → cliremote-1.8.3}/remote/username_manager.py +0 -0
  45. {cliremote-1.7.14 → cliremote-1.8.3}/remote/utils/__init__.py +0 -0
  46. {cliremote-1.7.14 → cliremote-1.8.3}/remote/utils/sqlite_utils.py +0 -0
  47. {cliremote-1.7.14 → cliremote-1.8.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CliRemote
3
- Version: 1.7.14
3
+ Version: 1.8.3
4
4
  Summary: Remote client framework for Telegram automation using Pyrogram
5
5
  Home-page: https://github.com/MohammadAhmadi-R/CliRemote
6
6
  Author: MrAhmadiRad
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CliRemote
3
- Version: 1.7.14
3
+ Version: 1.8.3
4
4
  Summary: Remote client framework for Telegram automation using Pyrogram
5
5
  Home-page: https://github.com/MohammadAhmadi-R/CliRemote
6
6
  Author: MrAhmadiRad
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "CliRemote"
7
- version = "1.7.14"
7
+ version = "1.8.3"
8
8
  description = "Remote client framework for Telegram automation using Pyrogram"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -0,0 +1,19 @@
1
+ # antispam_core/precise_engine.py
2
+ import asyncio, time
3
+
4
+ class PreciseTicker:
5
+ def __init__(self, interval: float):
6
+ self.interval = float(interval)
7
+ self.next_tick = time.perf_counter()
8
+
9
+ async def sleep(self):
10
+ """خواب دقیق بدون drift در زمان"""
11
+ self.next_tick += self.interval
12
+ delay = self.next_tick - time.perf_counter()
13
+ if delay > 0:
14
+ await asyncio.sleep(delay)
15
+ else:
16
+ self.next_tick = time.perf_counter() # ریست در صورت عقب افتادن
17
+
18
+ def reset(self):
19
+ self.next_tick = time.perf_counter()
@@ -30,7 +30,7 @@ if not any(
30
30
  # ============================================================
31
31
  # ✅ پیکربندی ایمن و پارامترهای پیش‌فرض
32
32
  # ============================================================
33
- MAX_RETRIES = 2 # تلاش مجدد حداکثر برای هر ارسال
33
+ MAX_RETRIES = 3 # تلاش مجدد حداکثر برای هر ارسال
34
34
  BASE_BACKOFF = 1.5 # ضریب بک‌آف برای retries (s)
35
35
  FLOOD_COOLDOWN_CAP = 3600 # حداکثر زمان cooldown برای FloodWait (s)
36
36
 
@@ -45,23 +45,6 @@ if not hasattr(client_manager, "client_locks"):
45
45
  # ============================================================
46
46
  # 🧰 توابع کمکی
47
47
  # ============================================================
48
- def is_in_cooldown(phone: str) -> bool:
49
- ts = _account_cooldowns.get(phone)
50
- if not ts:
51
- return False
52
- return ts > asyncio.get_event_loop().time()
53
-
54
- def set_cooldown(phone: str, seconds: float):
55
- resume = asyncio.get_event_loop().time() + seconds
56
- _account_cooldowns[phone] = resume
57
- logger.info(f"{phone}: ⏳ Put on cooldown for {seconds:.1f}s (resume @ {resume:.1f})")
58
-
59
- def clear_expired_cooldowns():
60
- now = asyncio.get_event_loop().time()
61
- expired = [p for p, t in _account_cooldowns.items() if t <= now]
62
- for p in expired:
63
- _account_cooldowns.pop(p, None)
64
- logger.info(f"{p}: ✅ Cooldown expired")
65
48
 
66
49
  async def _attempt_send(cli, acc_phone: str, target: str, text: str):
67
50
  """Try to send once, raising exceptions up to caller to handle specialized behavior."""
@@ -82,10 +65,6 @@ async def safe_send(acc_phone: str, spam_config: dict, text: str, remove_client_
82
65
  بازگشت: True اگر ارسال موفق باشد، False در غیر این صورت.
83
66
  """
84
67
  try:
85
- # اگر اکانت در cooldown است، زود بازگردان False (بدون تلاش)
86
- if is_in_cooldown(acc_phone):
87
- logger.info(f"{acc_phone}: ⚠️ Skipping send because account is in cooldown.")
88
- return False
89
68
 
90
69
  cli = await client_manager.get_or_start_client(acc_phone)
91
70
  if not cli:
@@ -122,8 +101,7 @@ async def safe_send(acc_phone: str, spam_config: dict, text: str, remove_client_
122
101
  wait = e.value if hasattr(e, "value") else getattr(e, "x", 0)
123
102
  # حداقل و حداکثر را منطقی حفظ کن
124
103
  wait = max(1, min(wait, FLOOD_COOLDOWN_CAP))
125
- logger.warning(f"{acc_phone}: ⏰ FloodWait {wait}s (code:{getattr(e, 'value', 'n/a')})")
126
- set_cooldown(acc_phone, wait)
104
+ logger.warning(f"{acc_phone}: ⏰ FloodWait {wait}s (code:{getattr(e, 'value', 'n/a')})")
127
105
  # صبر در این تابع به اندازهٔ wait ضروری نیست — cooldown کافی است.
128
106
  return False
129
107
 
@@ -189,8 +167,7 @@ async def run_spammer(spam_config: dict, get_spam_texts, make_mention_html, remo
189
167
 
190
168
  try:
191
169
  while spam_config.get("run", False):
192
- # cleanup expired cooldowns
193
- clear_expired_cooldowns()
170
+ # cleanup expired cooldowns
194
171
 
195
172
  # refresh active accounts (live snapshot)
196
173
  active_accounts: Set[str] = set(client_manager.get_active_accounts())
@@ -200,12 +177,8 @@ async def run_spammer(spam_config: dict, get_spam_texts, make_mention_html, remo
200
177
  continue
201
178
 
202
179
  # filter out accounts currently in cooldown
203
- acc_list = sorted([a for a in active_accounts if not is_in_cooldown(a)])
204
- if not acc_list:
205
- # همه در cooldown هستند — کمی صبر کن و ادامه بده
206
- logger.info("تمام اکانت‌ها در cooldown هستند؛ کمی صبر می‌کنیم...")
207
- await asyncio.sleep(min(5, base_delay))
208
- continue
180
+ acc_list = sorted([a for a in active_accounts])
181
+
209
182
 
210
183
  texts = get_spam_texts()
211
184
  if not texts:
@@ -5,7 +5,7 @@ with open("README.md", encoding="utf-8") as f:
5
5
 
6
6
  setup(
7
7
  name="CliRemote",
8
- version="1.7.14",
8
+ version="1.8.3",
9
9
  author="MrAhmadiRad",
10
10
  author_email="mohammadahmadirad69@gmail.com",
11
11
  description="A precise, async-safe, Telegram automation core (Python 3.8+)",
@@ -1,45 +0,0 @@
1
- # antispam_core/precise_engine.py
2
- import asyncio
3
- import time
4
-
5
- class PreciseTicker:
6
- """
7
- A drift-free ticker.
8
- Usage:
9
- ticker = PreciseTicker(interval=1.0)
10
- while running:
11
- # do work
12
- await ticker.sleep()
13
- Behavior:
14
- - Ensures interval spacing between wakes without accumulating drift.
15
- - If the work took longer than the interval, it schedules next wake as now + interval
16
- (so it doesn't try to "catch up" by sleeping negative amounts).
17
- - On first use, it sets the baseline relative to time.perf_counter().
18
- """
19
- def __init__(self, interval: float):
20
- if interval <= 0:
21
- raise ValueError("interval must be > 0")
22
- self.interval = float(interval)
23
- self.next_tick = None
24
-
25
- async def sleep(self):
26
- now = time.perf_counter()
27
- if self.next_tick is None:
28
- # first tick: schedule next at now + interval
29
- self.next_tick = now + self.interval
30
-
31
- delay = self.next_tick - now
32
-
33
- if delay > 0:
34
- # normal case: wait remaining time
35
- await asyncio.sleep(delay)
36
- # advance to next slot
37
- self.next_tick += self.interval
38
- else:
39
- # work took longer than interval; reset baseline to now + interval
40
- self.next_tick = now + self.interval
41
- # don't sleep now (we are already late)
42
-
43
- def reset(self):
44
- """Reset baseline so next sleep schedules from current time."""
45
- self.next_tick = None
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes