Spaces:
Paused
Paused
Update app.py
Browse files
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
|
| 164 |
-
|
| 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ı (
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
|
|
|
| 189 |
stuck_counter += 1
|
| 190 |
-
print(f"⚠️
|
| 191 |
-
if stuck_counter >= 6: # 30 Saniye
|
| 192 |
-
print("\n
|
| 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 |
-
|
| 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)
|