New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

yt-play-cli

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yt-play-cli

play youtube videos with a headless browser

latest
Source
npmnpm
Version
0.16.0
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

npm npm npm

yt-play-cli

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

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

Keywords

yt-play

FAQs

Package last updated on 02 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts