diff --git a/config.example.js b/config.example.js index 6a4769e..8214794 100644 --- a/config.example.js +++ b/config.example.js @@ -18,8 +18,8 @@ module.exports = { nitter: { domain: 'nitter.net', userAgent: 'Mozilla/4.0 (compatible; Beep Boop)', - domains: [ 'nitter.net', 'www.nitter.net', 'twitter.com', 'wwww.twitter.com' ], - check: '(✓)' + domains: [ 'nitter.net', 'www.nitter.net', 'twitter.com', 'www.twitter.com' ], + check: '(✅)' }, invidious: { domain: 'invidious.fdn.fr', diff --git a/main.js b/main.js index 60cc50e..f88a0ec 100644 --- a/main.js +++ b/main.js @@ -72,6 +72,16 @@ let CreateClient = (token, user_id) => { }); command = 'media'; 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: args.push(matrixClient, room, userInput, registrar); }