$service = self::_findService($url);
if ($service) {
$videoId = self::_findVideoId($url, $service);
+ if ($videoId === null) {
+ return false;
+ }
if ($videoId) {
$res = $service . ':' . $videoId;
} else {
$r = Text::parseUrl($url);
if ($service == 'youtube') {
if (stristr($url, 'playlist')) {
- return false;
+ return null;
}
if (preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user|shorts)\/))([^\?&\"'>]+)/", $url, $matches)) {
return $matches[1];