Skip to content

Commit 7018095

Browse files
authored
Fix: Add share URLs to TikTok pattern matching (#1973)
* Fix: Add share URLs to TikTok pattern matching * Fix: Add TikTok /player/v1 routes to pattern matching
1 parent c94e354 commit 7018095

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/patterns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const MATCH_URL_WISTIA =
1212
/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/;
1313
export const MATCH_URL_SPOTIFY = /open\.spotify\.com\/(\w+)\/(\w+)/i;
1414
export const MATCH_URL_TWITCH = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/;
15-
export const MATCH_URL_TIKTOK = /tiktok\.com\/(?:@[^/]+\/video\/)?(\d+)(?:\/([\w-]+))?/;
15+
export const MATCH_URL_TIKTOK = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/;
1616

1717
const canPlayFile = (url: string, test: (u: string) => boolean) => {
1818
if (Array.isArray(url)) {

0 commit comments

Comments
 (0)