npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ytcog-dl

v1.1.1

Published

CLI for ytcog - YouTube innertube library; session, searches, channels, playlists, videos and downloads.

Downloads

13

Readme

ytcog-dl

NPM GitHub release (latest SemVer)

A command line interface (CLI) for ytcog, the YouTube innertube class library for node-js.

From the command line you can:

  • Download videos from ids/urls or batch downloads from search, channel or playlist results
  • Obtain video information
  • Output a stream summary to help choose specific download streams
  • Save search results: videos, playlists, channels, movies
  • Save channel information and videos, playlists, related channels, or channel search results
  • Save playlist information and videos or convert your favorite playlist to an mp3/flac audio library.

Each command line request represents a completed session. If you need the added efficiency of a maintained session, you can use the ytcog innertube library directly.

Usage

In general:

> ytcog-dl [action] [id id id ...] [options]

Actions

--download      -d    download one or more specified video(s), or batch download videos from channel, playlist or search results. (default)
--help          -h    output useage/actions/options to console
--info          -i    fetch video/channel/playlist information - written to "_info.json" and "_raw_info.json" files.  
                      (raw: as supplied by youtube)
--result        -r    fetch search/channel/playlist results - written to "_results.json" and "_raw_results.json" files.
                      (raw: as supplied by youtube)
--streamInfo    -s    output stream summary of video(id) to the console (assists stream selection)

General Options

--cookie        -c string - provide a logged-in YouTube cookie string - default: ''
--proxy         -x string - provide a proxy agent Uri - i.e "http://127.0.0.1:8000"
--save          -S all|info|raw|none - retrieved data save options 
                    * all                   - save ytcog and raw yt generated json files
                    * info                  - save ytcog generated json files only
                    * raw                   - save raw yt generated json files only
                    * none                  - save nothing  
--saveFilename  -sf string - supply a filename without path or extension - you use any video/search/channel/playlist
                    properties as templates in the string. For example:
                    ${author} ${date} ${datetime} ${id} ${timestamp} ${title} etc...
                    Each request type has an appropriate default.
--savePath      -sp string - data save path - defaults to '.' the current directory 
--userAgent     -u string - user agent string - default: one is chosen for you

See the ytcog wiki for lists of video/search/channel/playlist properties.

Video Downloads

> ytcog-dl --download id [id id ... ][options]
> ytcog-dl -d id [id id ... ][options]

id (string) is either an 11 character YouTube video id or a video watch url.
options (object) any of the video download options

Video Information

> ytcog-dl --info id [id id ... ][options]
> ytcog-dl -i id [id id ... ][options]

id (string) is either an 11 character YouTube video id or a video watch url.
options (object) any of the video information options

Video Stream Summary

Prints a concise list of available streams for a video to the console. The order is determined by an algorithm based on your preferences.

> ytcog-dl --streamInfo id [id id ... ][options]
> ytcog-dl -s id [id id ... ][options]

id (string) is either an 11 character YouTube video id or a video watch url.
options (object) any of the video stream summary options

See Video examples

Channel information

Collects channel metadata and properties and saves the data.

> ytcog-dl --info id [id id ... ][options]
> ytcog-dl -i id [id id ... ][options]

id (string) is either a 24 character YouTube channel id (commencing 'UC') or a channel url.
options (object) any of the channel information options

Channel results

Collects detailed lists of videos, playlists, and related channels and allows you to search a channel.

> ytcog-dl --result id [id id ... ][options]
> ytcog-dl --r id [id id ... ][options]

id (string) is either a 24 character YouTube channel id (commencing 'UC') or a channel url.
options (object) any of the channel result options

Channel downloads

Batch download videos from a channel.

> ytcog-dl --download id [id id ... ][options]
> ytcog-dl -d id [id id ... ][options]

id (string) is either a 24 character YouTube channel id (commencing 'UC') or a channel url.
options (object) any of the channel download options

See Channel examples

Playlist information

Collects metadta and properties of a playlist.

> ytcog-dl --info id [id id ... ][options]
> ytcog-dl -i id [id id ... ][options]

id (string) is either a 34 character YouTube channel id (commencing 'PL') or a playlist url.
options (object) any of the playlist information options

Playlist results

Collects video results from a playlist.

> ytcog-dl --result id [id id ... ][options]
> ytcog-dl -r id [id id ... ][options]

id (string) is either a 34 character YouTube channel id (commencing 'PL') or a playlist url.
options (object) any of the playlist result options

PLaylist downloads

Batch download videos from a playlist.

> ytcog-dl --download id [id id ... ][options]
> ytcog-dl -d id [id id ... ][options]

id (string) is either an 34 character YouTube channel id (commencing 'PL') or a playlist url.
options (object) any of the playlist download options

See Playlist examples

Search results

> ytcod-dl --result [options]
> ytcod-dl -r [options]

options (object) any of the search result options

Search downloads

> ytcod-dl --download [options]
> ytcod-dl -d [options]

options (object) any of the search download options

See Search examples

Installation

> npm install -g ytcog-dl