athlon1600/youtube-downloader
Pure-PHP YouTube downloader library that fetches direct stream links (audio-only and combined audio+video) without shelling out to youtube-dl or using JS interpreters. Simple API: getDownloadLinks() and pick the best format URL.
Fixed XSS vulnerability issue on our YouTube downloader testing page by upgrading to jQuery 3.5.1.
Full Changelog: https://github.com/Athlon1600/youtube-downloader/compare/v4.0.0...v4.0.1
Refactored entire project to use type declarations everywhere. Because of that, the minimum supported PHP version is now PHP 7.4.
Complete list of changes: https://github.com/Athlon1600/youtube-downloader/compare/3.x...v4
VideoDetails class. We use VideoInfo class in its placeDownloadOptions::getVideoInfo() will now return VideoInfo classAbstractModel class has been renamed to JsonObjectPlayerResponseParser class has been renamed to SignatureLinkParser, and its parseLinks method has a different signatureSplitStream classDownloadOptions::getSplitFormats methodSignatureDecoder::parseFunctionName and SignatureDecoder::parseFunctionCode are protected methods now/public/stream.php. https://github.com/Athlon1600/youtube-downloader/issues/156get_video_info is now working again. Something had changed on YouTube's end to break it. https://github.com/Athlon1600/youtube-downloader/pull/120consentCookies method that allows bypassing cookies consent screen that gets shown to European IPs. https://github.com/Athlon1600/youtube-downloader/issues/125get_video_info endpoint was always returning 404SignatureDecoder class. Match functions with double quotes in their name. Issue: https://github.com/Athlon1600/youtube-downloader/issues/99Lots of code refactoring with many breaking changes, but everything now is much easier to read and understand.
Some of the major changes:
Added a new php-curl-file-downloader dependency. Previous Browser class just duplicated a bunch of the same HTTP logic that I wrote for that library anyways.
We're no longer passing arrays back and forth everywhere. That's just a bad programming practice in general. Most of those arrays are now objects. For example: getDownloadLinks method which used to return an array of links, now returns a DownloadOptions object where each "option" is also an object (StreamFormat).
getDownloadLinks now throws a YouTubeException if something unexpected happens. Previously it just returned an empty array.
We will be using Exceptions a lot more instead of just returning false or null as we were doing before.
Youtube was renamed to YouTube (capitalized twice) everywhere, because that is just how YouTube itself does it: https://developers.google.com/youtube/v3/code_samples/php
player_response JS code that usually appears on /watch?v=XXX page itself.SignatureDecoder class to decrypt video signatures properly.Utils class to hold useful functions.cipher to signatureCipherimproved recognition of the types of video/audio links returned by YouTube. All the itag data now comes from:
https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/youtube.py#L429
updated README
better handling of errors inside demo application
php -SYouTubeStreamer class for streaming videos directly from the server.No major changes. Just internal refactoring.
breaking changes!
v1.0.1
First release
How can I help you explore Laravel packages today?