fedimbed: ignore .mp4 for twitter
This commit is contained in:
parent
b0c2c0d39b
commit
07a9e06cf9
4 changed files with 23 additions and 21 deletions
|
@ -1,7 +1,6 @@
|
||||||
const {Client, Collection, Channel, Permission} = require("@projectdysnomia/dysnomia");
|
const {Client, Collection, Channel, Permission} = require("@projectdysnomia/dysnomia");
|
||||||
const fs = require("node:fs");
|
const fs = require("node:fs");
|
||||||
const {resolve} = require("node:path");
|
const {resolve} = require("node:path");
|
||||||
const dns = require("node:dns");
|
|
||||||
const sqlite3 = require("sqlite3");
|
const sqlite3 = require("sqlite3");
|
||||||
const {instead, before} = require("@marshift/strawberry");
|
const {instead, before} = require("@marshift/strawberry");
|
||||||
|
|
||||||
|
@ -253,13 +252,6 @@ instead(bot.shards, "spawn", function (args, orig) {
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
|
|
||||||
before(dns, "lookup", (args) => {
|
|
||||||
if (args[0].includes(".discord.media")) {
|
|
||||||
if (args[1] == null) args[1] = {};
|
|
||||||
args[1].family = 6;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
process.title = `HiddenPhox`;
|
process.title = `HiddenPhox`;
|
||||||
|
|
||||||
bot.connect();
|
bot.connect();
|
||||||
|
|
|
@ -1019,6 +1019,7 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
|
||||||
if (platform == "Nitter") {
|
if (platform == "Nitter") {
|
||||||
if (!OWN_TW_DOMAINS.includes(hostname))
|
if (!OWN_TW_DOMAINS.includes(hostname))
|
||||||
logger.info("fedimbed", `Got new Nitter domain running fork: ${hostname}`);
|
logger.info("fedimbed", `Got new Nitter domain running fork: ${hostname}`);
|
||||||
|
if (url.endsWith(".mp4")) return {};
|
||||||
if (canTwitter === false) return {};
|
if (canTwitter === false) return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,19 +6,23 @@ const {default: Chatsounds, defaultModifiers} = require("sh");
|
||||||
|
|
||||||
const sh = new Chatsounds({modifiers: defaultModifiers, gitHubToken: hf.apikeys.github});
|
const sh = new Chatsounds({modifiers: defaultModifiers, gitHubToken: hf.apikeys.github});
|
||||||
(async () => {
|
(async () => {
|
||||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "csgo");
|
try {
|
||||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "css");
|
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "csgo");
|
||||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "ep1");
|
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "css");
|
||||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "ep2");
|
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "ep1");
|
||||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "hl1");
|
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "ep2");
|
||||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "hl2");
|
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "hl1");
|
||||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "l4d");
|
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "hl2");
|
||||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "l4d2");
|
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "l4d");
|
||||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "portal");
|
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "l4d2");
|
||||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "tf2");
|
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "portal");
|
||||||
await sh.useSourcesFromGitHub("PAC3-Server/chatsounds", "master", "sounds/chatsounds");
|
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "tf2");
|
||||||
await sh.useSourcesFromGitHub("Metastruct/garrysmod-chatsounds", "master", "sound/chatsounds/autoadd");
|
await sh.useSourcesFromGitHub("PAC3-Server/chatsounds", "master", "sounds/chatsounds");
|
||||||
sh.mergeSources();
|
await sh.useSourcesFromGitHub("Metastruct/garrysmod-chatsounds", "master", "sound/chatsounds/autoadd");
|
||||||
|
sh.mergeSources();
|
||||||
|
} catch {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const chatsounds = new Command("chatsounds");
|
const chatsounds = new Command("chatsounds");
|
||||||
|
|
|
@ -314,6 +314,11 @@ async function enqueue({guild_id, voice_id, text_id, url, type, addedBy, suppres
|
||||||
info.tags.ALBUM_ARTIST ??
|
info.tags.ALBUM_ARTIST ??
|
||||||
"<unknown artist>"
|
"<unknown artist>"
|
||||||
} - ${info.tags.title ?? info.tags.TITLE ?? "<no title>"}`;
|
} - ${info.tags.title ?? info.tags.TITLE ?? "<no title>"}`;
|
||||||
|
|
||||||
|
if (title == "<unknown artist> - <no title>") {
|
||||||
|
const urlObj = new URL(url);
|
||||||
|
title = urlObj.pathname.substring(urlObj.pathname.lastIndexOf("/") + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
length = info.duration ? Math.floor(info.duration) * 1000 : 0;
|
length = info.duration ? Math.floor(info.duration) * 1000 : 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue