bili-hardcore
repository·main·Indexed 25 days ago
https://github.com/karben233/bili-hardcoreAn 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.
What's inside bili-hardcore
- Bili-Hardcore is an automated tool designed for Bilibili's 'Hardcore Member' (硬核会员) quiz trials. It leverages Large Language Models (LLMs) to provide intelligent automated answering capabilities.
Install Bili-Hardcore manually
mainYou 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-muslversion 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- macOS (Intel / Apple Silicon): Use
Prerequisites for Bili-Hardcore usage
mainBefore 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.
Run and use Bili-Hardcore
mainYou can start the tool in two ways:
- Interactive Mode: Run the command without arguments to go through the configuration process.
- Direct Mode: Pass the URL, model, and API key directly via command-line arguments.
Install Bili-Hardcore via Quick Install scripts
mainThe 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 | iexBuild Bili-Hardcore from source
mainTo build from source, you must have Rust 1.88 or higher installed.
git clone https://github.com/Karben233/bili-hardcore.git cd bili-hardcore cargo build --release ./target/release/bili-hardcoreUninstall bili-hardcore
mainThe
uninstallcommand removes thebili-hardcoreexecutable 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]).- Unix/Linux: Deletes the current executable file. It notes that if you installed via
Update bili-hardcore to the latest version
mainThe
updatecommand automates the process of upgrading the tool. It performs the following steps:- Fetches the latest release tag from GitHub (using GitHub API, redirects, or Tags API as fallbacks).
- Detects your current platform (Windows, macOS, or Linux) and architecture (x64 or arm64).
- Downloads the appropriate archive (
.zipfor Windows,.tar.gzfor macOS/Linux). - Extracts the new binary.
- Replaces the existing executable with the new version.
This command is useful for ensuring you have the latest features and fixes without manual downloading.
Configure OpenAI API settings
mainThe application uses an
OpenAiConfigobject to manage LLM connections. This configuration is stored inopenai_config.jsonwithin the.bili-hardcoredirectory in your home folder.Configuration Schema
Key Type Description 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, usedelete_openai_config.Configure Bilibili Authentication data
mainAuthentication data required for Bilibili interaction is stored in
auth.jsonwithin the.bili-hardcoredirectory.Authentication Schema
Key Type Description 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.jsonfile is older than 7 days,load_auth()will returnNone, requiring re-authentication.To update authentication, use
save_auth. To clear it, usedelete_auth.Bili-Hardcore CLI commands
mainThe following commands are available for managing the installation:Use BiliClient for QR Code Login
mainTheBiliClientprovides methods to facilitate QR code-based authentication. First, callqrcode_get()to retrieve the QR code data. Then, useqrcode_poll(auth_code)with the receivedauth_codeto poll for the login status.