Latest commit d0db1e6 Apr 24, 2017 @JamesKyburz 0.0.47
Failed to load latest commit information.
test standard path fix Feb 7, 2016
.gitignore git ignore npm-debug.log Feb 7, 2016
LICENSE Initial commit Aug 14, 2013 add node example close #94 Apr 23, 2017
collaborators.markdown Add collaborators Oct 30, 2015
index.js Added applyOptions Oct 30, 2015
package.json 0.0.47 Apr 24, 2017



This module streams youtube using ytdl to get the youtube download stream.

To convert to audio the module fluent-ffmpeg is used.

You will need to have ffmeg and the necessary encoding libraries installed, as well as in your PATH. If you're on OSX, this can be handled easily using Homebrew (brew install ffmpeg).

Getting Started

  1. With npm, run npm install youtube-audio-stream
  2. var youtubeStream = require('youtube-audio-stream')


Here is an example that:

  1. queries for a video by video ID
  2. Retrieves the audio via this package
  3. pipes it to res
var getAudio = function (req, res) {
  var requestUrl = '' + req.params.videoId
  try {
  } catch (exception) {

Node example playing directly to speaker

const stream = require('youtube-audio-stream')
const url = ''
const decoder = require('lame').Decoder
const speaker = require('speaker')



This package comes with a simple example for testing. This can be run with the command npm test, which will then serve the example at localhost:3000. The example consists of an <audio> component whose source is retrieved via this package.