fedimbed: :)
This commit is contained in:
parent
e678ce6b25
commit
4b0b3387d9
1 changed files with 15 additions and 5 deletions
|
@ -1020,20 +1020,30 @@ async function processUrl(msg, url, spoiler = false, command = false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
let platform = (await resolvePlatform(url)) ?? "<no nodeinfo>";
|
let platform = (await resolvePlatform(url)) ?? "<no nodeinfo>";
|
||||||
let color = PLATFORM_COLORS[platform.toLowerCase()];
|
|
||||||
let platformName = normalizePlatform(platform);
|
|
||||||
|
|
||||||
if (PATH_REGEX.twitter.test(urlObj.pathname)) {
|
if (PATH_REGEX.twitter.test(urlObj.pathname)) {
|
||||||
const hostname = urlObj.hostname.replace(/^www\./, "");
|
let hostname = urlObj.hostname.replace(/^www\./, "");
|
||||||
if (!TW_DOMAINS.includes(hostname)) logger.info("fedimbed", `Got new Twitter domain: ${urlObj.hostname}`);
|
if (TW_DOMAINS.includes(hostname)) {
|
||||||
|
if (command === true) {
|
||||||
|
urlObj.hostname = "tw.c7.pm";
|
||||||
|
url = urlObj.toString();
|
||||||
|
hostname = "tw.c7.pm";
|
||||||
|
platform = "Nitter";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.info("fedimbed", `Got new Twitter domain: ${hostname}`);
|
||||||
|
}
|
||||||
if (platform != "Nitter") return {};
|
if (platform != "Nitter") return {};
|
||||||
if (platform == "Nitter" && command === false) {
|
if (platform == "Nitter" && command === false) {
|
||||||
if (hostname != "tw.c7.pm" && hostname != "tw.counter-strike.gay")
|
if (hostname != "tw.c7.pm" && hostname != "tw.counter-strike.gay")
|
||||||
logger.info("fedimbed", `Got new Nitter domain running fork: ${urlObj.hostname}`);
|
logger.info("fedimbed", `Got new Nitter domain running fork: ${hostname}`);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let color = PLATFORM_COLORS[platform.toLowerCase()];
|
||||||
|
let platformName = normalizePlatform(platform);
|
||||||
|
|
||||||
const images = [];
|
const images = [];
|
||||||
const videos = [];
|
const videos = [];
|
||||||
const audios = [];
|
const audios = [];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue