Made get-info save if yt video is age-restricted and made playlist refuse to add age-restricted videos

This commit is contained in:
aleves64 2020-12-31 16:50:05 +02:00 committed by Calvin Montgomery
parent 9e3c23c58a
commit 7c3d2f74ed
2 changed files with 7 additions and 0 deletions

View File

@ -973,6 +973,10 @@ PlaylistModule.prototype._addItem = function (media, data, user, cb) {
}
}
if (media.meta.rating) {
return qfail("Cannot add age restricted videos because google sucks");
}
/* Warn about blocked countries */
if (media.meta.restricted) {
user.socket.emit("queueWarn", {

View File

@ -71,6 +71,9 @@ var Getters = {
if (video.meta.blocked) {
meta.restricted = video.meta.blocked;
}
if (video.meta.ytRating) {
meta.rating = video.meta.ytRating;
}
var media = new Media(video.id, video.title, video.duration, "yt", meta);
callback(false, media);