From fa16dc5241ac1552074feee48e1c2605dc36d352 Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Sun, 7 Dec 2025 17:20:02 -0600 Subject: [PATCH] [cookies] Fix `--cookies-from-browser` for new installs of Firefox 147+ (#15215) Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=259356 Authored by: bashonly, mbway Co-authored-by: Matthew Broadway --- yt_dlp/cookies.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/yt_dlp/cookies.py b/yt_dlp/cookies.py index 5f7db7f386..23f90d6109 100644 --- a/yt_dlp/cookies.py +++ b/yt_dlp/cookies.py @@ -212,9 +212,16 @@ def _firefox_browser_dirs(): else: yield from map(os.path.expanduser, ( + # New installations of FF147+ respect the XDG base directory specification + # Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=259356 + os.path.join(_config_home(), 'mozilla/firefox'), + # Existing FF version<=146 installations '~/.mozilla/firefox', - '~/snap/firefox/common/.mozilla/firefox', + # Flatpak XDG: https://docs.flatpak.org/en/latest/conventions.html#xdg-base-directories + '~/.var/app/org.mozilla.firefox/config/mozilla/firefox', '~/.var/app/org.mozilla.firefox/.mozilla/firefox', + # Snap installations do not respect the XDG base directory specification + '~/snap/firefox/common/.mozilla/firefox', ))