Yaelcode commited on
Commit
2db8067
·
verified ·
1 Parent(s): 0831d2d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -16
app.py CHANGED
@@ -160,19 +160,19 @@ def download_engine(link, task_id):
160
  no_transfer_count = 0
161
  loop_counter = 0
162
 
163
- # 🔴 ZOMBİ KORUMASI V2 (Kesin Çözüm - Sadece Yüzdelere Bakar)
164
- import re
165
- previous_percents = []
166
  stuck_counter = 0
167
 
168
  while True:
169
  time.sleep(5)
170
  output = get_mega_details()
171
  lower_output = output.lower()
 
172
 
173
  # 1. Klasik Limit ve Ban Kontrolü
174
  if "bandwidth quota exceeded" in lower_output or "paused" in lower_output or "retrying" in lower_output:
175
- print("\n🚨 KOTA/IP BAN TESPİT EDİLDİ! Değiştiriliyor...", flush=True)
176
  os.system("pkill mega-get")
177
  if rotate_warp_ip():
178
  safe_mega_reset()
@@ -180,24 +180,26 @@ def download_engine(link, task_id):
180
  time.sleep(60)
181
  break
182
 
183
- # 2. Zombi Koruması (Yüzde Avcısı)
184
- if "active" in lower_output:
185
- # Logun içindeki tüm "%X.XX" rakamlarını cımbızla çeker
186
- current_percents = re.findall(r'(\d+\.\d+)%', output)
187
-
188
- if current_percents and current_percents == previous_percents:
 
189
  stuck_counter += 1
190
- print(f"⚠️ İlerleme Durdu! Yüzdeler sabit kaldı. (Şoka son {6 - stuck_counter} adım)", flush=True)
191
- if stuck_counter >= 6: # 30 Saniye milim ilerlemezse
192
- print("\n🧟 ZOMBİ DOSYA VURULDU! Mega tıkandı, IP'ye şok veriliyor...", flush=True)
193
  os.system("pkill mega-get")
194
  rotate_warp_ip()
195
  safe_mega_reset()
196
  stuck_counter = 0
197
- break
198
  else:
 
199
  stuck_counter = 0
200
- previous_percents = current_percents
201
  else:
202
  stuck_counter = 0
203
 
@@ -217,7 +219,6 @@ def download_engine(link, task_id):
217
  no_transfer_count = 0
218
 
219
  # Terminale Temiz Log Basma
220
- lines = output.split('\n')
221
  for line in lines:
222
  if "TRANSFERRING" in line or "%" in line:
223
  print(f"📊 {line.strip()}", flush=True)
 
160
  no_transfer_count = 0
161
  loop_counter = 0
162
 
163
+ # 🔴 ZOMBİ VE HIZ KORUMASI V3 (Acımasız Mod)
164
+ previous_active_transfers = []
 
165
  stuck_counter = 0
166
 
167
  while True:
168
  time.sleep(5)
169
  output = get_mega_details()
170
  lower_output = output.lower()
171
+ lines = output.split('\n')
172
 
173
  # 1. Klasik Limit ve Ban Kontrolü
174
  if "bandwidth quota exceeded" in lower_output or "paused" in lower_output or "retrying" in lower_output:
175
+ print("\n🚨 KOTA/IP BAN TESPİT EDİLDİ! Tünel Değiştiriliyor...", flush=True)
176
  os.system("pkill mega-get")
177
  if rotate_warp_ip():
178
  safe_mega_reset()
 
180
  time.sleep(60)
181
  break
182
 
183
+ # 2. V3 Zombi ve Hız Koruması (Tamamen Harf ve Rakam Kontrolü)
184
+ # Sadece ACTIVE olan satırları bul ve listele
185
+ current_active_transfers = [line for line in lines if "ACTIVE" in line]
186
+
187
+ if current_active_transfers:
188
+ # Eğer ACTIVE olan indirmeler bir önceki saniyeyle HARFİ HARFİNE aynıysa (Yani 1 KB bile inmediyse veya 100%'de takıldıysa)
189
+ if current_active_transfers == previous_active_transfers:
190
  stuck_counter += 1
191
+ print(f"⚠️ HIZ SIFIR VEYA 100% BUG'I! (Tüneli patlatmaya son {6 - stuck_counter} adım)", flush=True)
192
+ if stuck_counter >= 6: # 30 Saniye tık yoksa acıma
193
+ print("\n💥 SİSTEM TIKANDI! Mega'nın kafasına sıkılıp Tünel değiştiriliyor...", flush=True)
194
  os.system("pkill mega-get")
195
  rotate_warp_ip()
196
  safe_mega_reset()
197
  stuck_counter = 0
198
+ break # Tüneli yeniler ve mega-get'i taze iple tetikler
199
  else:
200
+ # Eğer 1 KB bile indiyse rakam değişeceği için sayacı sıfırla
201
  stuck_counter = 0
202
+ previous_active_transfers = current_active_transfers
203
  else:
204
  stuck_counter = 0
205
 
 
219
  no_transfer_count = 0
220
 
221
  # Terminale Temiz Log Basma
 
222
  for line in lines:
223
  if "TRANSFERRING" in line or "%" in line:
224
  print(f"📊 {line.strip()}", flush=True)