Repository navigation
Retry without browser cookies after keyring extraction failure - #503
Closed
Linuxuser67 wants to merge 1 commit into
Closed
Linuxuser67 wants to merge 1 commit into
Linuxuser67 wants to merge 1 commit into
Conversation
yt-dlp walks the default keyring collection and aborts with `ERROR: Item does not exist!` when it reaches a stale item path before the valid Brave "Safe Storage" entry. The profile, cookie DB, and Brave key item are readable; the same failure reproduces outside the Flatpak. A Secret Service backend switch (for example oo7 and gnome-keyring) can leave such ghost paths in the collection. Retry the probe once without --cookies-from-browser when extraction fails and no staged handoff jar exists, and latch that state for the session so later previews/downloads do not repeat the broken keyring walk. Extension handoff jars still win; changing the browser preference or restarting clears the latch. If the retry also fails, the error says that browser cookies could not be read and were skipped.
Linuxuser67
force-pushed
the
fix/browser-cookie-keyring-fallback
branch
from
October 21, 2026 06:59
f2d4ff5 to
0caea50
Compare
Owner
Author
|
Closing this: the root cause is a stale keyring item path (a ghost entry left by a Secret Service backend switch), not a Grab code defect. The keyring repair is the fix; the fallback is not needed for the reporter's setup. The branch and analysis remain available if we want graceful degradation later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
With Cookies from Browser = Brave, a manual paste runs yt-dlp with
--cookies-from-browser=brave:<profile>.The profile and cookie DB are readable in the Flatpak, and the
Brave Safe Storagekey item exists, is unlocked, and is readable. The same command fails outside the Flatpak, so the sandbox is not the cause.The failure is in yt-dlp's keyring walk. It iterates the default
logincollection and aborts when it reaches a stale/deleted item path before the valid Brave item. The D-Bus trace:/org/freedesktop/secrets/collection/login/org/freedesktop/secrets/collection/login/1(labelBrave Safe Storage)/org/freedesktop/secrets/collection/login/2→Object does not exist at path …→ top-levelERROR: Item does not exist!A Secret Service backend switch (for example oo7 ↔ gnome-keyring) can leave such ghost paths in the collection. Reverting the backend does not necessarily rebuild the item list; the stale path keeps breaking yt-dlp before it reaches the valid Brave entry.
Fix
--cookies-from-browserand no staged handoff jar, retry the probe once without that flag.This does not repair the keyring. Direct browser-cookie extraction stays blocked until the collection is rebuilt; the extension is the reliable authenticated path. The fallback makes public previews usable and prevents the failed keyring walk from blocking them.
Tests
--cookiesjar is preserved) and for dropping only the browser-cookie flag.Item does not exist!; the retry drops the flag, succeeds, and latches the session.CI run: https://github.com/Linuxuser67/Grab/actions/runs/39558894514 (pending;
auditwaits on #504).The
auditjob is red only because of the two base-wide advisories addressed by the separate #504 lockfile PR. Merge #504 first, then rebase this PR.Verification for the user
After this merges and a beta.6 Flatpak is attached:
logincollection is rebuilt) is what restores direct browser-cookie extraction. If an authenticated/private URL still fails after the no-cookie retry, use the extension.