Skip to Content
PHPCODE
Youtube Download Script php
php code / April 16, 2018
              Youtube is the most mainstream recordings sharing stage where we watched recordings on the web. Notwithstanding, we frequently need to get those YouTube recordings for disconnected employments. In case you’re a PHP designer then unquestionably you will search for a PHP content to download YouTube recordings on your neighborhood server. So here in this post, I will clarify how effortlessly you can make your own content to download your most loved YouTube recordings. Toward the finish of this post, you will likewise observe live demo of YouTube video download content and furthermore download live demo source code

        As we realize that YouTube didn’t give any approaches to get the crude video yet at the same time we can download it. As the player will dependably issue a HTTP ask for to 
Step by step Code
Step 1 created db_connect.php :-

<?php

/* Database connection start */

$servername = “localhost”;
$username = “root”;
$password = “”;
$dbname = “phpcode”;
$conn = mysqli_connect($servername, $username, $password, $dbname) or die(“Connection failed: ” . mysqli_connect_error());
if (mysqli_connect_errno()) {
    printf(“Connect failed: %sn”, mysqli_connect_error());
    exit();

}


?>

Step :- 2 Created Index.php


<?php 
include(‘header.php’);
include_once(“db_connect.php”);
?>

<link rel=”stylesheet” href=”css/style.css” />
<title>Demo of YouTube video downloader script in PHP</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”>

<div class=”container”>
<h2>Demo – YouTube video downloader script in PHP</h2>
<form class=”form-download” method=”get” id=”download” action=”getvideo.php”>
<input type=”text” name=”videoid” style=”height:30px” id=”videoid” size=”40″ placeholder=”YouTube Video ID” />
<input class=”btn btn-primary” style=”background:#3399ff;height:30px;color:white” type=”submit” name=”type” id=”type”value=”Download” />
<p>Put in just the ID, the part after v=.</p>

<p>Example: http://www.youtube.com/watch?v=<b>Wp-Dm-Swfeg</b></p>
<?PHP
include_once(‘config.php’);
function is_chrome(){

$agent=$_SERVER[‘HTTP_USER_AGENT’];
if( preg_match(“/likesGecko)sChrome//”, $agent) ){ // if user agent is google chrome
if(!strstr($agent, ‘Iron’)) // but not Iron
return true;
}
return false; // if isn’t chrome return false
}
?>
</form>
</div>

Download code extra

$s = explode(‘,’,$s);

At long last, we should circle through every one of the streams and get its informatio

At long last, we should loThe finish PHP content to download YouTube videos:op through every one of the streams and get its information

Presently you can call it like this after you’ve put it to the server in a PHP record

Here we have built up a total Youtube video downloader content with the assistance of above. You can see this content in real life from underneath live demo interface.

DEMO  DOWNLOAD ZIP FILE  

PHPCODE © 2023