// Requires: PHP 4, Python 2.4 // should have the list of YouTube video URLs - one per line // This script assumes you have 'youtube-dl' available at $ytdlLocation. // 'youtube-dl' can be downloaded from http://www.arrakis.es/~rggi3/youtube-dl/ // The videos downloaded from running this PHP script will be stored in // the current directory. $ytdlLocation = "."; // '.' means current directory. Do not put a trailing '/'. if ($argc!=2) { echo "Usage: php downloadYTVideos.php \n"; exit; } $urlListFile = trim($argv[1]); $fin = fopen($urlListFile, 'r'); echo "Processing $urlListFile...\n\n"; while ($line = fgets($fin)) { $command = "python " . $ytdlLocation . "/youtube-dl ". $line; system($command); } fclose($fin); ?>