refactor(invidious/nitter): combine commands. fix(config): spelling error
This commit is contained in:
parent
5ed4b932d5
commit
f201637677
2 changed files with 12 additions and 2 deletions
|
@ -18,8 +18,8 @@ module.exports = {
|
||||||
nitter: {
|
nitter: {
|
||||||
domain: 'nitter.net',
|
domain: 'nitter.net',
|
||||||
userAgent: 'Mozilla/4.0 (compatible; Beep Boop)',
|
userAgent: 'Mozilla/4.0 (compatible; Beep Boop)',
|
||||||
domains: [ 'nitter.net', 'www.nitter.net', 'twitter.com', 'wwww.twitter.com' ],
|
domains: [ 'nitter.net', 'www.nitter.net', 'twitter.com', 'www.twitter.com' ],
|
||||||
check: '(✓)'
|
check: '(✅)'
|
||||||
},
|
},
|
||||||
invidious: {
|
invidious: {
|
||||||
domain: 'invidious.fdn.fr',
|
domain: 'invidious.fdn.fr',
|
||||||
|
|
10
main.js
10
main.js
|
@ -72,6 +72,16 @@ let CreateClient = (token, user_id) => {
|
||||||
});
|
});
|
||||||
command = 'media';
|
command = 'media';
|
||||||
break;
|
break;
|
||||||
|
case 'proxy':
|
||||||
|
try {
|
||||||
|
const url = new URL(userInput);
|
||||||
|
command = registrar.config.invidious.domains.includes(url.hostname)
|
||||||
|
? 'invidious'
|
||||||
|
: registrar.config.nitter.domains.includes(url.hostname)
|
||||||
|
? 'nitter'
|
||||||
|
: 'proxy';
|
||||||
|
} catch(e) {}
|
||||||
|
//fallthrough
|
||||||
default:
|
default:
|
||||||
args.push(matrixClient, room, userInput, registrar);
|
args.push(matrixClient, room, userInput, registrar);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue