diff --git a/.gitignore b/.gitignore index 08e8372..bb92dfd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ Playback-win32.zip Playback.app Playback.app.zip .DS_Store +.idea diff --git a/playlist.js b/playlist.js index 5e666b9..41e4f11 100644 --- a/playlist.js +++ b/playlist.js @@ -10,6 +10,8 @@ var concat = require('concat-stream') var noop = function () {} +var allowedExts = ['mpg', 'mkv', 'mp4', 'mp3', 'vtt', 'srt'] + module.exports = function () { var that = new events.EventEmitter() @@ -141,6 +143,9 @@ module.exports = function () { file.length = st.size file.name = path.basename(link) + file.extension = file.name.split(".").pop().toLowerCase() + if (allowedExts.indexOf(file.extension) === -1) return cb("File format not supported") + file.createReadStream = function (opts) { return fs.createReadStream(link, opts) }