from pathlib import Path import sys import yt_dlp # ensure project root (two levels up: Offliner) is on sys.path so `logic` can be imported project_root = Path(__file__).resolve().parents[2] sys.path.insert(0, str(project_root)) from logic import OfflinerCore url = "https://www.youtube.com/watch?v=HfQ1XIFRbO0" cookiefile = Path(r"c:/Archivos/Proyectos Python/Offliner/cookies3.txt") core = OfflinerCore() opts = core._base_ytdlp_opts(cookiefile) opts.update({"skip_download": True, "format": "best", "noplaylist": True, "check_formats": None}) try: with yt_dlp.YoutubeDL(opts) as ydl: info = ydl.extract_info(url, download=False) print({ "title": info.get("title"), "age_limit": info.get("age_limit"), "formats": len(info.get("formats", [])), }) except Exception as exc: print(type(exc).__name__, exc)