visionhdstream commited on
Commit
8e2eae6
·
verified ·
1 Parent(s): 83f5220

Add PelixPlay HD 16-thread downloader and auto-metadata

Browse files
Files changed (1) hide show
  1. _panel_app.py +17 -18
_panel_app.py CHANGED
@@ -376,26 +376,25 @@ def resolve_pelixplay_hls(tmdb_id, media_type="movie", season=1, episode=1):
376
  if not all_embeds and data.get("embeds"):
377
  all_embeds = {"latino": data["embeds"]}
378
 
379
- # Priorizar español latino -> castellano -> cualquier otro
380
- lang_order = ["latino", "castellano", "es", "subtitulado", "sub"] + list(all_embeds.keys())
381
- chosen_embeds = {}
382
- for l in lang_order:
383
- if l in all_embeds and all_embeds[l]:
384
- chosen_embeds = all_embeds[l]
385
- break
386
-
387
- if not chosen_embeds:
388
- raise RuntimeError("No se encontraron servidores de video activos en PelixPlay para este título.")
389
 
390
- # Recolectar URLs de StreamWish (dohaxe), Morencius y FileLions primero
391
  embed_candidates = []
392
- for prov_key in ["streamwish", "morencius", "filelions", "vidhide"] + list(chosen_embeds.keys()):
393
- urls = chosen_embeds.get(prov_key) or []
394
- if isinstance(urls, str):
395
- urls = [urls]
396
- for u in urls:
397
- if u and u not in embed_candidates:
398
- embed_candidates.append(u)
 
 
 
 
 
399
 
400
  # 1. Intentar desempaquetar directamente desde nuestra IP (HLS4 / HLS3 / HLS2) y verificar segmento 0
401
  for emb_url in embed_candidates:
 
376
  if not all_embeds and data.get("embeds"):
377
  all_embeds = {"latino": data["embeds"]}
378
 
379
+ # Priorizar español latino -> castellano -> cualquier otro, recorriendo todos los servidores (StreamWish, Morencius, FileLions)
380
+ lang_order = []
381
+ for l in ["latino", "castellano", "es", "subtitulado", "sub"] + list(all_embeds.keys()):
382
+ if l not in lang_order and l in all_embeds and all_embeds[l]:
383
+ lang_order.append(l)
 
 
 
 
 
384
 
 
385
  embed_candidates = []
386
+ for l in lang_order:
387
+ lang_embeds = all_embeds.get(l) or {}
388
+ for prov_key in ["streamwish", "morencius", "filelions", "vidhide"] + list(lang_embeds.keys()):
389
+ urls = lang_embeds.get(prov_key) or []
390
+ if isinstance(urls, str):
391
+ urls = [urls]
392
+ for u in urls:
393
+ if u and u not in embed_candidates:
394
+ embed_candidates.append(u)
395
+
396
+ if not embed_candidates:
397
+ raise RuntimeError("No se encontraron servidores de video activos en PelixPlay para este título.")
398
 
399
  # 1. Intentar desempaquetar directamente desde nuestra IP (HLS4 / HLS3 / HLS2) y verificar segmento 0
400
  for emb_url in embed_candidates: