Add PelixPlay HD 16-thread downloader and auto-metadata
Browse files- _panel_app.py +32 -2
_panel_app.py
CHANGED
|
@@ -598,6 +598,11 @@ class CaptchaSession:
|
|
| 598 |
|
| 599 |
t0 = time.time()
|
| 600 |
t_goto = t0 - 4.6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 601 |
auto_clicked_at = None
|
| 602 |
last_clean = 0
|
| 603 |
while time.time() - t0 < 300 and not self.cancelled:
|
|
@@ -610,6 +615,30 @@ class CaptchaSession:
|
|
| 610 |
except Exception:
|
| 611 |
pass
|
| 612 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 613 |
try:
|
| 614 |
srcs = page.evaluate(_CAP_SOURCES_JS)
|
| 615 |
except Exception:
|
|
@@ -631,7 +660,8 @@ class CaptchaSession:
|
|
| 631 |
now = time.time()
|
| 632 |
# Si Google dio el OK pero PowVideo no avanzo solo, mandamos el formulario nosotros
|
| 633 |
if (self._token and self._token != self._submitted_token
|
| 634 |
-
and now - self._token_at >
|
|
|
|
| 635 |
self._submitted_token = self._token
|
| 636 |
try:
|
| 637 |
page.evaluate(_CAP_SUBMIT_JS, self._token)
|
|
@@ -704,7 +734,7 @@ def extract_powvideo_with_user_captcha(emb_url, ua, job):
|
|
| 704 |
job["status"] = "✅ Captcha resuelto, iniciando descarga..."
|
| 705 |
return sess.result
|
| 706 |
if sess.error:
|
| 707 |
-
job["status"] = f"⚠️
|
| 708 |
time.sleep(3)
|
| 709 |
return None
|
| 710 |
|
|
|
|
| 598 |
|
| 599 |
t0 = time.time()
|
| 600 |
t_goto = t0 - 4.6
|
| 601 |
+
retries = 0
|
| 602 |
+
try:
|
| 603 |
+
base_url = page.url
|
| 604 |
+
except Exception:
|
| 605 |
+
base_url = self.emb_url
|
| 606 |
auto_clicked_at = None
|
| 607 |
last_clean = 0
|
| 608 |
while time.time() - t0 < 300 and not self.cancelled:
|
|
|
|
| 615 |
except Exception:
|
| 616 |
pass
|
| 617 |
|
| 618 |
+
try:
|
| 619 |
+
body_txt = page.evaluate("() => (document.body ? document.body.innerText : '').slice(0, 120)")
|
| 620 |
+
except Exception:
|
| 621 |
+
body_txt = ""
|
| 622 |
+
if "retry later" in (body_txt or "").lower():
|
| 623 |
+
retries += 1
|
| 624 |
+
if retries > 3:
|
| 625 |
+
self.error = "PowVideo pidio reintentar mas tarde (limite de intentos)"
|
| 626 |
+
break
|
| 627 |
+
time.sleep(7)
|
| 628 |
+
try:
|
| 629 |
+
page.goto(self.emb_url, referer="https://pelixplay.app/", wait_until="domcontentloaded", timeout=30000)
|
| 630 |
+
time.sleep(1.6)
|
| 631 |
+
page.evaluate("if (typeof letgo === 'function') letgo();")
|
| 632 |
+
time.sleep(3.0)
|
| 633 |
+
base_url = page.url
|
| 634 |
+
except Exception:
|
| 635 |
+
pass
|
| 636 |
+
self._token = None
|
| 637 |
+
self._submitted_token = None
|
| 638 |
+
auto_clicked_at = None
|
| 639 |
+
t_goto = time.time() - 4.6
|
| 640 |
+
continue
|
| 641 |
+
|
| 642 |
try:
|
| 643 |
srcs = page.evaluate(_CAP_SOURCES_JS)
|
| 644 |
except Exception:
|
|
|
|
| 660 |
now = time.time()
|
| 661 |
# Si Google dio el OK pero PowVideo no avanzo solo, mandamos el formulario nosotros
|
| 662 |
if (self._token and self._token != self._submitted_token
|
| 663 |
+
and now - self._token_at > 8.0 and now - t_goto > 7.0
|
| 664 |
+
and page.url == base_url):
|
| 665 |
self._submitted_token = self._token
|
| 666 |
try:
|
| 667 |
page.evaluate(_CAP_SUBMIT_JS, self._token)
|
|
|
|
| 734 |
job["status"] = "✅ Captcha resuelto, iniciando descarga..."
|
| 735 |
return sess.result
|
| 736 |
if sess.error:
|
| 737 |
+
job["status"] = f"⚠️ Falló el captcha de PowVideo: {sess.error}"
|
| 738 |
time.sleep(3)
|
| 739 |
return None
|
| 740 |
|