commit fd06bf8bb7ea74668578e52de707cf8be5796bf8 Author: CREATIVE_tg1 <1+creative_tg1@noreply.localhost> Date: Wed May 27 14:53:11 2026 +0000 Create wiki page 'Session File' diff --git a/Session-File.md b/Session-File.md new file mode 100644 index 0000000..2997dc7 --- /dev/null +++ b/Session-File.md @@ -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