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

[Enchancement] Get cookies directly from web browsers #1606

Closed
Scripter17 opened this issue Jun 8, 2021 · 4 comments
Closed

[Enchancement] Get cookies directly from web browsers #1606

Scripter17 opened this issue Jun 8, 2021 · 4 comments

Comments

@Scripter17
Copy link
Contributor

(I got the idea from this comment in #1276)

There's a pull request on youtube-dl that implements getting cookies directly from the browser. It might be possible to adapt some of the code for gallery-dl to avoid needing to export cookies with a browser extension

It's also worth mentioning that the pull request on ytdl has support for specifying the web browser profile with browser:profilename or browser:path/to/profile

@Hrxn
Copy link
Contributor

Hrxn commented Jun 11, 2021

My immediate reaction here was "Well, cookies are usually stored in encrypted form in the browser..."

But yeah, seems the PR already handles this. And based on the feedback there, seems to work.
Nice idea.

mikf added a commit that referenced this issue May 7, 2022
most of the code is adapted from yt-dlp's implementation
and *should* work the same.
@mikf
Copy link
Owner

mikf commented May 7, 2022

This feature got finally implemented in 6742f3b and should work exactly like it does in yt-dlp.

I've only been able to test this with Firefox and Chromium on Linux, so please let me know if you find bugd on other platforms.

mikf added a commit that referenced this issue May 8, 2022
- fix Popen.communicate() calls
- move and simplify _process_chrome_cookie() code
- remove random print() statement and config dict
@Scripter17
Copy link
Contributor Author

Scripter17 commented May 25, 2022

It doesn't seem to recognize --cookies-from-browser as a CLI option or "cookies":"browser:profile" in the config? --cookies browser:profile also doesn't seem to work

I'm on 1.22.0

Edit: Turns out "cookies": ["browser", "profile dir name", ""] works

@Silejonu
Copy link

@mikf The command-line argument is --cookies-from_browser instead of --cookies-from-browser. Could it be changed to be consistent with the rest of the CLI arguments?

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