### Setup Node.js Bindings Source: https://github.com/teng-lin/rookie/blob/main/docs/BUILDING.md Navigate to the Node.js bindings directory, install dependencies, and build the Node.js bindings. ```bash cd bindings/node npm install npm run build ``` -------------------------------- ### Setup Python Bindings with venv and pip Source: https://github.com/teng-lin/rookie/blob/main/docs/BUILDING.md Clone the rookie repository, set up a Python virtual environment, and install the Python bindings using pip. ```bash git clone https://github.com/thewh1teagle/rookie cd bindings/python python3 -m venv venv source venv/bin/activate # Install dependencies + build + install # May take some time on first use pip3 install . ``` -------------------------------- ### Install Rookie Python Source: https://github.com/teng-lin/rookie/blob/main/docs/Python.md Install the rookiepy package using pip. ```typescript pip3 install -U rookiepy ``` -------------------------------- ### Install Rookie for Python Source: https://github.com/teng-lin/rookie/blob/main/README.md Use pip to install the Python package for the Rookie library. ```shell pip install rookiepy ``` -------------------------------- ### Install Rookie JavaScript API Source: https://github.com/teng-lin/rookie/blob/main/docs/JavaScript.md Install the Rookie API package using npm. ```typescript npm install @rookie-rs/api ``` -------------------------------- ### Install Python Development Headers on Linux Source: https://github.com/teng-lin/rookie/blob/main/docs/BUILDING.md Install Python development headers required for building Python bindings on Linux systems. ```bash sudo apt-get install -y python3-dev ``` -------------------------------- ### Load Brave Browser Cookies in Rust Source: https://github.com/teng-lin/rookie/blob/main/README.md Example of loading cookies for 'google.com' from the Brave browser using the Rust API. Requires admin rights on Windows. ```rust use rookie::brave; fn main() { let domains = vec!["google.com"]; let cookies = brave(Some(domains)).unwrap(); for cookie in cookies { println!("{:?}", cookie); } } ``` -------------------------------- ### Load Brave Browser Cookies in JavaScript Source: https://github.com/teng-lin/rookie/blob/main/README.md Example of loading cookies from the Brave browser using the JavaScript API. This example logs each cookie object to the console. ```javascript import { brave } from "@rookie-rs/api"; const cookies = brave(); for (const cookie of cookies) { console.log(cookie); } ``` -------------------------------- ### Load Firefox Browser Cookies in Python Source: https://github.com/teng-lin/rookie/blob/main/README.md Example of loading cookies for 'google.com' from the Firefox browser using the Python API. ```python import rookiepy cookies = rookiepy.firefox(["google.com"]) for cookie in cookies: print(cookie['domain'], cookie['value']) ``` -------------------------------- ### Smoke Test Python Bindings Source: https://github.com/teng-lin/rookie/blob/main/docs/BUILDING.md Perform a basic smoke test on the Python bindings after local development setup using maturin. ```python python -c "import rookiepy; print(dir(rookiepy))" ``` -------------------------------- ### Clone and Build rookie CLI Source: https://github.com/teng-lin/rookie/blob/main/docs/BUILDING.md Clone the rookie repository and build the command-line interface (CLI) in release mode. ```bash git clone https://github.com/thewh1teagle/rookie cd cli cargo build --release ``` -------------------------------- ### Clone and Build rookie-rs Source: https://github.com/teng-lin/rookie/blob/main/docs/BUILDING.md Clone the rookie repository and build the core Rust component (rookie-rs). ```bash git clone https://github.com/thewh1teagle/rookie cd rookie-rs cargo build ``` -------------------------------- ### Basic Cookie Retrieval in Rust Source: https://github.com/teng-lin/rookie/blob/main/docs/Rust.md Demonstrates how to retrieve cookies from the Chrome browser using the rookie crate. Ensure the 'rookie' crate is added as a dependency. ```rust use rookie; fn main() { let cookies = rookie::chrome(None).unwrap(); println!("{cookies:?}"); } ``` -------------------------------- ### Create a New GitHub Release Source: https://github.com/teng-lin/rookie/blob/main/docs/BUILDING.md Use the GitHub CLI to create a new release tag for the project. ```bash gh release create v ``` -------------------------------- ### Execute CLI with Custom Cookie Path Source: https://github.com/teng-lin/rookie/blob/main/docs/General.md After copying the Cookies file from a mobile device, use this command to execute the rookie CLI with the specified path to the cookie file. ```shell ./cli --path ``` -------------------------------- ### Basic Usage of Rookie JavaScript API Source: https://github.com/teng-lin/rookie/blob/main/docs/JavaScript.md Import and initialize the brave function from the Rookie API. ```javascript import { brave } from "@rookie/api"; const cookies = brave(); ``` -------------------------------- ### Develop Python Bindings Locally with Maturin Source: https://github.com/teng-lin/rookie/blob/main/docs/BUILDING.md Set up a Python virtual environment and use maturin to develop the Python bindings in release mode for local development. ```bash cd bindings/python python3 -m venv venv source venv/bin/activate pip install --upgrade pip maturin maturin develop --release ``` -------------------------------- ### Add Rookie to Rust Project Source: https://github.com/teng-lin/rookie/blob/main/README.md Use this command to add the Rookie library as a dependency in your Rust project. ```shell cargo add rookie ``` -------------------------------- ### Enable RookiePy Debug Logging Source: https://github.com/teng-lin/rookie/blob/main/docs/Python.md Enable detailed logging for rookiepy by setting the logging level to DEBUG. This requires importing the `logging` module. ```python import logging logging.basicConfig() logging.getLogger().setLevel(logging.DEBUG) ``` -------------------------------- ### Load Cookies with RookiePy Source: https://github.com/teng-lin/rookie/blob/main/docs/Python.md Load cookies from Chrome using the rookiepy library. Ensure Chrome is closed before running. ```python import rookiepy cookies = rookiepy.chrome() # Load cookies from Chrome ``` -------------------------------- ### Run All Rust Tests Source: https://github.com/teng-lin/rookie/blob/main/docs/BUILDING.md Execute all tests within the Rust workspace, including unit tests, integration tests, and doctests. ```bash cargo test --workspace --all-targets ``` ```bash cargo test --workspace --doc ``` -------------------------------- ### Smoke Test Node.js Bindings Source: https://github.com/teng-lin/rookie/blob/main/docs/BUILDING.md Perform a basic smoke test on the Node.js bindings after building them with npm. ```javascript node -e "console.log(Object.keys(require('./index.js')))" ``` -------------------------------- ### Find Cookies on Android Source: https://github.com/teng-lin/rookie/blob/main/docs/General.md Use this shell command to locate the Cookies file within Android's data directory. This is useful for manually transferring cookie files to other systems for use with rookie. ```shell find /data/data -type f -name Cookies ``` -------------------------------- ### Extract Chrome Cookies Source: https://github.com/teng-lin/rookie/blob/main/bindings/node/README.md Demonstrates how to import and use the `chrome` function to retrieve cookies from the Chrome browser. ```APIDOC ## chrome() ### Description Retrieves cookies from the Google Chrome browser. ### Method `chrome()` ### Parameters None ### Request Example ```typescript import { chrome } from "@rookie-rs/api"; const cookies = chrome(); for (const cookie of cookies) { console.log(cookie); } ``` ### Response #### Success Response - **cookies** (Array) - An array of cookie objects. #### Response Example ```json [ { "name": "cookie_name", "value": "cookie_value", "domain": ".example.com", "path": "/", "expires": 1678886400, "httpOnly": false, "secure": true, "sameSite": "Lax" } ] ``` ``` -------------------------------- ### Extract Chrome Cookies with rookiepy Source: https://github.com/teng-lin/rookie/blob/main/bindings/python/README.md Use this snippet to extract all cookies from the Chrome browser. The extracted cookies are returned as a list of dictionaries, where each dictionary represents a single cookie with its domain, name, and value. ```python from rookiepy import chrome cookies = chrome() for cookie in cookies: print(cookie['domain'], cookie['name'], cookie['value']) ``` -------------------------------- ### Generate JavaScript for Manual Cookie Import Source: https://github.com/teng-lin/rookie/blob/main/docs/General.md This Python script generates JavaScript code to manually set cookies in a browser. It constructs a JavaScript string that can be executed in the browser's developer console to import cookies, typically after retrieving them using rookiepy. ```python import rookiepy from datetime import datetime, timezone, timedelta def create_js_code(cookies): expires = datetime.now(timezone.utc) expires += timedelta(days=365) # one year expires expires = expires.strftime('%a, %d %b %Y %H:%M:%S %Z') js_code = '' for cookie in cookies: name = cookie.get("name", "") value = cookie.get("value", "") if name and value: js_code += f'document.cookie = "{name}={value};expires={expires};"\n' js_code += 'location.reload()\n' return js_code cookies = rookiepy.brave(["github.com"]) print(create_js_code(cookies)) ``` -------------------------------- ### Extract Chrome Cookies with Node.js Source: https://github.com/teng-lin/rookie/blob/main/bindings/node/README.md Import and use the `chrome` function to retrieve cookies from the Chrome browser. Iterate over the returned cookies to access individual cookie details. ```typescript import { chrome } from "@rookie-rs/api"; const cookies = chrome(); for (const cookie of cookies) { console.log(cookie); } ``` -------------------------------- ### Control Logging Level with RUST_LOG Source: https://github.com/teng-lin/rookie/blob/main/docs/Rust.md Set the RUST_LOG environment variable to control the logging verbosity when running your Rust application with Cargo. 'trace' provides the most detailed output. ```console RUST_LOG=trace cargo run ``` -------------------------------- ### Disable RookiePy Logging Source: https://github.com/teng-lin/rookie/blob/main/docs/Python.md Completely disable rookiepy logging by setting the logging level to CRITICAL. This requires importing the `logging` module. ```python import logging logging.getLogger().setLevel(logging.CRITICAL) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.