One more for testing.

This commit is contained in:
flash 2024-10-28 19:47:15 +00:00
parent bf70ad32a1
commit 0a712d7a8c

View file

@ -94,7 +94,7 @@ const allowOEmbed: String[] = [ // copied from wordpress source sorta
'.edgii.net', '.edgii.net',
]; ];
const appVersion: String = '20241028'; const appVersion: String = '20241029';
const isDebug: Boolean = existsSync(pathJoin(import.meta.dirname, '.debug')); const isDebug: Boolean = existsSync(pathJoin(import.meta.dirname, '.debug'));
const cache: MemcacheClient = new MemcacheClient({ const cache: MemcacheClient = new MemcacheClient({
server: memcacheServer, server: memcacheServer,
@ -389,6 +389,8 @@ const extractOEmbedData = async (response: Response, html, url: string, urlInfo:
oEmbedUrl = `https://soundcloud.com/oembed?format=json&url=${encodeURIComponent(url)}`; oEmbedUrl = `https://soundcloud.com/oembed?format=json&url=${encodeURIComponent(url)}`;
else if(isDomainSuffix('tiktok.com', urlInfo.host)) else if(isDomainSuffix('tiktok.com', urlInfo.host))
oEmbedUrl = `https://www.tiktok.com/oembed?url=${encodeURIComponent(url)}`; oEmbedUrl = `https://www.tiktok.com/oembed?url=${encodeURIComponent(url)}`;
else if(isDomainSuffix('mixcloud.com', urlInfo.host))
oEmbedUrl = `https://app.mixcloud.com/oembed/?url=${encodeURIComponent(url)}`;
else if(html !== undefined) else if(html !== undefined)
oEmbedUrl = html('link[rel="alternate"][type="application/json+oembed"]').first()?.attr('href')?.trim() ?? ''; oEmbedUrl = html('link[rel="alternate"][type="application/json+oembed"]').first()?.attr('href')?.trim() ?? '';