Overview
Small toolkit for capturing and dumping browser cookies via an embedded browser and then being able to use them from cURL or any way you see fit.
This supports crawling or capturing authenticated web content.
Requirements
Python 3.10 or newer (requires-python in pyproject.toml, aligned with PySide6).
Install
From the repository root:
pip install .
Build
From the repository root, install the build tooling (for example the dev extra, which includes build and twine), then run the packaging script:
pip install -e '.[dev]'
./infrastructure/build.sh
That runs python -m build and writes the wheel and sdist under dist/.
To publish those artifacts to PyPI (after configuring twine credentials), use:
./infrastructure/upload.sh
Tools
-
ct_authenticate: Opens an embedded Chromium window to the given URL. The output should be redirected. Login as necessary and press the "Done" button. -
ct_to_curl: Reads the JSON output fromct_authenticateand printscurlcookie arguments
Example
ct_authenticate https://example.com > session.json
curl -s $(ct_to_curl < session.json) 'https://example.com/'
Tests
pytest
Release files for cookietruck 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cookietruck-0.1.3.tar.gz | 16.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cookietruck-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.2 kB