Download video from YouTube, Twitter (X), Instagram, Reddit, Twitch, Bilibili & more. CLI & python module for @imputnet's cobalt processing instance api.
Project description
pybalt
pybalt is a powerful and flexible tool for downloading media files from various platforms, including but not limited to YouTube, X (formerly Twitter), Reddit, Instagram, and TikTok. It works using cobalt processing instances and serves both as a CLI and a Python module.
- Download media files to your desktop effortlessly using pybalt as a command-line interface, with support for downloading playlists and links from text files.
- Integrate pybalt into your Python projects with ease with just 2 lines of code.
- Easily replace and build custom code extensions to suit your needs.
https://github.com/user-attachments/assets/cf5fd9a9-520b-4970-b8c2-42baa80d7523
⚙️ Installation
install pybalt with pip
pip install pybalt -U
or install pybalt on windows with the bat file included in the repo (if you dont have python installed)
- Open powershell or cmd with the administator rights (to allow pip create aliases
cobalt
andpybalt
in the terminal) - Type this command
powershell -Command "Invoke-WebRequest -Uri https://raw.githubusercontent.com/nichind/pybalt/main/install.bat -OutFile install.bat; .\install.bat"
⚡️ Quickstart
[!NOTE] pybalt will auto-detect if you are hosting a local cobalt-api instance and will try to use it first instead of instances from public instance list and my fallback one.
[!NOTE] if alias
cobalt
isn't working for you in the terminal usepython -m pybalt <command>
instead.
[!CAUTION] Remuxing (
-r
) requires for ffmpeg to be installed on your device and being in system path.
The cli part of this project is very intuitive and easy to-use! Let's see a few examples:
- Download video from YouTube in maximum resolution possible (
-vQ max
) and then remux it (-r
).
cobalt "https://youtube.com/watch?v=DG2QqcHwNdE" -r -vQ max
- Remux video on your device
cobalt "C://Users/nichind/Videos/video.mp4" -r
- Download videos from the links in the text file
cobalt "c://Users/nichind/Desktop/very-important.txt"
View all possible arguments using
-h
, pass them accordingly to the api docs
💻 Integrate to your project
pybalt originally comes as-a python module, integrating pybalt into your project is just 2 lines of code:
from pybalt import download
from asyncio import run
async def main():
path = await download("your-video-url", filenameStyle="pretty", remux=True, youtubeHLS=False, videoQuality="1080", status_parent=status)
print(path)
run(main())
you can also construct custom Cobalt
instance.
from pybalt import Cobalt
cobalt = Cobalt(debug=True, proxy="http://...", user_agent="idk :)")
# then use await cobalt.download(url) to download
run detached download and monitor progress using StatusParent
from pybalt import StatusParent
status = StatusParent() # You can use default python dict instead of StatusParent!
run_detached(await download(url, status_parent=status)) # run detached with your own logic
while not status.completed:
print(f"Still downloading... size: {status.downloaded_size}, time passed: {status.time_passed}")
print(f"download finished: {status.file_path}")
disable print info
await download(url, status_callback=None, done_callback=None) # You can replace callbacks with your custom sync/async funcion!
👥 Used by
pybalt is used by the following projects:
- download.nichind.dev - Website for downloading media files from various platforms
👥 Contributors
🌟 That's it!
I spent too much time on this project... please consider leaving a :star: if you like it!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pybalt-2025.1.1.tar.gz
.
File metadata
- Download URL: pybalt-2025.1.1.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e72cd5ae52605a62299ef7447a5a622f4fc9b824e0a74dc82833beb8addb16 |
|
MD5 | 42b5aa884cb2fe17195b2704ccc49c83 |
|
BLAKE2b-256 | 0b2479fb434bc9623240144003c378bf6bdeb03a20979b9016b3124415ad228c |
Provenance
The following attestation bundles were made for pybalt-2025.1.1.tar.gz
:
Publisher:
publish.yml
on nichind/pybalt
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pybalt-2025.1.1.tar.gz
- Subject digest:
c6e72cd5ae52605a62299ef7447a5a622f4fc9b824e0a74dc82833beb8addb16
- Sigstore transparency entry: 163337093
- Sigstore integration time:
- Permalink:
nichind/pybalt@8fde51a50bcb886210cea5c6a20bc71c247feab0
- Branch / Tag:
refs/tags/2025.1.1
- Owner: https://github.com/nichind
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish.yml@8fde51a50bcb886210cea5c6a20bc71c247feab0
- Trigger Event:
release
- Statement type:
File details
Details for the file pybalt-2025.1.1-py3-none-any.whl
.
File metadata
- Download URL: pybalt-2025.1.1-py3-none-any.whl
- Upload date:
- Size: 23.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31a140abdfc956fca260d7f7ff09ec5088dbe6bae9a785105713a897a0b556f8 |
|
MD5 | 5b44eede06461095471f6cf1f4bc8992 |
|
BLAKE2b-256 | 05f7cfe5d11b3c1722a31b7194383a89f8ebf3d62815441b57b32ea6c3ff1282 |
Provenance
The following attestation bundles were made for pybalt-2025.1.1-py3-none-any.whl
:
Publisher:
publish.yml
on nichind/pybalt
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pybalt-2025.1.1-py3-none-any.whl
- Subject digest:
31a140abdfc956fca260d7f7ff09ec5088dbe6bae9a785105713a897a0b556f8
- Sigstore transparency entry: 163337095
- Sigstore integration time:
- Permalink:
nichind/pybalt@8fde51a50bcb886210cea5c6a20bc71c247feab0
- Branch / Tag:
refs/tags/2025.1.1
- Owner: https://github.com/nichind
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish.yml@8fde51a50bcb886210cea5c6a20bc71c247feab0
- Trigger Event:
release
- Statement type: