Last active
November 21, 2015 00:57
-
-
Save juanpablocs/45eb94d6990e5eba8f05 to your computer and use it in GitHub Desktop.
script que descarga videos de youtube en formato mp3 sin necesidad de FFMPEG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// instalar youtube-dl en el sistema (linux) | |
// > sudo curl https://yt-dl.org/downloads/2015.11.19/youtube-dl -o /usr/local/bin/youtube-dl | |
// > sudo chmod a+rx /usr/local/bin/youtube-dl | |
// dar permiso 777 a la carpeta destino | |
// chmod 777 -R tufolder | |
// eso es todo :) | |
set_time_limit(0); | |
$playlist = ['taMbeYE-VIg','Ns9YYSqLxyI']; | |
foreach($playlist as $pl): | |
$url = 'https://www.youtube.com/watch?v='.$pl; | |
$cmd = 'youtube-dl -f 140 -o "/home/tuuser/youtube_download/%(id)s.mp3" ' . escapeshellarg($url); | |
exec($cmd, $output, $ret); | |
echo 'output: '; | |
var_export($output); | |
echo "\nret: "; | |
var_export($ret); | |
endforeach; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment