Skip to content

zanferrari/youtube-downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

youtube-downloader

A php only youtube parser and downloader

Zanfi Youtube downloader is Youtube parser and Audio+Video or Audio only downloader.

31 may 2023 - Suffering of throttling while download. Takes more time to download a file.

21 june 2023 - Implemented multiple CUrl downloads in chunks

It uses only 1 php class without third party software. It makes no use of the Youtube API (so no api key is needed).

Inspired from the (php) Athlon1600/youtube-downloader and, of course, from the youtube-dl and yt-dlp which are built with Python.

How to use the class:

include the class in your php code.

require('ZanfiYouTube.php');

initialize the class with a yotube video ID or a youtube video url

$ZanfiYouTube = new ZanfiYouTube('WaEKXGlfYj8');

or

$ZanfiYouTube = new ZanfiYouTube('https://www.youtube.com/watch?v=WaEKXGlfYj8');

The most important data is stored in:

$ZanfiYouTube->arr_Video_info;
$ZanfiYouTube->arr_Video_formats;
$ZanfiYouTube->arr_Video_adaptive_formats;
$ZanfiYouTube->arr_Video_thumbnails;

just print what you need to see:

$ZanfiYouTube->printFormatted($ZanfiYouTube->arr_Video_adaptive_formats);

print the array with the best video+audio data

$ZanfiYouTube->printFormatted($ZanfiYouTube->get_best_both());

print the array with the best audio data

$ZanfiYouTube->printFormatted($ZanfiYouTube->get_best_audio());

Starts download of video+audio

$ZanfiYouTube->download_best_both();

Starts download of audio only

$ZanfiYouTube->download_best_audio();

⚠️ Legal Disclaimer

This is a proof of concept. This program is for personal use only. Downloading copyrighted material without permission is against YouTube's terms of services. By using this program, you are solely responsible for any copyright violations. We are not responsible for people who attempt to use this program in any way that breaks YouTube's terms of services.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A php only youtube parser and downloader

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages