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
🌈 Lightweight Python package that makes it easy and fast to print terminal messages in colors. 🌈

🌈 Colorist for Python 🌈 Lightweight Python package that makes it easy and fast to print terminal messages in colors. Prerequisites Python 3.9 or hig

Jakob Bagterp 1 Feb 05, 2022
A ZSH plugin that enables you to use OpenAI's powerful Codex AI in the command line.

A ZSH plugin that enables you to use OpenAI's powerful Codex AI in the command line.

Tom Dörr 976 Jan 03, 2023
A command line tool (and Python library) for archiving Twitter JSON

A command line tool (and Python library) for archiving Twitter JSON

Documenting the Now 1.3k Dec 28, 2022
A Command Line Error Parser Built using Python.

"Stalk Overflow with debuggy" Error Parser Everything is done in Python so it's extremely easy to install and use. Supports Python 3. Debuggy is used

Derhnyel 22 Nov 10, 2022
A CLI Password Manager made using Python and Postgresql database.

ManageMyPasswords (CLI Edition) A CLI Password Manager made using Python and Postgresql database. Quick Start Guide First Clone The Project git clone

Imira Randeniya 1 Sep 11, 2022
A command line tool that creates a super timeline from SentinelOne's Deep Visibility data

S1SuperTimeline A command line tool that creates a super timeline from SentinelOne's Deep Visibility data What does it do? The script accepts a S1QL q

Juan Ortega 2 Feb 08, 2022
CLI para o projeto Compilado (Newsletter e Podcast do Código Fonte TV)

Compilado CLI Automatização de tarefas através de linha de comando para a geração de assets para episódios do Compilado, a newsletter e podcast do can

Gabriel Froes 18 Nov 21, 2022
Bear-Shell is a shell based in the terminal or command prompt.

Bear-Shell is a shell based in the terminal or command prompt. You can navigate files, run python files, create files via the BearUtils text editor, and a lot more coming up!

MichaelBear 6 Dec 25, 2021
Python3 library for multimedia functions at the command terminal

TERMINEDIA This is a Python library allowing using a text-terminal as a low-resolution graphics output, along with keyboard realtime reading, and a co

Joao S. O. Bueno 89 Dec 17, 2022
Present - A terminal-based presentation tool with colors and effects.

present A terminal-based presentation tool with colors and effects. You can also play a codio (pre-recorded code block) on a slide. present is built o

Vinayak Mehta 4.2k Jan 03, 2023
Simple Python Library to display text with color in Python Terminal

pyTextColor v1.0 Introduction pyTextColor is a simple Python Library to display colorful outputs in Terminal, etc. Note: Your Terminal or any software

Siddhesh Chavan 1 Jan 23, 2022
A command line utility to export Google Keep notes to markdown.

Keep-Exporter A command line utility to export Google Keep notes to markdown files with metadata stored as a frontmatter header. Supports exporting: S

Nathan Beals 85 Dec 17, 2022
Generate an ASCII Art from keyword put in the cli

ascii-art-generator-cli Generate an ASCII Art from keyword put in the cli Install git clone https://github.com/Nathanlauga/ascii-art-generator-cli cd

Nathan Lauga 1 Nov 14, 2021
A powerful, colorful, beautiful command-line-interface for pypi.org

pypi-command-line pypi-command-line is a colorful, powerful, and beautiful command line interface for pypi.org that is actively maintained Detailed Do

Wasi Master 32 Jun 23, 2022
vimBrain is a brainfuck-based vim-inspired esoteric programming language.

vimBrain vimBrain is a brainfuck-based vim-inspired esoteric programming language. vimBrainPy Currently, the only interpreter available is written in

SalahDin Ahmed 3 May 08, 2022
A CLI password generator

passgen - A CLI password generator Usage python3 main.py arguments Arguments Argument Short Description --length -l The length of the password to ge

1 Nov 13, 2021
Module for converting 2D Python lists to fancy ASCII tables. Table2Ascii lets you display pretty tables in the terminal and on Discord.

table2ascii Module for converting 2D Python lists to a fancy ASCII/Unicode tables table2ascii 📥 Installation 🧑‍💻 Usage Convert lists to ASCII table

Jonah Lawrence 40 Jan 03, 2023
Tools hacking termux in the name ant-attack

Hello friends, I am ama.player0000. Web developer, software, Android command line (termux). (1)=Well, ant-attack tool is a tool to attack sites and disable them. (2)=You can use those CCTV servers, s

༺AMA.PLAYER༻ 1 Dec 17, 2021
CmdTube is a Python CLI library for searching, downloading, and watching YouTube tutorials

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 v

Samuel Ayomide Ogunleke 2 Aug 22, 2022
Format click help output nicely with rich.

rich-click Format click help output nicely with Rich. Click is a "Python package for creating beautiful command line interfaces". Rich is a "Python li

Phil Ewels 333 Jan 02, 2023