### Manage Local Cobalt Instance with Docker in Python Source: https://context7.com/nichind/pybalt/llms.txt Shows how to use the `pybalt.core.local.LocalInstance` class to manage a local Cobalt instance via Docker. It covers checking Docker installation and permissions, running an interactive setup wizard, programmatic configuration (port, authentication, API key, duration limit), creating instance directories, generating `docker-compose.yml`, and starting, checking status, stopping, and restarting the instance. ```python from pybalt.core.local import LocalInstance # Initialize local instance manager local = LocalInstance() # Check if Docker is installed and has permissions if local.check_docker_installed(): print("Docker is available") if local.check_docker_permissions(): print("Docker permissions OK") # Run interactive setup wizard local.setup_wizard() # Or configure programmatically local.config.set("local_instance_port", "9000", "local") local.config.set("api_auth_required", "1", "local") local.config.set("api_key", "my-secret-key", "local") local.config.set("duration_limit", "10800", "local") # 3 hours local.create_instance_dir() local.generate_docker_compose_file() # Start the local instance local.start_instance() print(f"Instance running at: {local.api_url}") # Check instance status status = local.get_instance_status() if status.get("running"): print("Local instance is running") # Stop the instance local.stop_instance() # Restart the instance local.restart_instance() ``` -------------------------------- ### Start Pybalt API Server Source: https://context7.com/nichind/pybalt/llms.txt Shows how to initialize the built-in FastAPI server programmatically or via command line interfaces. ```python from pybalt.misc.api import run_api run_api(port=8009) ``` ```bash cobalt --api-start python -m pybalt.misc.api 8009 ``` -------------------------------- ### Execute Pybalt CLI Commands Source: https://context7.com/nichind/pybalt/llms.txt Provides examples for using the cobalt CLI to download media, manage instances, configure settings, and control the API server. ```bash cobalt "https://youtube.com/watch?v=DG2QqcHwNdE" -remux -vQ max cobalt -ai "https://instance.com" "key" cobalt -sc "network" "timeout" "30" cobalt --api-start --api-port 8080 ``` -------------------------------- ### Configure via Environment Variables Source: https://github.com/nichind/pybalt/blob/main/README.md Examples of setting Pybalt configuration using environment variables, which can be defined in the shell or a .env file. ```bash export PYBALT_CONFIG_DIR=path/to/config/dir export PYBALT_GENERAL_DEBUG=True export PYBALT_NETWORK_TIMEOUT=30 export PYBALT_PATHS_DEFAULT_DOWNLOADS_DIR=/path ``` -------------------------------- ### Manage Configuration via CLI Source: https://github.com/nichind/pybalt/blob/main/README.md Commands to interact with the Pybalt configuration system, including opening the interactive interface, getting values, and setting values. ```bash cobalt -c cobalt -gc "network" "timeout" cobalt -sc "network" "timeout" "30" ``` -------------------------------- ### Configuration Management with Pybalt Config Class in Python Source: https://context7.com/nichind/pybalt/llms.txt Demonstrates the usage of the `pybalt.core.config.Config` class for managing application settings. It explains how the configuration system prioritizes environment variables over INI files and provides programmatic access. Examples include retrieving general, network, and path settings, and fetching values specifically as numbers. ```python from pybalt.core.config import Config config = Config() # Get configuration values (automatically checks environment variables first) timeout = config.get("timeout", fallback=30, section="network") debug = config.get("debug", section="general") download_dir = config.get("default_downloads_dir", section="paths") # Get values as numbers max_concurrent = config.get_as_number("max_concurrent_downloads", fallback=3, section="network") ``` -------------------------------- ### GET / Source: https://github.com/nichind/pybalt/blob/main/README.md Retrieves information about the API server, including the version and the number of configured instances. ```APIDOC ## GET / ### Description Returns information about the API server, including version and instance count. ### Method GET ### Endpoint / ### Response #### Success Response (200) - **version** (string) - The current version of the API server - **instance_count** (integer) - Number of active cobalt instances #### Response Example { "version": "1.0.0", "instance_count": 3 } ``` -------------------------------- ### Install pybalt via pip Source: https://github.com/nichind/pybalt/blob/main/README.md The standard method to install or update the pybalt package using the Python package manager. ```shell pip install pybalt -U ``` -------------------------------- ### Manage Local Cobalt Instance Source: https://github.com/nichind/pybalt/blob/main/README.md Commands to set up, start, stop, check status, and restart a local Cobalt instance managed via Docker. ```bash cobalt -ls cobalt -lstart cobalt -lstop cobalt -lstatus cobalt -lrestart ``` -------------------------------- ### Automated Windows Installation Source: https://github.com/nichind/pybalt/blob/main/README.md A PowerShell command to download and execute the installation batch script for Windows users who may not have Python pre-installed. ```powershell powershell -Command "Invoke-WebRequest -Uri https://raw.githubusercontent.com/nichind/pybalt/main/install.bat -OutFile install.bat; .\install.bat" ``` -------------------------------- ### GET / - Server Information Source: https://context7.com/nichind/pybalt/llms.txt Retrieves general information about the pybalt server, including the current version and active instance count. ```APIDOC ## GET / ### Description Returns basic server metadata including the welcome message, API version, and the number of active instances. ### Method GET ### Endpoint / ### Response #### Success Response (200) - **message** (string) - Welcome message from the API - **version** (string) - Current API version - **instance_count** (integer) - Number of active instances #### Response Example { "message": "Welcome to the pybalt api...", "version": "2025.7.1", "instance_count": 15 } ``` -------------------------------- ### Python Module: Advanced Usage with InstanceManager Source: https://github.com/nichind/pybalt/blob/main/README.md Demonstrates advanced usage of the pybalt Python module with InstanceManager. This includes getting available instances, downloading a file using a specific instance, and performing bulk downloads concurrently using a generator. ```python from pybalt.core.wrapper import InstanceManager from asyncio import run async def main(): # Create an instance manager manager = InstanceManager(debug=True) # Get a list of available instances instances = await manager.get_instances() print(f"Found {len(instances)} available instances") # Download a file using the first available instance file_path = await manager.download( url="https://youtube.com/watch?v=DG2QqcHwNdE", videoQuality="1080", remux=True ) print(f"Downloaded to: {file_path}") # Bulk download multiple URLs urls = [ "https://youtube.com/watch?v=DG2QqcHwNdE", "https://youtube.com/watch?v=anotherVideo" ] # Download multiple files concurrently async for path in manager.download_generator(urls=urls, remux=True): print(f"Downloaded: {path}") run(main()) ``` -------------------------------- ### Operate API Server Source: https://github.com/nichind/pybalt/blob/main/README.md Commands to manage the built-in API server, including starting in detached mode, specifying ports, and checking status. ```bash cobalt --api-start cobalt --api-port 8080 --api-start cobalt --api-status cobalt --api-stop ``` -------------------------------- ### GET / - Server Info (curl) Source: https://context7.com/nichind/pybalt/llms.txt Retrieves basic server information from the Pybalt API. This endpoint is useful for checking API status and version. ```bash curl http://localhost:8009/ ``` -------------------------------- ### Cobalt CLI: Remux Existing Video File Source: https://github.com/nichind/pybalt/blob/main/README.md Shows how to remux an existing local video file using the Cobalt CLI. This operation requires ffmpeg to be installed and accessible in the system path. ```sh cobalt "C:/Users/username/Videos/video.mp4" ``` -------------------------------- ### Configure Pybalt Settings and Instances Source: https://context7.com/nichind/pybalt/llms.txt Demonstrates how to modify configuration values, manage user instances, and reset settings to defaults using the configuration manager. ```python config.set("timeout", "60", section="network") config.set("debug", "True", section="general") config.add_user_instance("https://my-cobalt-instance.com", api_key="my-api-key") instances = config.get_user_instances() config.update_user_instance(1, url="https://new-url.com") config.remove_user_instance(1) config.reset_to_default("timeout", section="network") config.reset_all_to_defaults() all_settings = config.get_all_settings() ``` -------------------------------- ### Cobalt CLI: Set Up Local Instance with Docker Source: https://github.com/nichind/pybalt/blob/main/README.md Initializes and sets up a local Cobalt instance using Docker. This command prepares the necessary Docker containers and configurations. ```sh cobalt -ls ``` -------------------------------- ### Cobalt CLI: Download Multiple Videos from Links File Source: https://github.com/nichind/pybalt/blob/main/README.md Illustrates downloading multiple videos by providing a path to a text file containing video links. Each link should be on a new line. ```sh cobalt "path/to/links.txt" ``` -------------------------------- ### Initiate Media Download via cURL Source: https://github.com/nichind/pybalt/blob/main/README.md This snippet demonstrates how to send a POST request to the pybalt API to initiate a media download. It requires a JSON payload containing the target URL, video quality, and audio format preferences. ```bash curl -X POST "http://localhost:8009/" \ -H "Content-Type: application/json" \ -d '{"url": "https://www.youtube.com/watch?v=DG2QqcHwNdE", "videoQuality": "1080", "audioFormat": "mp3"}' ``` -------------------------------- ### Download media files with pybalt Source: https://context7.com/nichind/pybalt/llms.txt Demonstrates the basic usage of the download function to fetch media from a URL. It covers both default settings and custom configurations like quality, format, and remuxing. ```python from pybalt import download from asyncio import run async def main(): # Simple download with default settings file_path = await download("https://youtube.com/watch?v=DG2QqcHwNdE") print(f"Downloaded to: {file_path}") # Download with custom parameters file_path = await download( "https://youtube.com/watch?v=DG2QqcHwNdE", videoQuality="1080", audioFormat="mp3", audioBitrate="320", filenameStyle="pretty", downloadMode="auto", remux=True ) print(f"Downloaded to: {file_path}") run(main()) ``` -------------------------------- ### POST / Source: https://github.com/nichind/pybalt/blob/main/README.md Submits a download request with a URL and optional parameters to the cobalt instance. ```APIDOC ## POST / ### Description Accepts a JSON payload with a URL and parameters to download content and returns a JSON response with download information. ### Method POST ### Endpoint / ### Request Body - **url** (string) - Required - The URL of the content to download - **options** (object) - Optional - Configuration for the download (e.g., quality, format) ### Request Example { "url": "https://youtube.com/watch?v=example", "options": { "quality": "1080p" } } ### Response #### Success Response (200) - **status** (string) - The status of the download request - **download_id** (string) - Unique identifier for the download task #### Response Example { "status": "started", "download_id": "uuid-12345" } ``` -------------------------------- ### Track Download Progress with Callbacks and Status Objects in Python Source: https://context7.com/nichind/pybalt/llms.txt Demonstrates how to monitor download progress in real-time using pybalt. It shows two methods: using asynchronous callback functions (`status_callback`, `done_callback`) and utilizing a status parent object (`StatusParent`) for background monitoring. This allows tracking downloaded size, total size, speed, and ETA. ```python from pybalt import download from asyncio import run, create_task, sleep async def main(): # Method 1: Using callback functions async def status_callback(downloaded_size, total_size, download_speed, eta, **kwargs): percent = (downloaded_size / total_size * 100) if total_size > 0 else 0 print(f"Progress: {percent:.1f}% | " f"{downloaded_size / 1024 / 1024:.2f}MB / {total_size / 1024 / 1024:.2f}MB | " f"Speed: {download_speed / 1024 / 1024:.2f}MB/s | ETA: {eta:.0f}s") async def done_callback(file_path, downloaded_size, time_passed, **kwargs): print(f"Download completed in {time_passed:.2f}s") print(f"File saved to: {file_path}") file_path = await download( "https://youtube.com/watch?v=DG2QqcHwNdE", status_callback=status_callback, done_callback=done_callback ) # Method 2: Using status parent object for background monitoring class StatusParent: def __init__(self): self.downloaded_size = 0 self.total_size = 0 self.download_speed = 0 self.eta = 0 self.completed = False status = StatusParent() task = create_task(download( "https://youtube.com/watch?v=DG2QqcHwNdE", status_parent=status )) while not task.done(): if status.total_size > 0: percent = status.downloaded_size / status.total_size * 100 print(f"Background download: {percent:.1f}%") await sleep(1) file_path = await task print(f"Downloaded to: {file_path}") run(main()) ``` -------------------------------- ### Cobalt CLI: List Configured Instances Source: https://github.com/nichind/pybalt/blob/main/README.md Command to list all configured Cobalt instances, including local and remote ones. This helps in managing multiple download sources. ```sh cobalt -li ``` -------------------------------- ### Configure Pybalt via Environment Variables (bash) Source: https://context7.com/nichind/pybalt/llms.txt Demonstrates setting Pybalt configuration options using environment variables. These variables allow customization of directories, network settings, API ports, and more, overriding config file settings. ```bash # Custom config directory/file export PYBALT_CONFIG_DIR="/path/to/config/dir" export PYBALT_CONFIG_PATH="/path/to/settings.ini" # General settings export PYBALT_GENERAL_DEBUG=True export PYBALT_GENERAL_USER_AGENT="custom-agent" # Network settings export PYBALT_NETWORK_TIMEOUT=30 export PYBALT_NETWORK_USE_SYSTEM_PROXY=True export PYBALT_NETWORK_PROXY="http://proxy:8080" export PYBALT_NETWORK_MAX_CONCURRENT_DOWNLOADS=6 export PYBALT_NETWORK_MAX_RETRIES=3 # Paths export PYBALT_PATHS_DEFAULT_DOWNLOADS_DIR="/custom/downloads" # Local instance export PYBALT_LOCAL_LOCAL_INSTANCE_PORT=9000 # API server export PYBALT_API_PORT=8009 ``` -------------------------------- ### Cobalt CLI: Basic Video Download and Remuxing Source: https://github.com/nichind/pybalt/blob/main/README.md Demonstrates downloading a YouTube video at maximum resolution and remuxing it using the Cobalt CLI. Requires ffmpeg for remuxing. ```sh cobalt "https://youtube.com/watch?v=DG2QqcHwNdE" -remux -vQ max ``` -------------------------------- ### Track Download Progress Programmatically Source: https://github.com/nichind/pybalt/blob/main/README.md Demonstrates how to use a StatusParent class to monitor download progress, speed, and ETA asynchronously while running a download task. ```python from pybalt import download from asyncio import run, create_task, sleep class StatusParent: def __init__(self): self.downloaded_size = 0 self.total_size = 0 self.download_speed = 0 self.eta = 0 self.completed = False self.file_path = None async def main(): status = StatusParent() task = create_task(download("https://youtube.com/watch?v=DG2QqcHwNdE", status_parent=status)) while not task.done(): if status.total_size > 0: percent = status.downloaded_size / status.total_size * 100 print(f"Progress: {percent:.1f}% - Speed: {status.download_speed / 1024 / 1024:.2f}MB/s") await sleep(1) file_path = await task print(f"Downloaded to: {file_path}") run(main()) ``` -------------------------------- ### Cobalt CLI: Start/Stop Local Instance Source: https://github.com/nichind/pybalt/blob/main/README.md Commands to control the lifecycle of the local Cobalt instance managed by Docker. Use '-lstart' to begin and '-lstop' to halt the instance. ```sh cobalt -lstart ``` ```sh cobalt -lstop ``` -------------------------------- ### Cobalt CLI: Add New Instance Source: https://github.com/nichind/pybalt/blob/main/README.md Adds a new Cobalt instance to the configuration. Requires the instance URL and optionally an API key for authenticated access. ```sh cobalt -ai "https://example-instance.com" "optional-api-key" ``` -------------------------------- ### Cobalt CLI: Specify Quality, Format, and Download Location Source: https://github.com/nichind/pybalt/blob/main/README.md Demonstrates advanced download options including specifying video quality (1080p), audio format (mp3), audio bitrate (320kbps), and a custom download path. ```sh cobalt "https://youtube.com/watch?v=DG2QqcHwNdE" -vQ 1080 -aF mp3 --audioBitrate 320 -fp "C:/Downloads" ``` -------------------------------- ### POST / - Download Media (curl) Source: https://context7.com/nichind/pybalt/llms.txt Initiates a media download request to the Pybalt API. It accepts JSON payload specifying URL, video quality, audio format, and ignored instances. Returns download status and URL. ```bash curl -X POST "http://localhost:8009/" \ -H "Content-Type: application/json" \ -d '{ "url": "https://youtube.com/watch?v=DG2QqcHwNdE", "videoQuality": "1080", "audioFormat": "mp3", "ignoredInstances": ["problematic-instance.com"] }' ``` -------------------------------- ### Python Module: Basic Video Download Source: https://github.com/nichind/pybalt/blob/main/README.md Shows basic video downloading using the pybalt Python module. It includes a simple download with default settings and a more advanced download with custom parameters like quality, format, and bitrate. ```python from pybalt import download from asyncio import run async def main(): # Simple download with default settings file_path = await download("https://youtube.com/watch?v=DG2QqcHwNdE") print(f"Downloaded to: {file_path}") # Download with custom parameters file_path = await download( "https://youtube.com/watch?v=DG2QqcHwNdE", videoQuality="1080", audioFormat="mp3", audioBitrate="320", filenameStyle="pretty", remux=True ) print(f"Downloaded to: {file_path}") run(main()) ``` -------------------------------- ### Manage cobalt instances with InstanceManager Source: https://context7.com/nichind/pybalt/llms.txt Shows how to use the InstanceManager class to handle local, user-defined, and public cobalt instances. This allows for advanced control over download operations and instance selection. ```python from pybalt.core.wrapper import InstanceManager from asyncio import run async def main(): # Create an instance manager with debug logging manager = InstanceManager(debug=True) # Fetch and filter available instances instances = await manager.fetch_instances( min_version="10.0", min_score=80, filter_online=True ) print(f"Found {len(instances)} high-quality instances") # Get all available instances all_instances = await manager.get_instances() print(f"Total available instances: {len(all_instances)}") # Download a single file file_path = await manager.download( url="https://youtube.com/watch?v=DG2QqcHwNdE", videoQuality="1080", remux=True, folder_path="/path/to/downloads" ) print(f"Downloaded to: {file_path}") run(main()) ``` -------------------------------- ### Python Module: Track Download Progress Source: https://github.com/nichind/pybalt/blob/main/README.md Illustrates how to track download progress using pybalt's Python module. It defines callback functions for status updates (downloaded size, total size, speed, ETA) and completion notifications (file path, time taken). ```python from pybalt import download from asyncio import run async def main(): # Define a status callback function async def status_callback(downloaded_size, total_size, download_speed, eta, **kwargs): percent = (downloaded_size / total_size * 100) if total_size > 0 else 0 print(f"Downloaded: {downloaded_size / 1024 / 1024:.2f}MB / " f"{total_size / 1024 / 1024:.2f}MB ({percent:.1f}%) at " f"{download_speed / 1024 / 1024:.2f}MB/s, ETA: {eta:.0f}s") # Define a completion callback async def done_callback(file_path, downloaded_size, time_passed, **kwargs): print(f"Download completed in {time_passed:.2f}s") print(f"File saved to: {file_path}") # Download with progress tracking file_path = await download( "https://youtube.com/watch?v=DG2QqcHwNdE", status_callback=status_callback, done_callback=done_callback ) run(main()) ``` -------------------------------- ### Cobalt CLI: Download and Open Video Immediately Source: https://github.com/nichind/pybalt/blob/main/README.md Downloads a video and automatically opens it using the default media player after the download is complete. The '-o' flag triggers this behavior. ```sh cobalt "https://youtube.com/watch?v=DG2QqcHwNdE" -o ``` -------------------------------- ### POST / Source: https://github.com/nichind/pybalt/blob/main/README.md This endpoint allows users to request the download of a media file from a given URL. You can specify the desired video quality and audio format. ```APIDOC ## POST / ### Description This endpoint allows users to request the download of a media file from a given URL. You can specify the desired video quality and audio format. ### Method POST ### Endpoint / ### Parameters #### Request Body - **url** (string) - Required - The URL of the media file to download. - **videoQuality** (string) - Optional - The desired video quality (e.g., "1080", "720"). - **audioFormat** (string) - Optional - The desired audio format (e.g., "mp3", "aac"). ### Request Example ```json { "url": "https://www.youtube.com/watch?v=DG2QqcHwNdE", "videoQuality": "1080", "audioFormat": "mp3" } ``` ### Response #### Success Response (200) - **status** (string) - The status of the download process. - **url** (string) - The download link for the media file. - **instance_info** (object) - Information about the instance processing the request. - **url** (string) - The URL of the instance. #### Response Example ```json { "status": "tunnel", "url": "http://download-link.mp4", "instance_info": { "url": "https://instance-url.com" } } ``` ``` -------------------------------- ### Direct API Access with First Tunnel in Python Source: https://context7.com/nichind/pybalt/llms.txt Illustrates how to use the `first_tunnel` method from `pybalt.core.wrapper.InstanceManager` to send concurrent requests to available instances and retrieve the first successful response. This provides direct access to API data without downloading the file, handling different response statuses like 'tunnel', 'picker', 'redirect', and 'error'. ```python from pybalt.core.wrapper import InstanceManager from asyncio import run async def main(): manager = InstanceManager() # Get download URL from the fastest responding instance response = await manager.first_tunnel( url="https://youtube.com/watch?v=DG2QqcHwNdE", videoQuality="1080", audioFormat="mp3" ) if response.get("status") == "tunnel": print(f"Download URL: {response['url']}") print(f"Filename: {response.get('filename')}") print(f"Instance: {response.get('instance_info', {}).get('url')}") elif response.get("status") == "picker": # Multiple files available (e.g., Instagram carousel) for item in response.get("picker", []): print(f"Type: {item.get('type')}, URL: {item.get('url')}") elif response.get("status") == "redirect": print(f"Redirect URL: {response['url']}") elif response.get("status") == "error": print(f"Error: {response['error']['code']}") run(main()) ``` -------------------------------- ### Cobalt CLI: Download and Show in File Explorer Source: https://github.com/nichind/pybalt/blob/main/README.md Downloads a video and reveals its location in the system's file explorer (Finder on macOS, File Explorer on Windows). The '-s' flag is used for this. ```sh cobalt "https://youtube.com/watch?v=DG2QqcHwNdE" -s ``` -------------------------------- ### POST / - Download Media Source: https://context7.com/nichind/pybalt/llms.txt Initiates a media download request by providing a URL and optional configuration for quality and format. ```APIDOC ## POST / ### Description Submits a URL for media processing and downloading. Supports specifying video quality, audio format, and blacklisting specific instances. ### Method POST ### Endpoint / ### Request Body - **url** (string) - Required - The URL of the media to download - **videoQuality** (string) - Optional - Desired video quality (e.g., "1080") - **audioFormat** (string) - Optional - Desired audio format (e.g., "mp3") - **ignoredInstances** (array) - Optional - List of instance URLs to exclude ### Request Example { "url": "https://youtube.com/watch?v=DG2QqcHwNdE", "videoQuality": "1080", "audioFormat": "mp3", "ignoredInstances": ["problematic-instance.com"] } ### Response #### Success Response (200) - **status** (string) - Current status of the request - **url** (string) - The generated download URL - **filename** (string) - The name of the downloaded file - **instance_info** (object) - Information about the responding instance #### Response Example { "status": "tunnel", "url": "https://download-url.com/file.mp4", "filename": "video.mp4", "instance_info": { "url": "responding-instance.com" } } ``` -------------------------------- ### Perform bulk downloads with download_generator Source: https://context7.com/nichind/pybalt/llms.txt Illustrates how to download multiple URLs concurrently using the download_generator method. It supports settings for retries, file size validation, and result formatting. ```python from pybalt.core.wrapper import InstanceManager from asyncio import run async def main(): manager = InstanceManager() urls = [ "https://youtube.com/watch?v=video1", "https://youtube.com/watch?v=video2", "https://twitter.com/user/status/123456789", "https://www.tiktok.com/@user/video/123456789" ] # Download multiple files concurrently async for result in manager.download_generator( urls=urls, remux=True, min_file_size=1024, max_retries=3, only_path=False ): url, file_path, error = result if error: print(f"Failed to download {url}: {error}") else: print(f"Downloaded: {file_path}") # Or get just the file paths async for file_path in manager.download_generator(urls=urls, only_path=True): if file_path: print(f"Downloaded: {file_path}") run(main()) ``` -------------------------------- ### API Response Structure Source: https://github.com/nichind/pybalt/blob/main/README.md This JSON object represents the standard response from the pybalt API. It includes the task status, the resulting download URL, and metadata regarding the processing instance. ```json { "status": "tunnel", "url": "http://download-link.mp4", "instance_info": { "url": "https://instance-url.com" } } ``` -------------------------------- ### Perform Network Operations with HttpClient Source: https://context7.com/nichind/pybalt/llms.txt Utilizes the HttpClient class to perform asynchronous HTTP requests, handle bulk operations, and manage file downloads with progress tracking. ```python from pybalt.core.network import HttpClient from asyncio import run async def main(): client = HttpClient(timeout=30, proxy="http://proxy:8080", auto_detect_proxy=True, debug=True) response = await client.get("https://api.example.com/data") file_path = await client.download_file( url="https://example.com/video.mp4", folder_path="/downloads", status_callback=lambda **kwargs: print(f"Progress: {kwargs.get('downloaded_size')}") ) run(main()) ``` -------------------------------- ### Cobalt CLI: Check Local Instance Status Source: https://github.com/nichind/pybalt/blob/main/README.md Checks the current running status of the local Cobalt instance managed via Docker. Useful for verifying if the instance is active. ```sh cobalt -lstatus ``` -------------------------------- ### Cobalt CLI: Remove Instance Source: https://github.com/nichind/pybalt/blob/main/README.md Removes a configured Cobalt instance by its index. The index can be found when listing instances with '-li'. ```sh cobalt -ri 1 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.