CmdTube is a Python CLI library for searching, downloading, and watching YouTube tutorials

Overview

CmdTube

CmdTube Logo

CmdTube is a Python CLI library for searching, downloading, and watching YouTube tutorials. This library was made with programmers in mind and it's dedicated to every programmer who watches YouTube videos to become better.

Table of Contents

Installation

Use pip/pip3 to install from PyPI

$ pip install cmdtube

You can also use Python from your command prompt

$ python -m pip install cmdtube

Lastly, to install from GitHub (ensuring that Git has been added to PATH), do:

$ python -m pip install git+https://www.github.com/Samuel-HSSP/cmdtube

Features

  1. Search for a YouTube video
  2. Watch a YouTube video on your browser
  3. Download a YouTube video
  4. Download a YouTube playlist
  5. Get information about a YouTube video
  6. Download a YouTube video as an audio

Usage

With CmdTube, you can download any YouTube programming tutorial you want, over a few commands. The following section of the documentation is to guide you on how to use CmdTube. Here is how you should initialize cmdtube:

>>> from cmdtube import cmdtube
...
# To search YouTube for 'How to debug without Stack Overflow'
CMDTube> cmdtube -search How to debug without Stack Overflow

Get Information about a YouTube Video

To get information about a YouTube video, use the syntax given below. This command returns the following information:

  1. Title
  2. Views
  3. Publish Date
  4. Length
  5. Author
  6. Keywords
  7. Channel URL
  8. Description
Usage: cmdtube [-i INFO]

Positional argument:
  -i INFO, -info INFO
                        get information about the video using its URL.

Search YouTube Videos

To search YouTube for videos, use the following syntax:

Usage: cmdtube [-s SEARCH_QUERY] [-r RESULTS]

Positional arguments:
  -s SEARCH_QUERY, -search SEARCH_QUERY
                        search YouTube for desired query

optional arguments:
  -r RESULTS, --results RESULTS
                        The maximum number of results to display.
                        For now, the default value is 10 and maximum is 19.

You can also use the pipeline feature to watch a video from the search results.

Usage: cmdtube [-s SEARCH_QUERY] [-r RESULTS] | cmdtube [-w WATCH]

Positional arguments:
  -s SEARCH_QUERY, -search SEARCH_QUERY
                        search YouTube for desired query
  -w WATCH, -watch WATCH
                        the index of the video to watch, from the displayed
                        search result. It should not be more than the total
                        number of videos from the search results.
                        To watch the first video, use 1.
Optional arguments:
  -r RESULTS, --results RESULTS
                        The maximum number of results to display.
                        This determines the index of the video to download. It
                        must not be greater than the maximum number of results.
                        For now, the default value is 10 and maximum is 19

If you want to download a video from the search results, follow the syntax below:

Usage: cmdtube [-s SEARCH_QUERY] [-r RESULTS] | cmdtube [-d DOWNLOAD]

Positional arguments:
  -s SEARCH_QUERY, -search SEARCH_QUERY
                        search YouTube for desired query
  -d DOWNLOAD, -download DOWNLOAD
                        the index of the video to download, from the displayed
                        search results. It should not be more than the total
                        number of videos from the search results.
                        To download the first video, use 1.
                        Note that it will always download the highest resolution
                        of the video. More functionalities will be added later.
Optional arguments:
  -r RESULTS, --results RESULTS
                        The maximum number of results to display.
                        This determines the index of the video to download. It
                        must not be greater than the maximum number of results.
                        For now, the default value is 10 and maximum is 19

Finally, you can get the information about a video from the list of search results.

Usage: cmdtube [-s SEARCH_QUERY] [-r RESULTS] | cmdtube [-i INFO]

Positional arguments:
  -s SEARCH_QUERY, -search SEARCH_QUERY
                        search YouTube for desired query
  -i INFO, -info INFO
                        the index of the video from the displayed
                        search results. It should not be more than the total
                        number of videos from the search results.
                        To get information about the second video shown in the
                        search result, use 2.

Optional arguments:
  -r RESULTS, --results RESULTS
                        The maximum number of results to display.
                        This determines the index of the video to download. It
                        must not be greater than the maximum number of results.
                        For now, the default value is 10 and maximum is 19

Download YouTube Videos and Playlists

To download a YouTube video or playlist into the current working directory, follow the syntax below:

Usage: cmdtube [-d DOWNLOAD] [-t TYPE] [-f FORMAT] [-res RESOLUTION]

Positional arguments:
  -d DOWNLOAD, -download DOWNLOAD
                        URL for video or playlist to download
  -t TYPE, -type TYPE
                        could be either `video` or `playlist`

Optional arguments:
  -f FORMAT, -format FORMAT
                        video format to download. Could be one of `mp4` and `3gp`.
                        More video formats will be supported in future versions
                        By default, it will download the mp4 format.
  -res RESOLUTION, -resolution RESOLUTION
                        resolution of the video to download.
                        Ex: 360p, 480p, 720p, 1080p, highest, lowest
                        If highest, it will download the video in the highest resolution.
                        Otherwise (if lowest), it will download the video in the lowest
                        resolution.
                        By default, it downloads the video in the highest resolution.

You can also download a single video or all the videos in a playlist as audio.

Usage: cmdtube [-d DOWNLOAD] [-t TYPE]

Positional arguments:
  -d DOWNLOAD, -download DOWNLOAD
                        URL for video or playlist to download
  -t TYPE, -type TYPE
                        must either be `audio` or `playlist-audio` here

To-Do

  • Download files to specified paths
  • Show progress bars for videos downloading
  • Show more information about commands
  • Proper documentation
  • Command to show full/minimal information about a video
  • Save command output to text file
  • Download captions for videos
  • Add support for more video and audio formats
  • Proper organization of code files
  • Fix all the bugs, and probably add more

Other Libraries

PyTube - Python 3 library for downloading YouTube Videos.

Installation

pip install pytube

YoutubeSearch - Perform YouTube video searches without the API

Installation

pip install youtube-search

PS: This is my first Python library I launched on my birthday, it's not perfect! :)

Owner
Samuel Ayomide Ogunleke
Samuel is a Mobile App Developer and Data Scientist. He writes code to solve problems and he uses his knowledge and skills to help people with their problems.
Samuel Ayomide Ogunleke
A dec-bin converter uses 2's complement.

2's Complement Dec-Bin Converter A dec-bin converter uses 2's complement. Visit my Medium Post. What is 2's complement? Two's complement is the most c

C.H Jacky 9 Mar 01, 2022
CLI client for FerrisChat

A CLI Client for @FerrisChat using FerrisWheel

FerrisChat 2 Apr 01, 2022
argofloats: Simple CLI for ArgoVis and Argofloats

argofloats: Simple CLI for ArgoVis and Argofloats Argo is an international program that collects information from inside the ocean using a fleet of ro

Samapriya Roy 2 Feb 13, 2022
🕰 The command line tool for scheduling Python scripts

hickory is a simple command line tool for scheduling Python scripts.

Max Humber 146 Dec 07, 2022
Themes for Windows Terminal

Windows Terminal Themes Preview and copy themes for the new Windows Terminal. Use the project at windowsterminalthemes.dev How to use the themes This

Tom 1.1k Jan 03, 2023
A simple note taker CLI program written in python

note-taker A simple note taker program written in python This allows you to snip your todo's, notes, and your tasks easily without extra charges Requi

marcusz 4 Nov 02, 2021
'rl_UK' is an open-source command-line tool in Python for calculating the shortest path between BUS stop sequences in the UK

'rl_UK' is an open-source command-line tool in Python for calculating the shortest path between BUS stop sequences in the UK. As input files, it uses an ATCO-CIF file and 'OS Open Roads' dataset from

Nesh P. 0 Feb 16, 2022
Generate folder trees directly from the terminal.

Dir Tree Artist 🎨 🌲 Intro Easily view folder structure, with parameters to sieve out what you want. Choose to exclude files from being viewed (.git,

Glenda T 0 May 17, 2022
AlienFX is a CLI and GUI utility to control the lighting effects of your Alienware computer.

AlienFX is a Linux utility to control the lighting effects of your Alienware computer. At present there is a CLI version (alienfx) and a gtk GUI versi

Stephen Harris 218 Dec 26, 2022
Helicopter animation in terminal

helicopter-helicopter Helicopter animation in terminal (scroll down for instructions) Why does this exist? It's because of a meme Click for details Se

Wasi Master 7 Mar 14, 2022
Stream comments, submissions from subreddits and users across reddit right in your terminal

reddit_from_terminal stream comments, submissions from subreddits and users across reddit right in your terminal Alert! : Can't watch media contents(p

Pritam Dhara 2 Dec 30, 2021
This is a CLI utility that allows you to view RedFlagDeals.com on the command line.

RFD Description Motivation Installation Usage View Hot Deals View and Sort Hot Deals Search Advanced View Posts Shell Completion bash zsh Description

Dave G 8 Nov 29, 2022
swarmexec executes command in swarm service

Swarmexec swarmexec executes command in swarm service Install pip install git+https://github.com/filimon43g/swarmexec.git Config In swarm_config.ini

Phil 2 Nov 23, 2021
Key-control - A tool for add keys to your Termux app

Key-Control Is a tool for add keys to your Termux app. Cara Penginstalan $ pkg u

Beereva.id 1 Feb 14, 2022
Wik is use to get information about anything on the shell using Wikipedia.

WIK wik is a tool to view wikipedia pages from your terminal. It also let you search for any wikipedia up to date article on one query from your termi

Yash Singh 340 Dec 18, 2022
xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt.

xonsh xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt. The language is a superset of Python 3.6+ with additio

xonsh 6.7k Jan 08, 2023
bsp_tool provides a Command Line Interface for analysing .bsp files

bsp_tool Python library for analysing .bsp files bsp_tool provides a Command Line Interface for analysing .bsp files Current development is focused on

Jared Ketterer 64 Dec 28, 2022
CLI Utility to encode and recursively recreate directories with ffmpeg.

FFenmass CLI Utility to encode and recursively recreate directories with ffmpeg. Report Bug · Request Feature Table of Contents Getting Started Prereq

George Av. 8 May 06, 2022
The project help you to quickly build layouts in terminal,cross-platform

The project help you to quickly build layouts in terminal,cross-platform

gojuukaze 133 Nov 30, 2022
CLI tool to show the current crypto balance

CryptoBoard The simple python CLI tool for one currency to show the current crypto balance yours purchases. That's all. Data source is from https://ww

John 2 Nov 18, 2021