mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 20:32:50 +02:00
Generate public urls for media.discordapp.net too
This commit is contained in:
parent
6bc3eaf866
commit
ae9acbcc52
3 changed files with 38 additions and 33 deletions
|
@ -121,9 +121,9 @@ function timestampToSnowflakeInexact(timestamp) {
|
|||
|
||||
/** @param {string} url */
|
||||
function getPublicUrlForCdn(url) {
|
||||
const match = url.match(/https:\/\/cdn.discordapp.com\/attachments\/([0-9]+)\/([0-9]+)\/([-A-Za-z0-9_.,]+)/)
|
||||
const match = url.match(/https:\/\/(cdn|media)\.discordapp\.(?:com|net)\/attachments\/([0-9]+)\/([0-9]+)\/([-A-Za-z0-9_.,]+)/)
|
||||
if (!match) return url
|
||||
return `${reg.ooye.bridge_origin}/download/discordcdn/${match[1]}/${match[2]}/${match[3]}`
|
||||
return `${reg.ooye.bridge_origin}/download/discord${match[1]}/${match[2]}/${match[3]}/${match[4]}`
|
||||
}
|
||||
|
||||
module.exports.getPermissions = getPermissions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue