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

Add command line option to set cookie file #74

Closed samiam closed 2 weeks ago

samiam commented 3 weeks ago

Description

Add ability to specify a cookie file on command line.

Status

READY

Note: https://github.com/chrisgavin/pycookiecheat/tree/handle-v24-cookies needs to be applied for testing to work

Related Issues

Todos

Steps to Test or Reproduce

$ pycookiecheat -u https://google.com | sort | head -1
    "AEC": "AVYB7coIGnG..."

$ pycookiecheat -u https://google.com -c ~/Library/Application\ Support/Google/Chrome/Default/Cookies | sort | head -1
    "AEC": "AVYB7coIGnG..."

$ pycookiecheat -u https://google.com -c ~/Library/Application\ Support/Google/Chrome/Profile\ 3/Cookies | sort | head -1
    "AEC": "AVYB7cqeSEq..."

$ pycookiecheat -u https://google.com --cookie-file ~/Library/Application\ Support/Google/Chrome/Profile\ 3/Cookies | sort | head  -1
    "AEC": "AVYB7cqeSEq..."

Other notes

n8henrie commented 3 weeks ago

Sweet, thanks! Was planning to work on this next week, I'll review and hope to merge then!