Add streamable.com support (#585)

This commit is contained in:
calzoneman 2016-08-02 22:35:00 -07:00
parent 6aebe82298
commit 88c42af139
6 changed files with 30 additions and 2 deletions

View file

@ -11,6 +11,7 @@ var mediaquery = require("cytube-mediaquery");
var YouTube = require("cytube-mediaquery/lib/provider/youtube");
var Vimeo = require("cytube-mediaquery/lib/provider/vimeo");
var Vidme = require("cytube-mediaquery/lib/provider/vidme");
var Streamable = require("cytube-mediaquery/lib/provider/streamable");
/*
* Preference map of quality => youtube formats.
@ -561,6 +562,20 @@ var Getters = {
"vm", video.meta);
process.nextTick(callback, false, media);
});
},
/* streamable */
sb: function (id, callback) {
if (!/^[\w-]+$/.test(id)) {
process.nextTick(callback, "Invalid streamable.com ID");
return;
}
Streamable.lookup(id).then(video => {
const media = new Media(video.id, video.title, video.duration,
"sb", video.meta);
process.nextTick(callback, false, media);
});
}
};

View file

@ -242,6 +242,8 @@
return id;
case "hb":
return "http://hitbox.tv/" + id;
case "sb":
return "https://streamable.com/" + id;
default:
return "";
}