Yt2Cli
A simple command-line (CLI) tool for searching and playing YouTube videos directly from the terminal, without needing to open a browser.
Features
- Search YouTube videos by keyword
- Display search results (title + channel)
- Play any video from the list through an external player
- Cross-platform: works on Windows, macOS, and Linux
Requirements
1. Python
Recommended version: Python 3.10 or older (to avoid compatibility issues with some packages).
2. mpv for video playback (optinal)
The app relies on mpv as the default player. If it's not installed, the app will fall back to opening the link with the system's default application.
Installing mpv:
| OS | Command |
|---|---|
| Fedora | sudo dnf install mpv |
| Ubuntu / Debian | sudo apt install mpv |
| macOS (Homebrew) | brew install mpv |
| Windows | Download from mpv.io |
Installation
pip install yt2cli
Usage
yt2cli
Available Commands
| Command | Description |
|---|---|
search <query> :limit |
Search for YouTube videos |
list |
Show the currently loaded videos from the last search |
open <id> |
Play a video from the list by its number |
clear |
Clear the terminal screen |
help |
Show a list of available commands |
exit |
Close the app |
Example
Yt2Cli Run: search python tutorial
0-Python Basics , BY CHANNEL [Programming Academy]
--------------------
1-Learn Python for Beginners , BY CHANNEL [Code Channel]
--------------------
Yt2Cli Run: open 0
Project Structure
yt2cli/
├── __init__.py # App export entry point
├── App.py # Core logic and command handling
├── Backend.py
├── Player.py
└── cli.py # Entry point
Notes
- The app uses yt-dlp to search and extract video playback URLs.
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yt2cli-0.1.1.tar.gz.
File metadata
- Download URL: yt2cli-0.1.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.15 Linux/7.1.6-201.fc44.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9192ac4fcd39cde3de5bd99752ed936b946f05ff8e25c4e867bd1eaf3c466b1
|
|
| MD5 |
b3b146bf0b2a321f5aa9068c712c174b
|
|
| BLAKE2b-256 |
fff72e72db4e5ba807e65ada14c191f09be359edaa58e310c6d1f0bdb192adb4
|
File details
Details for the file yt2cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: yt2cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.15 Linux/7.1.6-201.fc44.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45fe8f645a41cce50abba406cc693a939dd7c86395782f2ba2c5a63485e50e8e
|
|
| MD5 |
1911333fce483756a701ce74c2f6bbca
|
|
| BLAKE2b-256 |
15e424704ecbc1931c98c053ec9c0745d05bfdfb01684ff8af16094014b5ef82
|