Skip to content

session.http: add --http-cookies-file#6796

Merged
bastimeyer merged 2 commits intostreamlink:masterfrom
bastimeyer:session/http/cookies-file
Jan 26, 2026
Merged

session.http: add --http-cookies-file#6796
bastimeyer merged 2 commits intostreamlink:masterfrom
bastimeyer:session/http/cookies-file

Conversation

@bastimeyer
Copy link
Copy Markdown
Member

Resolves #3370

This implements --http-cookies-file, which can be set multiple times.

The supported format is the Netscape HTTP Cookie File format which is also used by curl for example. This is implemented via the stdlib's http.cookiejar.MozillaCookieJar.
https://docs.python.org/3/library/http.cookiejar.html#http.cookiejar.MozillaCookieJar

I intentionally avoided cookiejar in the CLI argument name, to avoid confusion with curl's --cookie-jar option where data is written to after running curl. Curl treats --cookie special when no = is found and then interprets the value as a file path. We instead use a separate parameter for this.

This adds the `--http-cookies-file` CLI argument
and respective `http-cookies-files` Streamlink session option
for parsing Netscape HTTP Cookie File data from the specified paths,
so users can define HTTP cookie data with additional cookie attributes,
which is not possible via the existing --http-cookie implementation.
@bastimeyer bastimeyer merged commit b810c29 into streamlink:master Jan 26, 2026
25 checks passed
@bastimeyer bastimeyer deleted the session/http/cookies-file branch January 26, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Cookies.txt

1 participant