From 4004b0438159f742f555c95222a1bacd4363d9c0 Mon Sep 17 00:00:00 2001 From: CREATIVE_tg1 <1+creative_tg1@noreply.localhost> Date: Wed, 27 May 2026 14:56:05 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20Session=20File=20wiki=20=D0=BD=D0=B0=20=D1=80=D1=83?= =?UTF-8?q?=D1=81=D1=81=D0=BA=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Session-File.-.md | 57 +++++++++++++++++++++++++++++++++++++++++++++ Session-File.md | 59 ----------------------------------------------- 2 files changed, 57 insertions(+), 59 deletions(-) create mode 100644 Session-File.-.md delete mode 100644 Session-File.md diff --git a/Session-File.-.md b/Session-File.-.md new file mode 100644 index 0000000..e7b67b8 --- /dev/null +++ b/Session-File.-.md @@ -0,0 +1,57 @@ +# Session File + +## Ожидаемый формат + +Проект ожидает Netscape cookie file. + +Каждая cookie-строка должна содержать 7 tab-separated columns. + +Типичный источник: + +- экспорт cookies из авторизованной YouTube-сессии в браузере + +## Что проверяет проект + +До начала скачивания библиотека проверяет: + +- что файл существует +- что формат соответствует Netscape cookie format +- что файл содержит cookies для YouTube или Google +- что в файле достаточно актуальных auth-cookie + +Ключевые cookie-имена: + +- `SID` +- `HSID` +- `SSID` +- `APISID` +- `SAPISID` +- `__Secure-1PSID` +- `__Secure-3PSID` +- `LOGIN_INFO` + +## Результат валидации + +`validate_session_file` возвращает `SessionValidation`, где есть: + +- существует ли файл +- валидна ли структура +- выглядят ли auth-cookie актуальными +- можно ли использовать файл для скачивания +- текстовое сообщение с причиной или результатом проверки + +## Типовые причины отказа + +- неверный путь к файлу +- сломанный Netscape format +- нет cookies для YouTube или Google +- cookies просрочены или неполные + +В этих случаях библиотека выбрасывает `InvalidSessionError` ещё до запуска yt-dlp. + +## Практические рекомендации + +- переэкспортируйте cookies после переавторизации +- храните cookie-файл приватно +- не коммитьте cookies в git +- при auth-проблемах в YouTube сначала обновляйте экспорт cookies diff --git a/Session-File.md b/Session-File.md deleted file mode 100644 index 2997dc7..0000000 --- a/Session-File.md +++ /dev/null @@ -1,59 +0,0 @@ -# Session File - -## Expected format - -The downloader expects a Netscape cookie file. - -Each cookie row must have 7 tab-separated columns. - -Typical source: - -- exported browser cookies from a logged-in YouTube session - -## Validation rules - -Before any download starts, the project checks: - -- the file exists -- the format is valid Netscape cookie format -- the file contains YouTube or Google domain cookies -- enough fresh auth cookies are present - -Important cookie names include: - -- `SID` -- `HSID` -- `SSID` -- `APISID` -- `SAPISID` -- `__Secure-1PSID` -- `__Secure-3PSID` -- `LOGIN_INFO` - -## Validation result - -`validate_session_file` returns `SessionValidation`, which describes: - -- whether the file exists -- whether the structure is valid -- whether the auth cookies look fresh -- whether the file is usable for download -- a human-readable message - -## Failure modes - -Typical failures: - -- file path is wrong -- broken Netscape format -- no YouTube or Google cookies -- cookies are expired or incomplete - -In those cases the downloader raises `InvalidSessionError` before yt-dlp starts. - -## Practical advice - -- re-export cookies after the browser session changes -- keep the file private -- do not commit cookie files to git -- prefer a fresh export if YouTube starts returning auth-related errors