Created
April 10, 2019 00:47
-
-
Save tpscrpt/1f7999b7ffbb0796f1afa17c6d3b73bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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