bili-hardcore

repository·main·Indexed 25 days ago

https://github.com/karben233/bili-hardcore

An automated tool that leverages Large Language Models (LLMs) to solve Bilibili's 'Hardcore Member' (硬核会员) quiz trials for users who have reached Level 6. It features a CLI for configuration, support for OpenAI-compatible APIs, and automated handling of Bilibili's quiz and captcha flows.

Tokens
2.9K
Snippets
4
Records
24
Agent score
81%

What's inside bili-hardcore

  1. Install Bili-Hardcore manually

    main

    You can download pre-compiled binaries from the Releases page.

    Platform Selection Guide:

    • macOS (Intel / Apple Silicon): Use bili-hardcore-*-darwin-universal.tar.gz
    • Windows (x64): Use bili-hardcore-*-windows-x64.zip
    • Linux (x64): Use bili-hardcore-*-linux-x64-musl.tar.gz (The -musl version is recommended for better compatibility across distributions).
    • Linux (ARM64): Use bili-hardcore-*-linux-arm64-musl.tar.gz

    After downloading and extracting, grant execution permissions and run the binary.

    # Grant permission and run
    chmod +x bili-hardcore
    ./bili-hardcore
  2. Prerequisites for Bili-Hardcore usage

    main

    Before using the tool, ensure you meet the following Bilibili requirements:

    • Account Level: Your Bilibili account must be at least Level 6 to participate in Hardcore Member trials.
    • Daily Limits: There are 3 quiz opportunities per day. Once the limit is reached, you must wait 24 hours to attempt again. Check the Bilibili app for specific reset times.
    • LLM API Key: You need an API key for the LLM. Users without one can register at SiliconFlow to receive free credits.
  3. Install Bili-Hardcore via Quick Install scripts

    main

    The recommended way to install Bili-Hardcore is using the provided installation scripts for your operating system.

    Note for existing users: If you are upgrading from a 0.x version, you must first delete your old configuration files to avoid conflicts.

    # Clean up old 0.x configurations before installing new version
    
    # macOS / Linux
    rm -rf ~/.bili-hardcore
    
    # Windows (PowerShell)
    Remove-Item -Recurse -Force "$env:USERPROFILE\.bili-hardcore"
    # macOS / Linux Quick Install
    curl -fsSL https://github.com/Karben233/bili-hardcore/releases/latest/download/install.sh | bash
    # Windows (PowerShell) Quick Install
    irm https://github.com/Karben233/bili-hardcore/releases/latest/download/install.ps1 | iex
  4. Uninstall bili-hardcore

    main

    The uninstall command removes the bili-hardcore executable from your system.

    Behavior by Platform:

    • Unix/Linux: Deletes the current executable file. It notes that if you installed via install.sh, you may need to manually remove the PATH configuration.
    • Windows: Since Windows prevents replacing a running executable, the tool creates a temporary batch script to rename the old executable and delete it, then proceeds with the uninstallation.

    Warning: This action requires confirmation via the terminal ([y/N]).

  5. Update bili-hardcore to the latest version

    main

    The update command automates the process of upgrading the tool. It performs the following steps:

    1. Fetches the latest release tag from GitHub (using GitHub API, redirects, or Tags API as fallbacks).
    2. Detects your current platform (Windows, macOS, or Linux) and architecture (x64 or arm64).
    3. Downloads the appropriate archive (.zip for Windows, .tar.gz for macOS/Linux).
    4. Extracts the new binary.
    5. Replaces the existing executable with the new version.

    This command is useful for ensuring you have the latest features and fixes without manual downloading.

  6. Configure OpenAI API settings

    main

    The application uses an OpenAiConfig object to manage LLM connections. This configuration is stored in openai_config.json within the .bili-hardcore directory in your home folder.

    Configuration Schema

    KeyTypeDescription
    base_urlStringThe base URL for the OpenAI-compatible API
    modelStringThe name of the model to use
    api_keyStringYour API authentication key
    enable_thinkingboolWhether to enable thinking mode (defaults to false)
    enable_fast_modeboolWhether to enable fast mode (defaults to false)

    To update your configuration, use save_openai_config. To clear it, use delete_openai_config.

  7. Configure Bilibili Authentication data

    main

    Authentication data required for Bilibili interaction is stored in auth.json within the .bili-hardcore directory.

    Authentication Schema

    KeyTypeDescription
    access_tokenStringThe Bilibili access token
    csrfStringThe CSRF token
    midStringThe Bilibili user ID (MID)
    cookieStringThe raw cookie string

    Note on Expiration: The application checks the file modification time. If the auth.json file is older than 7 days, load_auth() will return None, requiring re-authentication.

    To update authentication, use save_auth. To clear it, use delete_auth.