I use the script below to download youtube video, it works fine in xamp in localhost, but when I put it in my live wev server it doesnβt work, I get this code from https://github.com/jeckman/YouTube- Downloader / blob / master / getvideo.php
<?php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Youtube Downloader</title> <meta name="keywords" content="Video downloader, download youtube, video download, youtube video, youtube downloader, download youtube FLV, download youtube MP4, download youtube 3GP, php video downloader" /> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> <style type="text/css"> body { padding-top: 40px; padding-bottom: 40px; background-color: #f5f5f5; } .download { max-width: 300px; padding: 19px 29px 29px; margin: 0 auto 20px; background-color: #fff; border: 1px solid #e5e5e5; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05); box-shadow: 0 1px 2px rgba(0,0,0,.05); } .download .download-heading { margin-bottom: 10px; } .mime, .itag { width: 75px; display: inline-block; } .itag { width: 15px; } .userscript { float: right; margin-top: 5px } </style> </head> <body> <div class="download"> <h1 class="download-heading">Youtube Downloader Results</h1> <?php } <a href="ytdl.user.js" class="userscript btn btn-mini" title="Install chrome extension to view a 'Download' link to this application on Youtube video pages."> Install Chrome Extension </a> </body> </html> <?php } else { $format = $_REQUEST['format']; $target_formats = ''; switch ($format) { case "best": $target_formats = array('38', '37', '46', '22', '45', '35', '44', '34', '18', '43', '6', '5', '17', '13'); break; case "free": $target_formats = array('38', '46', '37', '45', '22', '44', '35', '43', '34', '18', '6', '5', '17', '13'); break; case "ipad": $target_formats = array('37','22','18','17'); break; default: if (is_numeric($format)) { $target_formats[] = $format; } else { $target_formats = array('38', '37', '46', '22', '45', '35', '44', '34', '18', '43', '6', '5', '17', '13'); } break; } $best_format = ''; for ($i=0; $i < count($target_formats); $i++) { for ($j=0; $j < count ($avail_formats); $j++) { if($target_formats[$i] == $avail_formats[$j]['itag']) {