https://github.com/nichind/pybalt
☄️ Your ultimate tool & python module to download videos and audio from various platforms. Supports YouTube, Instagram, Twitter (X), Reddit, TikTok, BiliBili & More! Powered by cobalt instances
https://github.com/nichind/pybalt
bilibili-download cli cli-app cobalt cobalt-api cobalt-tools download-video downloader downloader-for-youtube instagram instagram-download python python-module reddit-downloader terminal-based twitter twitter-download x-downloader-video youtube youtube-download
Last synced: 22 days ago
JSON representation
☄️ Your ultimate tool & python module to download videos and audio from various platforms. Supports YouTube, Instagram, Twitter (X), Reddit, TikTok, BiliBili & More! Powered by cobalt instances
- Host: GitHub
- URL: https://github.com/nichind/pybalt
- Owner: nichind
- License: mit
- Created: 2024-10-26T19:35:37.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-04-29T12:01:18.000Z (about 1 month ago)
- Last Synced: 2025-04-29T13:22:33.049Z (about 1 month ago)
- Topics: bilibili-download, cli, cli-app, cobalt, cobalt-api, cobalt-tools, download-video, downloader, downloader-for-youtube, instagram, instagram-download, python, python-module, reddit-downloader, terminal-based, twitter, twitter-download, x-downloader-video, youtube, youtube-download
- Language: Python
- Homepage: https://pypi.org/project/pybalt/
- Size: 33.8 MB
- Stars: 19
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
pybalt
CLI tool and python module for downloading media through Cobalt processing instances.
[](https://pypi.org/project/pybalt/)
[](https://github.com/nichind/pybalt)
[](https://pypi.org/project/pybalt/)
[](https://github.com/nichind/pybalt)
[](https://github.com/astral-sh/ruff)
CLI Preview
https://github.com/user-attachments/assets/cf5fd9a9-520b-4970-b8c2-42baa80d7523
Installation
Install pybalt using PowerShell on Windows
Downloads [install.bat](./install.bat) and executes it.
```powershell
powershell -Command "Invoke-WebRequest -Uri https://raw.githubusercontent.com/nichind/pybalt/main/install.bat -OutFile install.bat; .\install.bat"
```Install using PIP
```shell
pip install pybalt
```This should create aliases `pybalt` and `cobalt` in your shell.
Try running `cobalt -h` to see the help message.
If for some reason it didn't work, try using it directly from python package:
```shell
python -m pybalt
```
Usage & Examples
Selecting processing instance
You can set **processing instance URL**, **API key**, and **user-agent** as environment variables; pybalt will use them if none are provided.
```
COBALT_API_URL=YOUR_INSTANCE_URL
COBALT_API_KEY=YOUR_API_KEY
COBALT_USER_AGENT=YOUR_USER_AGENT
```> By default, pybalt attempts to use any available instance for you provided by [public list of instances](https://instances.cobalt.best). It is recommended to host your own instance or request an `API key` from someone else's instance.
As a CLI
Every command here uses the `cobalt` alias; you can also use `pybalt` or `python -m pybalt`.
By default, all downloads are saved in the user's downloads folder `~/Downloads`, or the one specified by the `-f` (`-folder`) flag.
Get a list of all available commands by running:
```shell
cobalt -h
```
Download video from URL
```shell
cobalt -u 'https://youtube.com/watch?v=8ZP5eqm4JqM'
```You can also provide the URL as a positional argument:
```shell
cobalt 'https://youtube.com/watch?v=8ZP5eqm4JqM'
```
Download YouTube playlist
```shell
cobalt -pl 'https://youtube.com/playlist?list=PL_93TBqf4ymR9GsuI9W4kQ-G3WM7d2Tqj'
```
Download from text file
Create a text file with URLs on each line:
```txt
https://youtube.com/watch?v=8ZP...
.....
....
...
```Then run:
```shell
cobalt -l 'path/to/file.txt'
```
More examples
Download all videos from a YouTube playlist in `720p` to folder `/Music/`, with filename style `classic`, using instance `https://dwnld.nichind.dev` and `API key` authorization:
```shell
cobalt -pl 'https://youtube.com/playlist?list=PL_93TBqf4ymR9GsuI9W4kQ-G3WM7d2Tqj' -q 720 -f './Music/' -fs 'classic' -i 'https://dwnld.nichind.dev' -k 'YOUR_API_KEY'
```
As a module
Download video from URL
```python
from pybalt import Cobalt
from asyncio import runasync def main():
cobalt = Cobalt()
path = await cobalt.download('https://youtube.com/watch?v=8ZP5eqm4JqM')
print('Downloaded: ', path) # Downloaded: /Users/%USER%/Downloads/8ZP5eqm4JqM.mp4run(main())
```You can pass arguments inside the Cobalt object:
```python
from pybalt import Cobalt
from asyncio import runasync def main():
cobalt = Cobalt(api_instance='YOUR_INSTANCE_URL', api_key='YOUR_API_KEY', headers={...})
path = await cobalt.download(url='https://youtube.com/watch?v=8ZP5eqm4JqM', quality='1080')
print('Downloaded: ', path) # Downloaded: /Users/%USER%/Downloads/8ZP5eqm4JqM.mp4run(main())
```
Contributing
If you have any questions or suggestions, please [open an issue](https://github.com/nichind/pybalt/issues) or [create a pull request](https://github.com/nichind/pybalt/pulls).
Contributors