From 2e41019c40bc9bfcfb0a425fa16b1e5e1d3516ee Mon Sep 17 00:00:00 2001 From: ashley Date: Thu, 9 Oct 2025 09:36:02 +0200 Subject: [PATCH] make it wayyy better --- src/libpoketube/init/pages-video.js | 49 +++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/src/libpoketube/init/pages-video.js b/src/libpoketube/init/pages-video.js index b637f23a..56db6261 100644 --- a/src/libpoketube/init/pages-video.js +++ b/src/libpoketube/init/pages-video.js @@ -217,13 +217,50 @@ module.exports = function (app, config, renderTemplate) { const secure = ["poketube.fun"].includes(req.hostname); const verify = req.hostname === "poketube.sudovanilla.com"; - - if (req.hostname !== "poketube.fun") { - if (config.invapi ==="https://invid-api.poketube.fun/bHj665PpYhUdPWuKPfZuQGoX/api/v1") { - return res.status(500).send( "Error: please edit your config.json to match your own instance, and please use your own API URL. see docs.invidious.io to how to setup invidious!"); - } - } + const officialHost = "poketube.fun"; + const officialApi ="https://invid-api.poketube.fun/bHj665PpYhUdPWuKPfZuQGoX/api/v1"; + if (req.hostname !== officialHost && config.invapi === officialApi) { + const message = ` + + +

⚠️ Configuration Error

+

+ It looks like you're using PokeTube's own Invidious API endpoint + (${officialApi}) for your custom instance. +

+ +

+ Please edit your config.json to match your own setup — using + Poke’s shared API is kinda lame 😅 since it also rate-limits poketube.fun + itself when too many people use it. +

+ +

+ Set up your own Invidious instance instead — it’s easy! + See the official setup guide: + docs.invidious.io +

+ +

+ Once you've updated config.json, restart your server and everything will work fine. +

+ `; + + return res.status(500).send(message); + }