ahaschool/video-dl

ahaschool download video for php

v1.2 2018-12-16 03:46 UTC

This package is auto-updated.

Last update: 2024-04-16 18:56:47 UTC


README

install the wrapper using Composer:

composer require ahaschool/video-dl

Add composer script at your root composer.josn

"scripts": {
    ...
    "post-install-cmd": "chmod +x vendor/ahaschool/video-dl/bin/youtube-dl"
 }

Get youtube video url list

<?php
require __DIR__ . '/vendor/autoload.php';

use Ahaschool\Videodl\Youtube\Channel;

$chl = new Channel('user/byjusclasses/videos');
$items = $chl->initVideoItems()->getItems();

Download youtube video by video key

<?php
require __DIR__ . '/vendor/autoload.php';

use Ahaschool\Videodl\Youtube\Download;

$dl = new Download('./');
try {
    $video = $dl->dl('WPOoNZbT-1w');
} catch (\Exception $e) {
    echo $e->getMessage();
}