Update regex for Wavlake embeds, ignore zine subdomain (#529)

This commit is contained in:
Michael Rhee 2023-04-19 16:24:11 -05:00 committed by GitHub
parent cc1d42c517
commit be1cd923cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -177,4 +177,5 @@ export const MagnetRegex = /(magnet:[\S]+)/i;
/**
* Wavlake embed regex
*/
export const WavlakeRegex = /(?:player\.)?wavlake\.com\/(track\/[.a-zA-Z0-9-]+|album\/[.a-zA-Z0-9-]+|[.a-zA-Z0-9-]+)/i;
export const WavlakeRegex =
/(?!zine\.wavlake\.com)(?:player\.|www\.)?wavlake\.com\/(?:(?:track|album)\/[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}|[a-z-]+)$/i;

View File

@ -1,5 +1,5 @@
const WavlakeEmbed = ({ link }: { link: string }) => {
const convertedUrl = link.replace(/(?:player\.)?wavlake\.com/, "embed.wavlake.com");
const convertedUrl = link.replace(/(?:player\.|www\.)?wavlake\.com/, "embed.wavlake.com");
return (
<iframe