diff --git a/src/schemas/channel/media/queuedMediaSchema.js b/src/schemas/channel/media/queuedMediaSchema.js index 881e5b5..ba92208 100644 --- a/src/schemas/channel/media/queuedMediaSchema.js +++ b/src/schemas/channel/media/queuedMediaSchema.js @@ -53,6 +53,8 @@ queuedProperties.methods.rehydrate = function(){ this.id, this.type, this.duration, + //We don't save raw links that are stored seperate from the standard URL as they tend to expire. + null, this.startTime, this.startTimeStamp, this.earlyEnd, diff --git a/src/utils/loggerUtils.js b/src/utils/loggerUtils.js index 23aeb96..6265dac 100644 --- a/src/utils/loggerUtils.js +++ b/src/utils/loggerUtils.js @@ -74,7 +74,7 @@ module.exports.socketExceptionHandler = function(socket, err){ module.exports.localExceptionHandler(err); //if not yell at the browser for fucking up - return module.exports.socketErrorHandler(socket, "Server Error!", "An unexpected server crash was just prevented. You should probably report this to an admin."); + return module.exports.socketErrorHandler(socket, "An unexpected server crash was just prevented. You should probably report this to an admin.", "Server"); } } diff --git a/src/utils/media/ytdlpUtils.js b/src/utils/media/ytdlpUtils.js index 794c49f..61d3c41 100644 --- a/src/utils/media/ytdlpUtils.js +++ b/src/utils/media/ytdlpUtils.js @@ -30,9 +30,20 @@ const regexUtils = require('../regexUtils.js'); const loggerUtils = require('../loggerUtils.js') module.exports.fetchYoutubeVideoMetadata = async function(id, title){ - const media = await fetchMetadata(`youtu.be/${id}`, title,'yt'); + try{ + //Try to pull media from youtube id + const media = await fetchMetadata(`https://youtu.be/${id}`, title,'yt'); - return media; + //Return found media + return media; + //If something went wrong + }catch(err){ + //If our IP was banned by youtube + if(err.message.match("Sign in to confirm you’re not a bot.")){ + //Make our own error with blackjack and hookers + throw loggerUtils.exceptionSmith("The server's IP address has been banned by youtube. Please contact your server's administrator.", "queue"); + } + } } //Generic YTDLP function meant to be used by service-sepecific fetchers which will then be used to fetch video metadata