youtube-downloader
youtube-downloader copied to clipboard
Not all video's are returning a list of URLs
I was testing out this script when I noticed that not all video's are working.
For example, this video returns an empty array
: https://www.youtube.com/watch?v=FyKWUTwSYAs
I noticed when I logged the $page_html
in YouTubeDownloader.php:138 getPlayerResponse()
that the layout looks different then for example this video: https://www.youtube.com/watch?v=1Q8fG0TtVAY
Same issue here, to solve this I changed the lines into class YouTubeDownloader.php at function getDownloadLinks():
// get JSON encoded parameters that appear on video pages
$json = $this->getPlayerResponse($page_html);
if ($json === null) {
$json = $this->getVideoInfo($this->extractVideoId($video_id));
}
// get player.js location that holds signature function
$url = $this->getPlayerScriptUrl($page_html);
$js = $this->getPlayerCode($url);
$result = $this->parsePlayerResponse($json['player_response'], $js);
https://github.com/Athlon1600/youtube-downloader/issues/73#issuecomment-686552940 that works!
I merged that exact solution into the latest v2.1.1 version:
https://github.com/Athlon1600/youtube-downloader/releases
this one not working too https://www.youtube.com/watch?v=PRH9YMkvT3o