tcobalt (or tcb) is a command-line tool for downloading your favorite videos and audios from the internet. This tool uses the api of wukko's cobalt.tools, which is an amazing website to save what you love without ads, trackers, or anything creepy.
Stop using random websites to download videos, just use cobalt.tools, or the unofficial command-line version, tcobalt.
- tcobalt allows you to download videos and audios just as easily as you can with cobalt.tools with
tcb get
- tcobalt also allows you to download multiple videos/audios at once with
tcb bulk get
andtcb bulk execute
- tcobalt allows some integration with other commands, by allowing a url to be piped into
tcb get +
- tcobalt includes all the settings that web cobalt has, along with a few extra features that will get extended in the future
- tcobalt gives methods to check cobalt's version and to list the supported services right from your terminal
- tcobalt has support for using a different cobalt api instance than the main one
- You can change the default tcobalt flags in a configuration file
- tcobalt's help method is easy to understand, and gives the option to list usage examples
- tcobalt supports single letter methods for lazy people
tcb g
,tcb b e
Basic downloading of a video
tcb get 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' -o rickroll.mp4
Downloading of a song with '.ogg' format and using the default filename
tcb get -af ogg 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
Shuffling a list of youtube links and downloading the first one as a .webm file
cat links.txt | shuf | head -n 1 | tcb get -c vp9 +
Downloading the same video twice, but with one being audio-only:
tcb bulk execute links.txt
https://www.youtube.com/watch?v=dQw4w9WgXcQ -o roll.mp4
https://www.youtube.com/watch?v=dQw4w9WgXcQ -ao silly-song.mp3
Downloading three coding videos at once with 720p resolution each
tcb bulk get -q 720 'https://www.youtube.com/watch?v=qclZUQYZTzg' 'https://www.youtube.com/watch?v=wvQCIMjlxHw' 'https://www.youtube.com/watch?v=3T3ZDquDDVg'
Full usage help is available with tcb help
, but can also be seen in the usage.txt and info.txt files
tcobalt also supports tcb --help
, tcb -h
, tcb --version
, and tcb -v
for people who have not read the help or this page
x86_64 and aarch64 are the only architectures supported, as I only own machines with those architectures. If you wish tcobalt added more support, open up an issue/pr.
- Arch Linux (AUR) (COMPLETE)
- Windows 10/11 (Prebuilt binary)
- Fedora
- Ubuntu (Prebuilt PKG)
The repos that contain tcobalt can be seen on the right, along with the highest version the repo has.
Arch Linux (pkg) | Ubuntu (pkg) | Linux | Windows |
---|---|---|---|
v1.2.1-1 x86_64 | v1.2.0 amd64 | v1.2.1 x86_64 | v1.2.1 x86_64 |
Use the AUR (aarch64) | v1.2.0 arm64 | v1.2.1 aarch64 | Unsupported (aarch64) |
- Install
yay
orparu
:sudo pacman -S base-devel git clone https://aur.archlinux.org/yay.git # or paru.git cd yay # or paru makepkg -si
- Use either
yay
orparu
to installtcobalt
:yay -S tcobalt
paru -S tcobalt
OR
Get it directly from the AUR without installing an AUR helper:
sudo pacman -S base-devel
git clone https://aur.archlinux.org/tcobalt.git
cd tcobalt
makepkg -si
OR
- Download the pkg from the above prebuilt binaries (or use cURL)
- Open a terminal and navigate to the directory containing the donwloaded .pkg.tar.zst file
- Run the following command (replacing the fields in the angle brackets as necessary)
sudo pacman -U tcobalt-<version>-<rel>-<arch>.pkg.tar.zst
The PKGBUILD declares that this only supports x86_64, but since it builds from source, yay/paru will allow you to install tcobalt on any architecture
This process will also work on arch-based distros
Packaging to a PPA has literally no good documentation online, and the official Ubuntu website for it has LITERALLY NO TEXT ON IT (its undergoing maintenance). Debian docs and launchpad docks also suck. You are stuck with this process until I feel like requesting tcobalt to be added to the official Ubuntu repositories. I won't bother with debian because they release stable updates every 2 years.
- Download the pkg from the above prebuilt binaries (or use cURL)
- Open a terminal and navigate to the directory containing the downloaded .deb file
- Run the following command (replacing the fields in the angle brackets as necessary)
sudo dpkg -i tcobalt-<version>-<arch>.deb
Download the .exe from the above prebuilt binaries, put it into any %PATH%
folder, and rename it to tcb.exe
I will figure out how to add tcobalt to winget-pkgs sometime in the future
You can try downloading the linux binary from the above prebuilt binaries, putting it into /usr/bin
, and renaming it to tcb
More support will come later. If you are on an unsupported operating system or architecture, or downloading a prebuilt binary didnt work, do this:
- Clone the repository
git clone https://github.com/khyerdev/tcobalt.git cd tcobalt
- Compile (make sure rust is installed and the default rust toolchain is also installed)
- On Linux:
make
- On Windows/MacOS:
cargo build --release
- On Linux:
- Install tcobalt
-
On Linux:
sudo make install
-
On Windows/MacOS:
Copy the tcobalt binary from
target/release
into a folder that has your PATH and rename it totcb
with the file extension corresponding to your OS (.exe
on windows)
-
tcobalt is designed to use as little dependencies as possible. Here are the ones it uses:
The tokio runtime, for easily handling asynchronous code
futures, for easily parralelizing bulk downloads
reqwest, for making web requests with HTTPS. Requires tokio to work
I have reinvented the wheel for things that are possible for me to do without dependencies, like parsing json
tcobalt is not original, and a few other projects have the same concept implemented in other languages. Check them out, see if you prefer them over this one.
- lostdusty/cobalt: Cobalt CLI written in golang
- lostdusty/gobalt: Golang library for the Cobalt API
- tskau/tobalt: Typescript library for the Cobalt API
This project is licensed under the GNU GPL v3, meaning you are allowed to freely use, modify, and distribute this project as long as you keep it as free and open-source as this project is, and as long as you include the same lisence and indicate your changes. More information about this license is here (fossa.com) and here (gnu.org).
Cobalt has granted permission for anyone to use the cobalt api in their personal perojects, and not for commercial use. tcobalt is a personal project of mine, and I am not affiliated with wukko in any way.
I would prefer if you credited my work when you share this.