diff options
| author | RblSb <msrblsb@gmail.com> | 2022-11-24 23:17:19 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2022-11-24 23:17:19 +0300 |
| commit | e877f070e367a7a9d93b93bf676f4afdb948356f (patch) | |
| tree | 79a80fd8906ed7b421ba14c560e0bd50635267d0 /src | |
| parent | 7c346c43b54210f78f68815d26643ee8a8e949ee (diff) | |
Youtube shorts support
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/players/Youtube.hx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/players/Youtube.hx b/src/client/players/Youtube.hx index 65a93c9..ca8d415 100644 --- a/src/client/players/Youtube.hx +++ b/src/client/players/Youtube.hx @@ -16,6 +16,7 @@ using StringTools; class Youtube implements IPlayer { final matchId = ~/youtube\.com.*v=([A-z0-9_-]+)/; final matchShort = ~/youtu\.be\/([A-z0-9_-]+)/; + final matchShorts = ~/youtube\.com\/shorts\/([A-z0-9_-]+)/; final matchEmbed = ~/youtube\.com\/embed\/([A-z0-9_-]+)/; final matchPlaylist = ~/youtube\.com.*list=([A-z0-9_-]+)/; final videosUrl = "https://www.googleapis.com/youtube/v3/videos"; @@ -47,6 +48,9 @@ class Youtube implements IPlayer { if (matchShort.match(url)) { return matchShort.matched(1); } + if (matchShorts.match(url)) { + return matchShorts.matched(1); + } if (matchEmbed.match(url)) { return matchEmbed.matched(1); } |
