Skip to content

Commit

Permalink
Support upload YouTube shorts
Browse files Browse the repository at this point in the history
  • Loading branch information
ibra-hassan authored Aug 16, 2023
1 parent 3ed59c3 commit 1e0ac7e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions themes/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ function extractVideoUrl(url: string) {
url.match(
/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/,
) ||
url.match(
/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/,
) ||
url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);
if (match) {
return `${match[1] || 'https'}://www.youtube.com/embed/${
Expand Down

0 comments on commit 1e0ac7e

Please sign in to comment.