change invidious url
This commit is contained in:
parent
314948d453
commit
d962b59f8a
1 changed files with 3 additions and 2 deletions
|
@ -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) => {
|
bot.global.text(/(https?:\/\/[^ ,\)"\n]*)/ig, async (b) => {
|
||||||
// console.log(JSON.stringify(b.match, null, 2));
|
// 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)) {
|
if (t = /[?&]v=([^&]+)/.exec(link)) {
|
||||||
link = "https://www.youtube.com/watch?v=" + t[1];
|
link = "https://www.youtube.com/watch?v=" + t[1];
|
||||||
extra += " - [no-cookie](https://www.youtube-nocookie.com/embed/" + 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);
|
b.respond("[>>>](" + link + ") _" + match[1].replace(/\n/g, " ").trim() + "_" + extra);
|
||||||
|
|
Loading…
Reference in a new issue