n8henrie / pycookiecheat

Borrow cookies from your browser's authenticated session for use in Python scripts.
https://n8henrie.com/2013/11/use-chromes-cookies-for-easier-downloading-with-python-requests/
MIT License
744 stars 111 forks source link

Support Slack app cookies #41

Closed hraftery closed 1 year ago

hraftery commented 1 year ago

Description

Add the Slack desktop app alongside Chrome and Chromium as "browsers" from which cookies can be pulled. The use cases for extracting cookies from a browser (eg. to browse web pages) might be slightly different to the use cases for extracting cookies from Slack (eg. to access the Slack API manually). Nonetheless, the way the cookies are stored is practically identical and pycookiecheat provides a very suitable basis for extracting them in either case.

Status

READY

Specifically: used by the author for several months; support for both standalone app and App Store app recently added; basic tests added recently and verified; code linted.

Related Issues

Todos

Steps to Test or Reproduce

pip install pycookiecheat-slack
python -c '
from pycookiecheat import chrome_cookies
cookies = chrome_cookies("http://slack.com", browser="Slack")
print("Token: " + cookies["d"])'

Other notes

The motivating use-case is here.

n8henrie commented 1 year ago

@hraftery I've merged this and a few other commits into dev. Can you please install the dev branch and verify things still work? If so I'll cut a new release on PyPI.

$ python -m pip install git+https://github.com/n8henrie/pycookiecheat@dev
hraftery commented 1 year ago

Works for me!

https://asciinema.org/a/569630

Heath

On 22 Mar 2023, at 10:47 am, Nathan Henrie @.***> wrote:

@hraftery https://github.com/hraftery I've merged this and a few other commits into dev. Can you please install the dev branch and verify things still work? If so I'll cut a new release on PyPI.

$ python -m pip install @.*** — Reply to this email directly, view it on GitHub https://github.com/n8henrie/pycookiecheat/pull/41#issuecomment-1478734536, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKGY33ZHOY45TWF3MT7MRTW5I4YFANCNFSM6AAAAAAUKFIL3M. You are receiving this because you were mentioned.