fix a thingy

This commit is contained in:
Ashley 2023-09-13 17:26:55 +00:00
parent 7d2506f8a2
commit e7bfa3db59

View file

@ -36,6 +36,11 @@ function linkify(text) {
}); });
} }
function endsWithYouTubeAutoGenerated(text) {
const target = " Auto-generated by YouTube. ";
return text.endsWith(target);
}
const sha384 = modules.hash; const sha384 = modules.hash;
const fetch = modules.fetch; const fetch = modules.fetch;
const htmlToText = require("html-to-text"); const htmlToText = require("html-to-text");
@ -194,8 +199,8 @@ module.exports = function (app, config, renderTemplate) {
d = desc.toString().replace(/\n/g, " <br> "); d = desc.toString().replace(/\n/g, " <br> ");
} }
const descriptionString = String(inv_vid.description); const descriptionString = String(inv_vid?.description);
function extractInfo(regex) { function extractInfo(regex) {
return descriptionString !== "[object Object]" return descriptionString !== "[object Object]"
? (regex.exec(descriptionString) ?? {}).groups ? (regex.exec(descriptionString) ?? {}).groups