original_string: public function getVideoByUrl(string $videoUrl): Video
  	{
  		$url = new Nette\Http\Url($videoUrl);
  
  		if (stripos($url->host, 'youtu.be') !== false) {
  			return $this->getVideo(trim($url->getPath(), '/'));
  		}
  
  		$videoId = $url->getQueryParameter('v');
  		if (stripos($url->host, 'youtube.com') === false || $videoId === null) {
  			throw new Nette\InvalidArgumentException('videoUrl must be valid youtube url.');
  		}
  
  		return $this->getVideo($videoId);
  	}
code: public function getVideoByUrl(string $videoUrl): Video
  	{
  		$url = new Nette\Http\Url($videoUrl);
  
  		if (stripos($url->host, 'youtu.be') !== false) {
  			return $this->getVideo(trim($url->getPath(), '/'));
  		}
  
  		$videoId = $url->getQueryParameter('v');
  		if (stripos($url->host, 'youtube.com') === false || $videoId === null) {
  			throw new Nette\InvalidArgumentException('videoUrl must be valid youtube url.');
  		}
  
  		return $this->getVideo($videoId);
  	}
code_tokens: public function getVideoByUrl ( string $ videoUrl ) : Video { $ url = new Nette \ Http \ Url ( $ videoUrl ) ; if ( stripos ( $ url -> host , 'youtu.be' ) !== false ) { return $ this -> getVideo ( trim ( $ url -> getPath ( ) , '/' ) ) ; } $ videoId = $ url -> getQueryParameter ( 'v' ) ; if ( stripos ( $ url -> host , 'youtube.com' ) === false || $ videoId === null ) { throw new Nette \ InvalidArgumentException ( 'videoUrl must be valid youtube url.' ) ; } return $ this -> getVideo ( $ videoId ) ; }
docstring: Fetches video data by youtube url
docstring_tokens: Fetches video data by youtube url