All Projects → n8henrie → Pycookiecheat

n8henrie / Pycookiecheat

Licence: mit
Borrow cookies from your browser's authenticated session for use in Python scripts.

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Pycookiecheat

Cookie Autodelete
Firefox and Chrome WebExtension that deletes cookies and other browsing site data as soon as the tab closes, domain changes, browser restarts, or a combination of those events.
Stars: ✭ 1,015 (+118.28%)
Mutual labels:  cookies, chrome
Requests
A simple, yet elegant, HTTP library.
Stars: ✭ 46,558 (+9912.47%)
Mutual labels:  requests, cookies
Adamantium Thief
🔑 Decrypt chromium based browsers passwords, cookies, credit cards, history, bookmarks, autofill. Version > 80 is supported.
Stars: ✭ 283 (-39.14%)
Mutual labels:  cookies, chrome
Scriptsafe
a browser extension to bring security and privacy to chrome, firefox, and opera
Stars: ✭ 434 (-6.67%)
Mutual labels:  chrome
React Native Login
📱 An example React Native project for client login authentication
Stars: ✭ 438 (-5.81%)
Mutual labels:  cookies
Polar Bookshelf
Polar is a personal knowledge repository for PDF and web content supporting incremental reading and document annotation.
Stars: ✭ 4,411 (+848.6%)
Mutual labels:  chrome
Darkness
Dark Themes for Popular Websites
Stars: ✭ 467 (+0.43%)
Mutual labels:  chrome
Asks
Async requests-like httplib for python.
Stars: ✭ 429 (-7.74%)
Mutual labels:  requests
Playwright Sharp
.NET version of the Playwright testing and automation library.
Stars: ✭ 459 (-1.29%)
Mutual labels:  chrome
Jd mask
京东定时自动预约,抢购.(只针对性支持要先预约,到点抢购.然后直接下单的商品!)
Stars: ✭ 453 (-2.58%)
Mutual labels:  requests
Whatsapp Web Bot
Whatsapp Web Bot - Example of Bot for use on Whatsapp Web (on Chrome)
Stars: ✭ 450 (-3.23%)
Mutual labels:  chrome
Karma Chrome Launcher
A Karma plugin. Launcher for Chrome and Chrome Canary.
Stars: ✭ 441 (-5.16%)
Mutual labels:  chrome
Whole Foods Delivery Slot
Automated script for Whole Foods and Amazon Fresh delivery slot
Stars: ✭ 460 (-1.08%)
Mutual labels:  chrome
Cookie crimes
Read local Chrome cookies without root or decrypting
Stars: ✭ 434 (-6.67%)
Mutual labels:  cookies
Tracy
A tool designed to assist with finding all sinks and sources of a web application and display these results in a digestible manner.
Stars: ✭ 464 (-0.22%)
Mutual labels:  chrome
Phpdesktop
Developing Desktop Applications Like Developing Websites => phpdesktop
Stars: ✭ 434 (-6.67%)
Mutual labels:  chrome
Polish Ads Filter
CertyficateIT - Oficjalne polskie filtry do Adblock, uBlock Origin, Adguard
Stars: ✭ 462 (-0.65%)
Mutual labels:  cookies
Octotree
Browser extension that enhances GitHub code review and exploration. You can download Octotree for your browser from our website.
Stars: ✭ 21,726 (+4572.26%)
Mutual labels:  chrome
Guzzle
Guzzle, an extensible PHP HTTP client
Stars: ✭ 21,384 (+4498.71%)
Mutual labels:  requests
Fetool
大前端的瑞士军刀,只记录有用的。
Stars: ✭ 4,328 (+830.75%)
Mutual labels:  chrome

pycookiecheat

Build Status

Borrow cookies from your browser's authenticated session for use in Python scripts.

Installation

NB: Use pip and python instead of pip3 and python3 if you're still on Python 2 and using pycookiecheat < v0.4.0. pycookiecheat >= v0.4.0 requires Python 3.5+, and may soon go to 3.6+.

  • pip3 install pycookiecheat

Installation notes regarding alternative keyrings on Linux

See #12. Chrome is now using a few different keyrings to store your Chrome Safe Storage password, instead of a hard-coded password. Pycookiecheat doesn't work with most of these so far, and to be honest my enthusiasm for adding support for ones I don't use is limited. However, users have contributed code that seems to work with some of the recent Ubuntu desktops. To get it working, you may have to sudo apt-get install libsecret-1-dev python-gi python3-gi, and if you're installing into a virtualenv (highly recommended), you need to use the --system-site-packages flag to get access to the necessary libraries.

Alternatively, some users have suggested running Chrome with the --password-store=basic or --use-mock-keychain flags.

Development Setup

  1. git clone https://github.com/n8henrie/pycookiecheat.git
  2. cd pycookiecheat
  3. python3 -m venv venv
  4. venv/bin/pip install -e .[dev]

Usage

from pycookiecheat import chrome_cookies
import requests

url = 'http://example.com/fake.html'

# Uses Chrome's default cookies filepath by default
cookies = chrome_cookies(url)
r = requests.get(url, cookies=cookies)

Use the cookie_file keyword-argument to specify a different filepath for the cookies-file: chrome_cookies(url, cookie_file='/abspath/to/cookies')

Keep in mind that pycookiecheat defaults to looking for cookies for Chromium, not Google Chrome, so if you're using the latter, you'll need to manually specify something like "/home/username/.config/google-chrome/Default/Cookies" as your cookie_file.

Features

  • Returns decrypted cookies from Google Chrome on OSX or Linux.
  • Optionally outputs cookies to file (thanks to Muntashir Al-Islam!)

FAQ / Troubleshooting

How about Windows?

I don't use Windows or have a PC, so I won't be adding support myself. Feel free to make a PR :)

I get an installation error with the cryptography module on OS X

(pycookiecheat <v0.4.0)

If you're getting this error and using Homebrew, then you need to follow the instructions for Building cryptography on OS X and export LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" and try again.

I get an installation error with the cryptography module on Linux

Please check the official cryptography docs. On some systems (e.g. Ubuntu), you may need to do something like sudo apt-get install build-essential libssl-dev libffi-dev python-dev prior to installing with pip.

How can I use pycookiecheat on KDE-based Linux distros?

On KDE, Chrome defaults to using KDE's own keyring, KWallet. For pycookiecheat to support KWallet the dbus-python package must be installed.

How do I install the dev branch with pip?

Buy Me a Coffee

☕️

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].