diff --git a/src/libpoketube/init/pages-video.js b/src/libpoketube/init/pages-video.js index ecd2e708..1419b0be 100644 --- a/src/libpoketube/init/pages-video.js +++ b/src/libpoketube/init/pages-video.js @@ -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 fetch = modules.fetch; const htmlToText = require("html-to-text"); @@ -194,8 +199,8 @@ module.exports = function (app, config, renderTemplate) { d = desc.toString().replace(/\n/g, "
"); } - const descriptionString = String(inv_vid.description); - + const descriptionString = String(inv_vid?.description); + function extractInfo(regex) { return descriptionString !== "[object Object]" ? (regex.exec(descriptionString) ?? {}).groups