Check for videos where embedding is disabled

This commit is contained in:
calzoneman 2013-09-29 21:32:04 -05:00
parent 8ba5743bc2
commit 69ac0b39ad
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,7 @@
Sun Sep 29 21:30 2013 CDT
* lib/get-info.js: Add an extra check to ytv2 to make sure embedding is
allowed. If not, send a queueFail.
Fri Sep 27 10:27 2013 CDT
* lib/channel.js: Change the link regex, change the way 'affects links'
works. The default link filter will only transform a link of no

View File

@ -91,6 +91,18 @@ module.exports = function (Server) {
try {
data = JSON.parse(data);
if (data.entry.yt$accessControl) {
var ac = data.entry.yt$accessControl;
for (var i = 0; i < ac.length; i++) {
if (ac[i].action === "embed") {
if (ac[i].permission === "denied") {
callback("Embedding disabled", null);
return;
}
break;
}
}
}
var seconds = data.entry.media$group.yt$duration.seconds;
var title = data.entry.title.$t;
var media = new Media(id, title, seconds, "yt");