Skip to content

Commit

Permalink
feat: add youtube shorts
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomontalbano committed Jun 16, 2024
1 parent ac94166 commit 5fde9c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions netlify/functions/videoWrapper/Providers/Youtube.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ createTest(Youtube, 'https://music.youtube.com/watch?v=i3MKTm-49uI&feature=share
providerName: 'youtube',
});

createTest(Youtube, 'https://www.youtube.com/shorts/iVxCy5lXLaA?feature=share', {
isValid: true,
id: 'iVxCy5lXLaA',
providerName: 'youtube',
});

test.run();
3 changes: 3 additions & 0 deletions netlify/functions/videoWrapper/Providers/Youtube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export default class Youtube extends VideoProvider {

// - //music.youtube.com/watch?v=i3MKTm-49uI&feature=share
/https?\:\/\/music\.youtube\.com\/watch\?v\=([a-zA-Z0-9\_\-]+)/,

// - //www.youtube.com/shorts/q3i4jtp-byQ
/https?\:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9\_\-]+)/,
];
}

Expand Down

0 comments on commit 5fde9c4

Please sign in to comment.