Package: cmdtube
CmdTubeCmdTube 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.
Please visitherefor a better documentation.Table of ContentsInstallationFeaturesUsageTo-DoOther LibrariesInstallationUse pip/pip3 to install from PyPI$ pip install cmdtubeYou can also use Python from your command prompt$ python -m pip install cmdtubeLastly, to install from GitHub (ensuring that Git has been added to PATH), do:$ python -m pip install git+https://www.github.com/Samuel-HSSP/cmdtubeFeaturesSearch for a YouTube videoGet information about a YouTube videoWatch a YouTube video on your browserDownload a YouTube videoDownload a YouTube playlistDownload a YouTube video as audioDownload a whole YouTube playlist as audioDownload the captions/subtitles for any video in almost any language.UsageWith 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 (then run the code file):>>>fromcmdtubeimportcmdtube...# To search YouTube for 'How to debug without Stack Overflow' (I hope that's possible)CMDTube>cmdtube-s"How to debug without Stack Overflow"Search YouTube VideosTo search YouTube for videos, use the following syntax:Usage: cmdtube [-s SEARCH_QUERY] [-r RESULTS]

Positional arguments:
  -s SEARCH_QUERY (type: str)
                        Search YouTube for desired query. Make sure you put the
                        search query in quotes, else it wouldn't work.

Optional arguments:
  -r RESULTS (type: int)
                        The maximum number of results to display.
                        For now, the default value is 10 and maximum is 19.# The following command displays 5 results from the search.CMDTube>cmdtube-s"How to make a robot at home"-r5Get Information about a YouTube VideoTo get information about a YouTube video, use the syntax given below.
This command returns the following information:TitleViewsPublish DateLengthAuthorKeywordsChannel URLDescriptionUsage: cmdtube [-i INFO]

Positional argument:
  -i INFO (type: str or int)
                        Get information about the video using its URL or the index of
                        the video from the list of videos from the search results.
                        Make sure to put the URL in quotes.
                        You can only use the index of the video, only after you've
                        once run a search command.# Gets the info about the third YouTube video from the search resultsCMDTube>cmdtube-i3# Gets the info about the YouTube video via its linkCMDTube>cmdtube-i"https://www.youtube.com/watch?v=_nbVTUYVKxg"Watch a YouTube Video or Playlist from the browserTo watch any YouTube video on your default browser, use the following syntax:Usage: cmdtube [-w WATCH]

Positional arguments:
  -w WATCH (type: str or int)
                        Watch a YouTube video with the URL or the index from
                        the search results. Make sure you put the URL in
                        quotes, else it wouldn't work.
                        You can only use the index of the video, only after you've
                        once run a search command.# Opens the second YouTube video from the search results on your browserCMDTube>cmdtube-w2# Opens the YouTube video link on your browserCMDTube>cmdtube-w"https://www.youtube.com/watch?v=_nbVTUYVKxg"Download YouTube Videos and PlaylistsTo download a YouTube video or playlist into the current working directory or a specified path,
follow the syntax below:Usage: cmdtube [-d DOWNLOAD] [-t TYPE] [-p PATH] [-res RESOLUTION] [--audio AUDIO]

Positional arguments:
  -d DOWNLOAD
                        URL for video or playlist to download or the index of the 
                        video from the search results. Make sure you put the URL in
                        quotes, else it wouldn't work.
                        You can only use the index of the video, only after you've
                        once run a search command.

Optional arguments:
  -t TYPE (type: str)
                        Could either be "video" or "playlist". It's set to "video"
                        by default.

  -p PATH (type: str)
                        Path or directory to download the video into. If not set, it saves
                        the video (or audio) to the current working directory.
  
  -res RESOLUTION (type: str)
                        The resolution of the video to download.
                        Ex: "144p", "240p", "360p", "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 480p resolution.

  --audio AUDIO (no value)
                        This is a flag, which downloads the video or the whole playlist
                        as audio, if set.
                        Just add --audio to the end of your command and it will download
                        as audio. When downloading as audio, the resolution argument does
                        nothing.# Downloads the second YouTube video (from the search results) to the current directory in 480pCMDTube>cmdtube-d2# Downloads all the videos in the playlist in 360p resolutionCMDTube>cmdtube-d"https://www.youtube.com/playlist?list=PLtIIVgC7Q8mAH9HFQJIEQ02rd7ndExDc8"-t"playlist"-res"360p"# Downloads all the videos in the playlist as audioCMDTube>cmdtube-d"https://www.youtube.com/playlist?list=PLtIIVgC7Q8mAH9HFQJIEQ02rd7ndExDc8"-t"playlist"--audioDownload Transcripts for YouTube VideosTo download the transcript for any YouTube video in almost any language, follow the syntax below:Usage: cmdtube [-t TRANSCRIPT] [-l LANGUAGE] [--show-list SHOW_LIST]

Positional arguments:
  -t TRANSCRIPT
                        URL for video transcript (YouTube video link) to download or the index of the 
                        video from the search results. Make sure you put the URL in quotes, else it
                        wouldn't work.
                        You can only use the index of the video, only after you've
                        once run a search command.

Optional arguments:
  -l LANGUAGE (type: str)
                        The language code of the transcript to download. The default language is "en".

  --show-list SHOW_LIST (no value)
                        This is a flag, which shows a list of available transcripts to download, if set.
                        It also shows the list of languages you can translate the transcript to.
                        Just add --show-list to the end of your command and it will show the 
                        required information alongside downloading the transcript in the language you set.# Downloads the transcript for the second YouTube video (from the search results)CMDTube>cmdtube-t2# Downloads the transcript for the video and displays the available transcriptsCMDTube>cmdtube-t"https://www.youtube.com/watch?v=_nbVTUYVKxg"-l"fr"--show-listTo-DoDownload files to specified pathsShow progress bars for videos downloadingShow more information about commandsProper documentationCommand to show full/minimal information about a videoSave command output to text fileDownload captions for videosAdd support for more video and audio formatsProper organization of code filesFix all the bugs, and probably add moreOther LibrariesPyTube- Python 3 library for downloading YouTube Videos.Installationpip install pytubeYoutubeSearch- Perform YouTube video searches without the APIInstallationpip install youtube-searchYoutubeTranscriptAPI- Get transcripts for YouTube videosInstallationpip install youtube-transcript-apiPS: This is my first Python library I launched on my birthday, it's not perfect!
However, this is the second version released on Christmas day, so it's much better than the older version. :)