youtube-downloader icon indicating copy to clipboard operation
youtube-downloader copied to clipboard

Not all video's are returning a list of URLs

Open codeit-ninja opened this issue 4 years ago • 3 comments

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

codeit-ninja avatar Sep 01 '20 23:09 codeit-ninja

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);

julitroalves avatar Sep 03 '20 15:09 julitroalves

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

Athlon1600 avatar Oct 17 '20 13:10 Athlon1600

this one not working too https://www.youtube.com/watch?v=PRH9YMkvT3o

azinkey avatar Dec 20 '20 09:12 azinkey