diff --git a/src/Youtube.php b/src/Youtube.php index 2ad7500..f71c855 100644 --- a/src/Youtube.php +++ b/src/Youtube.php @@ -476,8 +476,12 @@ public static function parseVIdFromURL($youtube_url) $path = static::_parse_url_path($youtube_url); $videoId = substr($path, 7); } + if (strpos($youtube_url, 'shorts')) { + $path = static::_parse_url_path($youtube_url); + $videoId = substr($path, 8); + } if ($params = static::_parse_url_query($youtube_url)) { - $videoId = isset($params['v']) ? $params['v'] : null; + $videoId = isset($params['v']) ? $params['v'] : $videoId; } } elseif (strpos($youtube_url, 'youtu.be')) { $path = static::_parse_url_path($youtube_url);