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

Firefox support wanted? #48

Closed grandchild closed 1 year ago

grandchild commented 1 year ago

My Issue

I'd like to add Firefox support, and want to gauge interest.

WHYT

I have implemented a basic Firefox cookie retrieval method that even works while Firefox is running (which has a lock on the cookies.sqlite DB).

n8henrie commented 1 year ago

Hi -- I'm traveling so apologies if responses are delayed, and thanks for creating an issue for this.

I'm primarily a Firefox user (created this extension before learning the true gospel of FF haha), so yes I would be happy to have FF support. A PR to this effect would be appreciated!

I would probably refactor into a separate module.

grandchild commented 1 year ago

Cool! That's nice to hear, so I'll start working on this.

I'll create a firefox_cookies() method that behaves the same as chrome_cookies(), to get us started. In a later PR, one could think about such things as "Get a cookie to this website, don't care about the browser, just search all available".

My initial PR will target Linux, I can test on Windows, but I can't really test Mac. But I guess in the end it's all about the canonical paths.

n8henrie commented 1 year ago

Sounds great. I can test on Linux and Mac. I don't support windows, as I don't have any windows devices and don't know it well.

grandchild commented 1 year ago

I finally got it to a reviewable state 😄 -- The code itself was done in hours, but the unit tests gave me some grief. But it's all working now 🎉

More in the PR...

grandchild commented 1 year ago

50 is merged.