change invidious url

This commit is contained in:
mose 2020-10-29 06:10:38 +08:00
parent 314948d453
commit d962b59f8a

View file

@ -7,7 +7,8 @@ var request_options = {
}
};
// alternative to invidious
// https://github.com/iv-org/invidious/wiki/Invidious-Instances
bot.global.text(/(https?:\/\/[^ ,\)"\n]*)/ig, async (b) => {
// console.log(JSON.stringify(b.match, null, 2));
@ -29,7 +30,7 @@ bot.global.text(/(https?:\/\/[^ ,\)"\n]*)/ig, async (b) => {
if (t = /[?&]v=([^&]+)/.exec(link)) {
link = "https://www.youtube.com/watch?v=" + t[1];
extra += " - [no-cookie](https://www.youtube-nocookie.com/embed/" + t[1] + ")";
extra += " - [invidious](https://invidio.us/watch?v=" + t[1] + ")";
extra += " - [invidious](https://invidious.tube/watch?v=" + t[1] + ")";
}
}
b.respond("[>>>](" + link + ") _" + match[1].replace(/\n/g, " ").trim() + "_" + extra);