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 fs = require("node:fs");
|
||||
const {resolve} = require("node:path");
|
||||
const dns = require("node:dns");
|
||||
const sqlite3 = require("sqlite3");
|
||||
const {instead, before} = require("@marshift/strawberry");
|
||||
|
||||
|
@ -253,13 +252,6 @@ instead(bot.shards, "spawn", function (args, orig) {
|
|||
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`;
|
||||
|
||||
bot.connect();
|
||||
|
|
|
@ -1019,6 +1019,7 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
|
|||
if (platform == "Nitter") {
|
||||
if (!OWN_TW_DOMAINS.includes(hostname))
|
||||
logger.info("fedimbed", `Got new Nitter domain running fork: ${hostname}`);
|
||||
if (url.endsWith(".mp4")) return {};
|
||||
if (canTwitter === false) return {};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ const {default: Chatsounds, defaultModifiers} = require("sh");
|
|||
|
||||
const sh = new Chatsounds({modifiers: defaultModifiers, gitHubToken: hf.apikeys.github});
|
||||
(async () => {
|
||||
try {
|
||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "csgo");
|
||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "css");
|
||||
await sh.useSourcesFromGitHubMsgPack("PAC3-Server/chatsounds-valve-games", "master", "ep1");
|
||||
|
@ -19,6 +20,9 @@ const sh = new Chatsounds({modifiers: defaultModifiers, gitHubToken: hf.apikeys.
|
|||
await sh.useSourcesFromGitHub("PAC3-Server/chatsounds", "master", "sounds/chatsounds");
|
||||
await sh.useSourcesFromGitHub("Metastruct/garrysmod-chatsounds", "master", "sound/chatsounds/autoadd");
|
||||
sh.mergeSources();
|
||||
} catch {
|
||||
// noop
|
||||
}
|
||||
})();
|
||||
|
||||
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 ??
|
||||
"<unknown artist>"
|
||||
} - ${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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue