Create wiki page 'Session File'

2026-05-27 14:53:11 +00:00
commit fd06bf8bb7
+59
@@ -0,0 +1,59 @@
# 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