Skip to content

Commit 48b4045

Browse files
authored
Add support for YouTube shorts in service videoId regex (#17)
1 parent 9cea9f6 commit 48b4045

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Services/YouTube.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected function viewName(): string
2929
*/
3030
protected function videoId(): ?string
3131
{
32-
preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $this->url, $match);
32+
preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/|youtube.com/shorts/)([^"&?/ ]{11})%i', $this->url, $match);
3333

3434
if (array_key_exists(1, $match)) {
3535
return $match[1];

0 commit comments

Comments
 (0)