auto integrate of youtube-dl on server #11186

Closed
opened 2026-02-21 06:05:04 -05:00 by deekerman · 2 comments
Owner

Originally created by @kiranbulley on GitHub (Jul 10, 2017).

i am developing a package to editing video and i need to integrate youtube-dl library with package installation. package developed in PHP. can we do auto integration of library on server

Originally created by @kiranbulley on GitHub (Jul 10, 2017). i am developing a package to editing video and i need to integrate youtube-dl library with package installation. package developed in PHP. can we do auto integration of library on server
Author
Owner

@siddht4 commented on GitHub (Jul 10, 2017):

index.php.txt
this can be done simply calling exec function in php. sample code :

<?php
//$out=shell_exec("youtube-dl");
//$out=exec("youtube-dl -version");
//var_dump($out);
$url = 'https://www.youtube.com/watch?v=GMuZdN84PJg'; //any url 

//$url='-v';
$cmd = 'youtube-dl -o "/home/siddht1/div/tmp/%(id)s.%(ext)s" ' . escapeshellarg($url);
exec($cmd, $output, $ret);
echo 'output: ';
var_export($output);
echo "\nret: ";
var_export($ret);

print_r(shell_exec());
?> 

other projects based on similar ideas are https://github.com/labzone/Youtube-dl-php ,https://github.com/norkunas/youtube-dl-php.

@siddht4 commented on GitHub (Jul 10, 2017): [index.php.txt](https://github.com/rg3/youtube-dl/files/1135152/index.php.txt) this can be done simply calling exec function in php. sample code : ``` <?php //$out=shell_exec("youtube-dl"); //$out=exec("youtube-dl -version"); //var_dump($out); $url = 'https://www.youtube.com/watch?v=GMuZdN84PJg'; //any url //$url='-v'; $cmd = 'youtube-dl -o "/home/siddht1/div/tmp/%(id)s.%(ext)s" ' . escapeshellarg($url); exec($cmd, $output, $ret); echo 'output: '; var_export($output); echo "\nret: "; var_export($ret); print_r(shell_exec()); ?> ``` other projects based on similar ideas are https://github.com/labzone/Youtube-dl-php ,https://github.com/norkunas/youtube-dl-php.
Author
Owner

@yan12125 commented on GitHub (Jul 10, 2017):

Thanks @siddht1. For further discussions, please move to #152.

@yan12125 commented on GitHub (Jul 10, 2017): Thanks @siddht1. For further discussions, please move to #152.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#11186
No description provided.