Skip to content

Commit

Permalink
[cookies] Get chrome session cookies with --cookies-from-browser (#…
Browse files Browse the repository at this point in the history
…9747)

Partially addresses #5534
Authored by: StefanLobbenmeier
  • Loading branch information
StefanLobbenmeier committed May 11, 2024
1 parent 31b417e commit f1f1589
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions yt_dlp/cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ def _process_chrome_cookie(decryptor, host_key, name, value, encrypted_value, pa
if value is None:
return is_encrypted, None

# In chrome, session cookies have expires_utc set to 0
# In our cookie-store, cookies that do not expire should have expires set to None
if not expires_utc:
expires_utc = None

return is_encrypted, http.cookiejar.Cookie(
version=0, name=name, value=value, port=None, port_specified=False,
domain=host_key, domain_specified=bool(host_key), domain_initial_dot=host_key.startswith('.'),
Expand Down

0 comments on commit f1f1589

Please sign in to comment.