diff --git a/Caddyfile b/Caddyfile index 4fd0fc780..141a1f17d 100644 --- a/Caddyfile +++ b/Caddyfile @@ -95,6 +95,7 @@ header @html Content-Security-Policy " https://player.twitch.tv https://clips.twitch.tv https://mousai.stream + https://nftz.me pay.testwyre.com pay.sendwyre.com https://iframe.videodelivery.net; diff --git a/src/lib/services/embed-url-parser-service/embed-url-parser-service.ts b/src/lib/services/embed-url-parser-service/embed-url-parser-service.ts index f1545d1fe..f6f7114d7 100644 --- a/src/lib/services/embed-url-parser-service/embed-url-parser-service.ts +++ b/src/lib/services/embed-url-parser-service/embed-url-parser-service.ts @@ -231,6 +231,9 @@ export class EmbedUrlParserService { if (this.isSoundCloudFromURL(url)) { return of(this.constructSoundCloudEmbedURL(url)); } + if(this.isNFTzFromURL(url)){ + return of(url.href) + } if (this.isTwitchFromURL(url)) { return of(this.constructTwitchEmbedURL(url)).pipe( map((embedURL) => @@ -355,6 +358,11 @@ export class EmbedUrlParserService { return pattern.test(url.hostname); } + static isNFTzFromURL(url: URL): boolean { + const pattern = /\bnftz\.me$/; + return pattern.test(url.hostname); + } + static isValidVimeoEmbedURL(link: string): boolean { const regExp = /(https:\/\/player\.vimeo\.com\/video\/(\d{0,15}))$/; return !!link.match(regExp); @@ -402,6 +410,13 @@ export class EmbedUrlParserService { return !!link.match(regExp); } + static isValidNFTzEmbedURL(link: string): boolean { + const regExp = new RegExp( + `https:\/\/nftz\.me\/iframe\/nft\/` + ); + return !!link.match(regExp); + } + static isValidEmbedURL(link: string): boolean { if (link) { return ( @@ -413,7 +428,8 @@ export class EmbedUrlParserService { this.isValidSpotifyEmbedURL(link) || this.isValidSoundCloudEmbedURL(link) || this.isValidTwitchEmbedURL(link) || - this.isValidTwitchEmbedURLWithParent(link) + this.isValidTwitchEmbedURLWithParent(link)|| + this.isValidNFTzEmbedURL(link) ); } return false; @@ -432,6 +448,9 @@ export class EmbedUrlParserService { if (this.isValidMousaiEmbedURL(link)) { return 165; } + if (this.isValidNFTzEmbedURL(link)) { + return 480; + } return 315; }