Обновить Session File wiki на русский
@@ -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
|
||||||
-59
@@ -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
|
|
||||||
Reference in New Issue
Block a user