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

Update Slack macOS keychain identifier #61

Closed hraftery closed 10 months ago

hraftery commented 10 months ago

Description

Fixes https://github.com/n8henrie/pycookiecheat/issues/54

Slack now uses a different keychain identifier for storing its password on macOS. This PR simply updates to that new identifier.

Unfortunately we don't have control or visibility on potentially breaking changes in Slack because we're not using a published API. So this is a reactive change and required reverse engineering. I've also made the assumption that Slack's change has been rolled out widely enough that there's no need to be backward compatible. The assumption is based on the fact that Slack requires frequent updates to be compatible with the backend, so older versions are unlikely to be functional anyway.

Status

READY - tested from fresh installation on two macs, and used occasionally since the issue was raised 4 months ago (and was probably present for some time before that).

Related Issues

Todos

Steps to Test or Reproduce

As per the original PR:

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

Thanks so much for the PR and thorough documentation in this thread!