Skip to content

Instantly share code, notes, and snippets.

@tpscrpt
Created April 10, 2019 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpscrpt/1f7999b7ffbb0796f1afa17c6d3b73bc to your computer and use it in GitHub Desktop.
Save tpscrpt/1f7999b7ffbb0796f1afa17c6d3b73bc to your computer and use it in GitHub Desktop.
const ytdl = require('youtube-dl')
const express = require('express')();
const { exec } = require('child_process')
const songPlayer = exec('ffplay -i pipe:0')
express.post('/song', (req, res) => {
req.on('data', (chunk) => {
songPlayer.stdin.write(chunk)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment