Skip to main content

How to create youtube video downloader tool with php

Hello friends today I will tell you how to create  a youtube video downloader tool with php

Follow just two steps and create you youtube video downloader tool

youtube downloader php script 2019



step1- create a index,php file (create youtube downloader)

<center>
<br>
<br>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>youtube video donwload</title>
<script type="text/javascript">
$(function(){
$("#sub").click(function() {
var valid =true;
var url =$("#url").val();
var express = new RegExp('^~^(?:https?://)?(?:www[.])?(?:youtube[.]com/watch[?]v=|youtu[.]be/)([^&]{11})~x$');

if(url == "" ){
$("#form").prev(".msg").html("<div class='alert alert-danger'>Enter a url first </div>");
valid = false;
}
if(express.test(url) ){
$("#form").prev(".msg").html("<div class='alert alert-danger'>entrer a valid url please</div>");
valid = false;
alert("not work");
}

return valid;
});
});
</script>
</head>
<body>

</html>






<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
  box-sizing: border-box;
}
​
/* Create two equal columns that floats next to each other */
.column {
  float: left;
  width: 20%;
  padding: 10px;
  height: 600px; /* Should be removed. Only for demonstration */
}
​
/* Clear floats after the columns */
.row:after {
  content: "";
  display: table;
  clear: both;
}




</style>
</head>
<body>
​<br>
<br>
<b>
<h2>Youtube Video Downloader</h2></b>
​
 
<center><form  method="post" action="download.php" id="form">
<img src="yt.jpg"  height="200px"   width="200px">
<br>
<br><h3>Enter Youtube video link</h3>
<br>
<input type="text" size="35" name="url"  placeholder="https://www.youtube.com/watch?v=1oqlmtnbBuk" id="url"><br>
<input type="submit" name="down" value="Download" class="btn btn-primary" id="sub">
</form></center>

    <p>Download Youtube Videos With Our Tool</p>

</body>
</html>
​

</center>


step2- create a download.php file


<center>

<br>
<br>


<?php
error_reporting(0);
if (isset($_POST['down'])) {
$url = $_POST['url'];
$id_video= explode("?v=", $url);
$id_video = substr($id_video[1],0,11);

/*echo "<pre>";
print_r($id_video);
echo "</pre>";


echo "$id_video";*/

$data = file_get_contents("https://www.youtube.com/get_video_info?video_id=$id_video ");


parse_str($data,$arr);


/*echo "<pre>";
print_r($arr);
echo "</pre>";*/

// for url
$urls =explode(",",$arr['url_encoded_fmt_stream_map']);


/*
foreach ($urls as $value) {
parse_str($value,$format);
echo "<pre>",print_r($format),"</pre>";
}*/

}else{



echo "not avialable";
}




 ?>



 <!DOCTYPE html>
 <html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>youtube video downloader tool</title>
  </head>
 <body>
  <div class="container" style="margin-top: 200px">
  <div class="row">
  <div class="col-md-6 col-md-offset-3">
  <div class="panel panel-primary text-center">
  <div class="panel-heading">
  <h3 class="panel-title"><?=$arr['title'] ?></h3>
  </div>
  <div class="panel-body" >
  <div class="row">
  <div class="col-md-4">
  <img class="thumbnail" src=<?=$arr['thumbnail_url'] ?>>
  </div>
  <img src="yt.jpg"  height="200px"   width="200px">
 
  <div class="col-md-3">
  <label for="Download">Download :</label>
  <?php

  foreach ($urls as $value) {
  parse_str($value,$format);
  echo "<a class='btn btn-primary'  href='{$format[url]}&title={$arr[title]}'>{$format['quality']}</a><br><br>";
  }

  ?>
  <a href="<?php    echo $url = $_POST['url'];   ?>"> <?php    echo $url = $_POST['url'];   ?> </a>

  </div>
  </div>
  </div>
  </div>
  </div>
  </div>
 </body>
 </html>

</center>

Comments

Popular posts from this blog

How to Download Vimeo Thumbnail With PHP

Vimeo Thumbnail Downloader Tool – Vimeo Video Ka Thumbnail Download Karein Aaj ke is tutorial mein hum Vimeo Thumbnail Downloader Tool ke baare mein jaanenge. Is tool ki help se hum Vimeo video URL se us video ki thumbnail image obtain kar sakte hain. Agar aap PHP, Web Development, HTML, CSS aur Online Tools banana seekh rahe hain, to ye ek useful PHP project example hai. Vimeo Thumbnail Downloader Kya Hai? Vimeo Thumbnail Downloader ek simple tool hai jisme user Vimeo video ka URL enter karta hai. Tool Vimeo video ID ko identify karta hai aur available thumbnail image ko display karta hai. Example Vimeo URL: https://vimeo.com/389063954 Is URL mein: 389063954 Vimeo video ID hai. Vimeo Thumbnail Downloader Kaise Work Karta Hai? Is PHP script mein mainly do functions use kiye gaye hain: 1. getVimeoId() Ye function Vimeo URL se video ID find karta hai. 2. getVimeoThumb() Ye function Vimeo video ID ke basis par thumbnail information retrieve karta hai aur available thumbnail...

How To Create Contact Form With Validation-Php & Html

How To Create Contact Form - Hello Friends Ajj Me Apko Btaunga   Ki Kis Prakar   Ham Apni Website Ke Liye Contact Form Bnana Sakta Hai.( By Using   Php Contact Form With Validation Script ) Contact Form Hmare Website Ke Liye Bhut He Jrruri Hota Hai.Contact Form Ke Help Se He User Apna Message Website Owner(Admin) Ko Bhej Sakte Hai. Ajj Me Apko Btane Wala Hu Ki Kis Parkar Ham Contact Form Banakar Apne Website Me Add Kar Sakte Hai Or Apni Website Ke Liye Contact Form Bana Sakte Hai Is Contact Form Me   Ham Php Mail Function() Ka Use Karege . Ab Jab Be Koi User Contact Form Me Apni Information ,Message Details Fill Karke Submit Karega To Uski Sare Information Website Admin Ke Email Id Par A Jaiyegi Jo Be Admin Dwara   Niche Diye Gye Code Me Setup Ki Hogi. Used Language- ·          HTML ·          Jquery ·          Php ...

How To Send Sms From Website Using Php-Textlocal SMS

Hello Friends Ajj Me Apko Btaunga Ki Kis Prakar Aap Apni Website Me Free Sms Send Ka Option Integrate Kar Sakte Ho. Bulk sms in India-Best company Iske Liye Apko Sabse Pehle   Https://Www.Textlocal.In/Signup Par Signup Karke Account Create Karna Hai.Ye Ek Achi bulk sms provider company hai ·          Account Create Hone Ke Bad Aap Apna Username And Password Enter Karke Apne Dashboard Me Login Ho Jaiye( textlocal login) ·          Yanha Apko Text Local Company Dwara 10 Meassge Free Testing Ke Liye Diye Jayege ·          Aap Sms Plan Buy Kar Sakte Ho Is Company Dwara Bhut He Kam Prize Me Sms Pakage,plan provide  Kiye Jate Hai Textlocal Price Plans –  index.php <?php if(isset($_POST['code']) &&  isset($_POST['mobile'])){ // Authorisation details. $username = "enter your textlocal account email id here"; $hash = "...