Download the PHP package vdkar/youtube-downloader without Composer
On this page you can find all versions of the php package vdkar/youtube-downloader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package youtube-downloader
Do you like this project? Support it by donating
socialAPIS
- Bitcoin: bc1qkauwj52rr6pelckjfq4htgjl7jvamkq5lklqca
YoutubeDownloader
This is a Youtube Private API Client in PHP
There are multiple other PHP-based youtube downloaders on the Internet, but most of them haven't been updated in years, or they depend on youtube-dl itself.
Every of the, most every downloader uses youtube's front-end, than the extract the data from youtube front-end response which is kinda [bad];
I wanted to build a java android application to play youtubes videos in background and i had quite problems with all downloaders on the web.
I mean you have librarys that work, but when youtube changes something on the front-end they need to update, and yeah, youtube is changing it on a regular monthly bases.
Pure PHP-based youtube downloaders that work, don't exist, except of this one.
This is the first Pure PHP-based youtube downloader that works.
This script does not depend on anything other than cURL. cURL is used from GuzzleHttp. No Javascript interpreters, no calls to shell... nothing but pure PHP with no heavy dependencies either.
Feel free to fork and contribute if you like this project!
Demo
This will work every time, you can have 1M requests, if youtube blocks you, just ask the server to register you again, and you have the new key which is not banned.
Here down is a screenshot of this example running in browser.
Here you can see the whole response
Installation
Recommended way of installing this is via Composer:
Copy the FetchPlayer example to your server folder and run it
Usage
To use the Youtube's private API you first need to register. to register you can call this
to save bandwidth you can save the id/key from the response and save it to a database or any other method.
if you have the id/key, you can register on this way
Then you need to have the video id
You will get this output:
To-do list
- refactor
- Explain the encryption key preparation (Hashing/Encryption)
- Explain the Url and Body Signing process
- Implement Search/Browse video
- Implement Fetching Google-Visitor-id from response
- Implement Interface for persisting data
License
- Reciprocal Public License 1.5 (RPL-1.5): https://opensource.org/licenses/RPL-1.5
Legal
This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by Youtube or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use at your own risk.