Skip to content

blithersoup/commandline-yt-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI Youtube Client

Intro

This is a program to search and watch youtube from the command line. While this works as described, I made this mostly to learn about CLIs with python and regex.

Uses-

  • Click
  • PyInstaller
  • MPV

Idea

I originally intended to use the Youtube Data API, but considering that the idea required very little data from youtube, I considered other options. I soon found this article and adapted the code to allow for multiple search terms and return multiple video links and expanded the results for more functionality. Because I wanted to provide functionality for search within the command line, I searched the html code for returned videos and wrote regex to find the title and creator of the video (yes this is inefficient, but requires no api key).

Code

The code itself is relatively simple, and is built from one python file. As described above, the program takes in a search query and returns search results using regex on decoded source html from the videos. If the user chooses to select one, the selected video should open in a new window with mpv.

Usage

I have included an executable and .exe in /dist, which can be run with cmdytc/cli.exe [ARGUMENTS]

Using --help, usage is described below:

Usage: cli.exe [OPTIONS]

Options:
  -q, --query TEXT  Search query
  --help            Show this message and exit.

To build it yourself- run the following:

pip install --editable .
pyinstaller src/main/cli.py -F -n cmdytc

The executable should then be in /dist.

About

Youtube client in the command line

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages