Skip to main content

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.11 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

poetry run yt2cli

Available Commands

Command Description
search <query> 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

yt2cli-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yt2cli-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file yt2cli-0.1.0.tar.gz.

File metadata

  • Download URL: yt2cli-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 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

Hashes for yt2cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6a86ad815df7f2cbe99b1fe10ed70480beb96a8561d6a7dc632477a5cd3080e4
MD5 e772bc30a91c0c2e9e8b9e772c473ce1
BLAKE2b-256 eade6b7ae3b8c32d5035b6fe7b03a397a2027ed709323f93c4e2ce2bc3f2c072

See more details on using hashes here.

File details

Details for the file yt2cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: yt2cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 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

Hashes for yt2cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28bfc56e450471e8573f711d8f9471f0c0a9bf54ed569b0e504654f6e9098a6c
MD5 2df1fbf93f7f6e3d3ee7acbe66575d14
BLAKE2b-256 f8c3eead0bf7b2127a42106c8dcf408bf9001cb7bddf78e2f914e852b2096a34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page