0.14.0 • Published 5 months ago

yt-play-cli v0.14.0

Weekly downloads
61
License
MIT
Repository
github
Last release
5 months ago

npm npm npm

yt-play-cli

play youtube videos ( sound only ) in the terminal using electron (and its bundled chromium)

npm.io

Simple to use

npm install -g yt-play-cli

# enter interactive search and select mode
yt-play

or

npm install -g yt-play-cli

# play known video id directly
yt-play rnQBF2CIygg

Node API

const ytp = require( 'yt-play-cli' )
ytp.play( 'Wkof3nPK--Y' )
ytp.on( 'duration', function ( time ) {
    console.log( time.text )
} )

ytp.once( 'end', function () {
    process.exit()
} )

About

Play youtube videos ( music only ) from the CLI using electron.

Uses yt-search and node-fzf to search for videos to play if no CLI videoId argument is provided.

Why

To test/try/play around with electron.

How

Using electron we simply go to the youtube page and play the video.. and attach some video event listeners and block ads.

The reason we use electron instead of puppeteer is because the chromium version that comes bundled with electron can play more media types ( e.g. h264 that some YouTube video's are encoded in ) that the chromium version that puppeteer comes with can't play ( e.g. https://www.youtube.com/watch?v=pFbkURxNKPE )

Using puppeteer-core we simply go to the youtube page and play the video.. and attach some video event listeners and block ads.

Leaving video id cli argument empty you will enter search and select mode using yt-search and node-fzf

Arguments

$ yt-play [youtube-video-id]

If no video id is provided you will enter interactive search and select mode.

Installation

npm install -g yt-play-cli

Test

Searches and plays a youtube video using the CLI

npm test
0.14.0

5 months ago

0.13.4

3 years ago

0.13.5

3 years ago

0.13.3

3 years ago

0.13.2

4 years ago

0.12.7

4 years ago

0.13.1

4 years ago

0.13.0

4 years ago

0.12.6

4 years ago

0.12.5

4 years ago

0.12.4

4 years ago

0.12.3

4 years ago

0.12.0

4 years ago

0.12.1

4 years ago

0.12.2

4 years ago

0.11.0

4 years ago

0.10.1

4 years ago

0.10.0

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

5 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago