-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
CLI defaults prevent getting chromium cookies from alternative installation methods (like snaps) #65
Comments
Thanks for bringing these to my attention
Actually, the CLI tool you're using is brand new and doesn't yet have an argument for this. For alternative installations like snaps, I think what you're looking for is the You should be able to run it as something like This does seem like a useful flag to support in the CLI though! |
It's a great tool! I'm not sure I would've tried to automate my VPN connection shell script if I couldn't have played a bit with I agree that a command-line argument --cookie-file would solve this. I'm also torn between the competing design principles of "thing should just work out of the box" and "in the face of ambiguity refuse the temptation to guess". Maybe the best solution (for the user) would be to have a list of common file locations and if you find multiple of those exist, print the possible --cookie-file arguments and let the user pick one. Maybe mention which one has the freshest mtime. (This is a suggestion for the command-line tool, not the library API. A stretch goal perhaps. I might be tempted to create a PR if you think it would be a good idea.) |
True, though to be fair pipx is just doing those steps for you $ ls -l ~/.local/pipx/venvs/ | head -5
total 0
drwxr-xr-x 7 n8henrie staff 224 Apr 23 12:22 cibuildwheel
drwxr-xr-x 7 n8henrie staff 224 Apr 23 12:23 cookiecutter
drwxr-xr-x 7 n8henrie staff 224 Apr 23 12:23 gunicorn
drwxr-xr-x 7 n8henrie staff 224 Apr 23 12:23 httpx
A PR would be appreciated if you have time and energy. I would expect it to "work out of the box" if only to mirror the behavior of the library, which assumes the standard system install location (at least historically has been for ubuntu / debian / arch based systems installed with the system package manager): pycookiecheat/src/pycookiecheat/chrome.py Line 161 in ab4937f
I think adding a |
Unfortunately I realized that I can do $ mv ~/.config/chromium ~/.config/chromium.before-snap
$ ln -sr ~/snap/chromium/common/chromium ~/.config/chromium and now |
Resolved with #74 |
pipx run pycookiecheat --version
doesn't understand the --version argument.My Issue
I run
pycookiecheat -u ... -b chromium
and it prints{}
.Looking at the source code, I see that it hardcodes the cookie file path as being in ~/.config/chromium/Default/Cookies, which is wrong for the snap package that Ubuntu promotes. The actual cookies live in ~/snap/chromium/common/chromium/Default/Cookies (which I've verified by loading it in
sqlite3
and looking at the tantalizing encrypted_value).I imagine Firefox would have the same issue (snap package stores cookies in
~/snap/firefox/common/.mozilla/firefox/
.WHYT
(the link redirects me to https://mattgemmell.scot/books/ which doesn't seem pertinent, so I'll try to answer the "what have you tried" literally)
pipx run pycookiecheat -u MYURL
pipx run pycookiecheat -u MYURL -b chromium
pipx run pycookiecheat -u MYURL -b chromium -vvv
git clone https://github.com/n8henrie/pycookiecheat/ && cd pycookiecheat && git grep snap
Please make sure you've taken these steps before submitting a new issue:
relevant output
The text was updated successfully, but these errors were encountered: