From f724e537cc13a3741f154d8aa4462bff5af71b80 Mon Sep 17 00:00:00 2001 From: "juancarlos.cavero" Date: Fri, 19 Dec 2025 21:46:10 +0100 Subject: [PATCH] fix yt-dlp error in prod --- main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.py b/main.py index 90d4dd1..3e96de5 100644 --- a/main.py +++ b/main.py @@ -214,6 +214,9 @@ def download_youtube_video(url, output_dir="."): if is_json: import json try: + # Clean the content: remove backslash escapes which are common in env vars (e.g. \"domain\") + clean_content = clean_content.replace('\\"', '"') + cookies_json = json.loads(clean_content) with open(cookies_path, 'w') as f: f.write("# Netscape HTTP Cookie File\n")