diff --git a/src/YouTubeDownloader.php b/src/YouTubeDownloader.php index 3f95537..03b68bb 100644 --- a/src/YouTubeDownloader.php +++ b/src/YouTubeDownloader.php @@ -226,6 +226,11 @@ public function getDownloadLinks($video_id, $selector = false) // get JSON encoded parameters that appear on video pages $json = $this->getPlayerResponse($page_html); + if (empty($json)) { + $json = $this->getVideoInfo($this->extractVideoId($video_id)); + $json = Utils::arrayGet($json, 'player_response'); + } + // get player.js location that holds signature function $url = $this->getPlayerScriptUrl($page_html); $js = $this->getPlayerCode($url);