fedimbed: :)

This commit is contained in:
Cynthia Foxwell 2025-04-17 23:38:05 -06:00
parent e678ce6b25
commit 4b0b3387d9
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -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 = [];