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

[Errno 13] Chrome cookies are not able to be used? Firefox seems fine #4195

Open
zxgbs opened this issue Jun 16, 2023 · 7 comments
Open

[Errno 13] Chrome cookies are not able to be used? Firefox seems fine #4195

zxgbs opened this issue Jun 16, 2023 · 7 comments

Comments

@zxgbs
Copy link

zxgbs commented Jun 16, 2023

I used Chrome cookies and got "Errno 13," but Firefox worked fine.
The command I used and the verbose output:
$ C:/Users/123/AppData/Local/Programs/Python/Python310/Scripts/gallery-dl -d D:/Downloads/gallery-dl -r 2.5M --sleep 2.0-3.5 --sleep-request 2.0-3.5 --filesize-max 22.5M https://fantia.jp/posts/1704263 --verbose --cookies-from-browser chrome
[gallery-dl][debug] Version 1.25.5
[gallery-dl][debug] Python 3.10.6 - Windows-10-10.0.19045-SP0
[gallery-dl][debug] requests 2.25.1 - urllib3 1.26.12
[gallery-dl][debug] Configuration Files ['%USERPROFILE%\gallery-dl.conf']
[gallery-dl][debug] Starting DownloadJob for 'https://fantia.jp/posts/1704263'
[cookies][debug] Extracting cookies from C:\Users\123\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies
[fantia][warning] cookies: [Errno 13] Permission denied: 'C:\Users\123\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies'
[fantia][debug] Using FantiaPostExtractor for 'https://fantia.jp/posts/1704263'
[fantia][warning] no '_session_id' cookie set
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): fantia.jp:443
[urllib3.connectionpool][debug] https://fantia.jp:443 "GET / HTTP/1.1" 200 None
[fantia][debug] Sleeping 3.11 seconds (request)
[urllib3.connectionpool][debug] https://fantia.jp:443 "GET /api/v1/posts/1704263 HTTP/1.1" 200 None

Edit: I'm using Chrome ver. 114.0.5735.134 ; Firefox ver. 110.0.1

@mikf
Copy link
Owner

mikf commented Jun 17, 2023

[Errno 13] Permission denied

Make sure you have permission to access the Chrome profile folder it tries to access. Pass a different profile name or a path to the profile folder if the default is not the one you want, e.g. --cookies-from-browser chrome:PROFILENAME

@zxgbs
Copy link
Author

zxgbs commented Jun 18, 2023

I can access the Chrome folder, and the default cookie database is the only one on this PC.
Do you have any other suggestions? Thanks.

@mikf
Copy link
Owner

mikf commented Jun 18, 2023

Do you get a different behavior with yt-dlp?

yt-dlp --cookies-from-browser chrome BaW_jenozKc

@mikf
Copy link
Owner

mikf commented Jun 18, 2023

This appears to be a recent Chrome "feature": yt-dlp/yt-dlp#7271, yt-dlp/yt-dlp#7290

@zxgbs
Copy link
Author

zxgbs commented Jun 19, 2023

oh I was just trying to figure out how yt-dlp works, the two links seems interesting

@atefalvi
Copy link

I have used Edge instead of chrome and it seems to be working.

@shinji257
Copy link
Contributor

shinji257 commented Sep 25, 2023

You can add --disable-features=LockProfileCookieDatabase to the shortcut for Chrome/Brave/Edge for the time being until they decide to depreciate it.

As suggested in referenced bug reports this appears to be a performance improvement patch rather than anything to do with blocking external cookie access.

Edit: There is a module called shadowcopy that can workaround this issue by getting it from VSS on Windows. The issue is that you have to grant admin rights to the application for them to be able to do so. That was suggested to yt-dlp and it works when the file is locked.

https://pypi.org/project/shadowcopy/

mikf added a commit that referenced this issue Oct 13, 2023
bypasses the need to copy the entire database file
might solve #4195
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants