Add PelixPlay HD 16-thread downloader and auto-metadata
Browse files- _panel_app.py +9 -7
_panel_app.py
CHANGED
|
@@ -901,17 +901,17 @@ def download_and_process_vertical_or_ytdlp(job, job_dir):
|
|
| 901 |
job["status"] = f"⬇️ Descargando video {idx}/{total_clips}..."
|
| 902 |
|
| 903 |
if is_ytdlp_url(clip_url):
|
| 904 |
-
# Escudo Anti-403 con
|
| 905 |
client_profiles = [
|
| 906 |
-
(
|
| 907 |
-
(["
|
| 908 |
-
(["
|
|
|
|
| 909 |
]
|
| 910 |
last_yt_err = None
|
| 911 |
for attempt_idx, (clients, fmt_str) in enumerate(client_profiles):
|
| 912 |
if job.get("cancelled"):
|
| 913 |
raise InterruptedError("Proceso detenido por el usuario")
|
| 914 |
-
# Limpiar fragmentos parciales si quedaron de un intento previo
|
| 915 |
for fn in os.listdir(job_dir):
|
| 916 |
if fn.startswith(f"raw_clip_{idx:03d}."):
|
| 917 |
try:
|
|
@@ -919,7 +919,6 @@ def download_and_process_vertical_or_ytdlp(job, job_dir):
|
|
| 919 |
except Exception:
|
| 920 |
pass
|
| 921 |
ydl_opts = {
|
| 922 |
-
"format": fmt_str,
|
| 923 |
"merge_output_format": "mp4",
|
| 924 |
"outtmpl": raw_clip_path,
|
| 925 |
"quiet": True,
|
|
@@ -930,8 +929,11 @@ def download_and_process_vertical_or_ytdlp(job, job_dir):
|
|
| 930 |
"fragment_retries": 10,
|
| 931 |
"concurrent_fragment_downloads": 4,
|
| 932 |
"cachedir": False,
|
| 933 |
-
"extractor_args": {"youtube": {"player_client": clients}},
|
| 934 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 935 |
try:
|
| 936 |
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
| 937 |
ydl.download([clip_url])
|
|
|
|
| 901 |
job["status"] = f"⬇️ Descargando video {idx}/{total_clips}..."
|
| 902 |
|
| 903 |
if is_ytdlp_url(clip_url):
|
| 904 |
+
# Escudo Anti-403 con formatos universales verticales (1080x1920) y múltiples clientes
|
| 905 |
client_profiles = [
|
| 906 |
+
(None, "bv*+ba/b"),
|
| 907 |
+
(["ios", "android_vr", "tv"], "bv*+ba/b"),
|
| 908 |
+
(["tv_embedded", "mweb", "android"], "bv*+ba/b"),
|
| 909 |
+
(None, None),
|
| 910 |
]
|
| 911 |
last_yt_err = None
|
| 912 |
for attempt_idx, (clients, fmt_str) in enumerate(client_profiles):
|
| 913 |
if job.get("cancelled"):
|
| 914 |
raise InterruptedError("Proceso detenido por el usuario")
|
|
|
|
| 915 |
for fn in os.listdir(job_dir):
|
| 916 |
if fn.startswith(f"raw_clip_{idx:03d}."):
|
| 917 |
try:
|
|
|
|
| 919 |
except Exception:
|
| 920 |
pass
|
| 921 |
ydl_opts = {
|
|
|
|
| 922 |
"merge_output_format": "mp4",
|
| 923 |
"outtmpl": raw_clip_path,
|
| 924 |
"quiet": True,
|
|
|
|
| 929 |
"fragment_retries": 10,
|
| 930 |
"concurrent_fragment_downloads": 4,
|
| 931 |
"cachedir": False,
|
|
|
|
| 932 |
}
|
| 933 |
+
if fmt_str:
|
| 934 |
+
ydl_opts["format"] = fmt_str
|
| 935 |
+
if clients:
|
| 936 |
+
ydl_opts["extractor_args"] = {"youtube": {"player_client": clients}}
|
| 937 |
try:
|
| 938 |
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
| 939 |
ydl.download([clip_url])
|