
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
binary-cookies-parser
Advanced tools
⚠️ DEPRECATED: This package is deprecated and therefore obsolete. Please use the new package binarycookies instead.
Python library and CLI tool for reading and writing binary cookies files.
pip install binarycookies
If you want to use the parser as CLI, it's recommended to use pipx to install the package in an isolated environment.
pipx install binarycookies
After installation, you can use the command-line interface to read a binary cookies file:
bcparser <path_to_binary_cookies_file>
Replace <path_to_binary_cookies_file> with the path to the binary cookie file you want to read.
import binarycookies
with open("path/to/cookies.binarycookies", "rb") as f:
cookies = binarycookies.load(f)
import binarycookies
cookie = {
"name": "session_id",
"value": "abc123",
"url": "https://example.com",
"path": "/",
"create_datetime": "2023-10-01T12:34:56+00:00",
"expiry_datetime": "2023-12-31T23:59:59+00:00",
"flag": "Secure"
}
with open("path/to/cookies.binarycookies", "wb") as f:
binarycookies.dump(cookie, f)
The bcparser
CLI supports two output types: json
(default) and ascii
.
The json
output type formats the cookies as a JSON array, making it easy to parse and manipulate programmatically.
Example usage:
bcparser path/to/cookies.binarycookies --output json
Example output JSON:
[
{
"name": "session_id",
"value": "abc123",
"url": "https://example.com",
"path": "/",
"create_datetime": "2023-10-01T12:34:56+00:00",
"expiry_datetime": "2023-12-31T23:59:59+00:00",
"flag": "Secure"
},
{
"name": "user_token",
"value": "xyz789",
"url": "https://example.com",
"path": "/account",
"create_datetime": "2023-10-01T12:34:56+00:00",
"expiry_datetime": "2023-12-31T23:59:59+00:00",
"flag": "HttpOnly"
}
]
The ascii output type formats the cookies in a simple, line-by-line text format, making it easy to read and pipe to other command-line tools.
Example usage:
bcparser path/to/cookies.binarycookies --output ascii
Example output ASCII:
Name: session_id
Value: abc123
URL: https://example.com
Path: /
Created: 2023-10-01T12:34:56+00:00
Expires: 2023-12-31T23:59:59+00:00
Flag: Secure
----------------------------------------
Name: user_token
Value: xyz789
URL: https://example.com
Path: /account
Created: 2023-10-01T12:34:56+00:00
Expires: 2023-12-31T23:59:59+00:00
Flag: HttpOnly
----------------------------------------
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub. Pull requests are also welcome.
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.