Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied with Microsoft Edge cookies #2

Open
Dyr-Fenrir opened this issue Aug 6, 2024 · 3 comments
Open

Permission denied with Microsoft Edge cookies #2

Dyr-Fenrir opened this issue Aug 6, 2024 · 3 comments

Comments

@Dyr-Fenrir
Copy link

Dyr-Fenrir commented Aug 6, 2024

Greetings,

The following issue started yesterday:

Extracting cookies from edge
[debug] Extracting cookies from: "C:\Users\CENSORED\AppData\Local\Microsoft\Edge\User Data\Default\Network\Cookies"
[debug] Found local state file at "C:\Users\CENSORED\AppData\Local\Microsoft\Edge\User Data\Local State"
Attempting to unlock cookies
Traceback (most recent call last):
  File "C:\Users\CENSORED\AppData\Roaming\yt-dlp\plugins\yt-dlp-ChromeCookieUnlock\yt_dlp_plugins\postprocessor\chrome_cookie_unlock.py", line 9, in unlock_chrome
    return original_func(database_path, tmpdir)
  File "yt_dlp\cookies.py", line 1071, in _open_database_copy
  File "shutil.py", line 418, in copy
  File "shutil.py", line 264, in copyfile
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\CENSORED\\AppData\\Local\\Microsoft\\Edge\\User Data\\Default\\Network\\Cookies'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "yt_dlp\__main__.py", line 17, in <module>
  File "yt_dlp\__init__.py", line 1081, in main
  File "yt_dlp\__init__.py", line 979, in _real_main
  File "yt_dlp\YoutubeDL.py", line 720, in __init__
  File "yt_dlp\YoutubeDL.py", line 4070, in print_debug_header
  File "functools.py", line 967, in __get__
  File "yt_dlp\YoutubeDL.py", line 4245, in _request_director
  File "yt_dlp\YoutubeDL.py", line 4220, in build_request_director
  File "functools.py", line 967, in __get__
  File "yt_dlp\YoutubeDL.py", line 4116, in cookiejar
  File "yt_dlp\cookies.py", line 94, in load_cookies
  File "yt_dlp\cookies.py", line 115, in extract_cookies_from_browser
  File "yt_dlp\cookies.py", line 302, in _extract_chrome_cookies
  File "C:\Users\CENSORED\AppData\Roaming\yt-dlp\plugins\yt-dlp-ChromeCookieUnlock\yt_dlp_plugins\postprocessor\chrome_cookie_unlock.py", line 12, in unlock_chrome
    unlock_cookies(database_path)
  File "C:\Users\CENSORED\AppData\Roaming\yt-dlp\plugins\yt-dlp-ChromeCookieUnlock\yt_dlp_plugins\postprocessor\chrome_cookie_unlock.py", line 63, in unlock_cookies
    raise RuntimeError(f"RmShutdown returned non-successful result: {result}")
RuntimeError: RmShutdown returned non-successful result: 351
[61952] Failed to execute script '__main__' due to unhandled exception!

It was not doing that last week when I used yt-dlp, is this be a bug or maybe something was updated in Microsoft Edge creating the issue?

May you help me out with this please?

Here are some details that might be useful:

Operating system: Windows 11 (23H2)
Operating system build: 22631.3958

Microsoft Edge version: 127.0.2651.86 (please note that it is doing the same error, even when Edge is closed)

yt-dlp version: 2024.8.1.0
yt-dlp-ChromeCookieUnlock version: v2024.04.29 (redownload it yesterday just to make sure)

Download link used: https://x.com/i/status/1820565525832798518

Just let me know if you need any other information.

@seproDev
Copy link
Owner

seproDev commented Aug 6, 2024

Hmm, I am unable to replicate with Edge 127.0.2651.86. This might be related to: https://security.googleblog.com/2024/07/improving-security-of-chrome-cookies-on.html

@Dyr-Fenrir
Copy link
Author

Greetings,

I am still seeing this after several months, any updates please?

Thank you again for your time and help, greatly appreciated!

@seproDev
Copy link
Owner

seproDev commented Dec 18, 2024

I already left for the holidays and won't be working on anything for the coming weeks.
At the time I couldn't reproduce, I can try again once I am back. However the changes from the above link have been fully roll out, so even if this issue were fixes you would still get DPAPI errors in Edge/Chrome. There is a yt-dlp issue about this.

The new changes would require administrator mode to access cookies, which makes extracting them from within yt-dlp impractical.
One potential solution to this is either make a v2 plugin that uses the chrome debug port, or develop a yt-dlp helper extension alongside a plugin. I'll consider doing that in the new year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants