Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 (
Expand All @@ -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;
Expand All @@ -432,6 +448,9 @@ export class EmbedUrlParserService {
if (this.isValidMousaiEmbedURL(link)) {
return 165;
}
if (this.isValidNFTzEmbedURL(link)) {
return 480;
}
return 315;
}

Expand Down