From 43de09ad97874929fcc44d442444938587202347 Mon Sep 17 00:00:00 2001 From: evgeniy_t Date: Mon, 3 Feb 2025 14:18:40 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20test.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test.py b/test.py index b2181e3..85fa01d 100644 --- a/test.py +++ b/test.py @@ -34,7 +34,12 @@ def download_video(url): return if url in failed_downloads: print(f"Video {url} previously failed. Retrying.") - + + # Проверяем, существует ли актуальный файл cookies + if not os.path.exists(cookies_file): + print("ERROR: Cookies file is missing. Stopping execution.") + exit(1) + start_time = datetime.now() try: command = [ @@ -44,7 +49,7 @@ def download_video(url): "--cache-dir", cache_dir, "--ffmpeg-location", ffmpeg_location, "--format", formats, - "--cookies", cookies_file, + "--cookies", cookies_file, # Используем всегда актуальный файл cookies "--output", output_template, "--output", output_infojson, "--ignore-config", @@ -62,7 +67,7 @@ def download_video(url): print(f"ERROR VIDEO {url}: {error_message}") if "This video has been removed" in error_message or "Video unavailable" in error_message: save_downloaded_url(failed_downloads_file, url) - if "Sign in to confirm youre not a bot" in error_message: + if "Sign in to confirm you’re not a bot" in error_message: print("Critical error detected: Sign-in required. Stopping execution.") exit(1)