Threat management system are very strict when it comes to youtube access. Maximum security softwares scan for the word "Youtube" in the domain and block the domain. Which makes common youtube download scripts and sites also useless.
A way to get around this is by using https proxy so that the filter does not know where you are going, but these are painstakingly slow.
Thinking over it I devised an idea, what if a server downloads the video for you and then just simply passes the video to you.
I had been using youtube-dl on my vps for quite some time. But this was only for me and everytime I had to login to ssh. I wanted this to happen through the webpage for this I wrote a code.
To use this you will need the following:
1. A server with root access
2. PHP
3. youtube-dl (latest version)
Index.html (For instructions ad other formalities)
A way to get around this is by using https proxy so that the filter does not know where you are going, but these are painstakingly slow.
Thinking over it I devised an idea, what if a server downloads the video for you and then just simply passes the video to you.
I had been using youtube-dl on my vps for quite some time. But this was only for me and everytime I had to login to ssh. I wanted this to happen through the webpage for this I wrote a code.
To use this you will need the following:
1. A server with root access
2. PHP
3. youtube-dl (latest version)
Index.html (For instructions ad other formalities)
<html>
<body>
<link rel="stylesheet" href="style.css" type="text/css" media="screen"/>
<div align="center">
<h1 style="color: #ffffff;"> How to use this site (youtube downloading)</h1>
<p><span style="color: #ffffff;">
You will need the youtube url<br><br>
1. On the next page paste the youtube url <br>
2. Type a unique name by which you want to save the file by (no spaces)<br>
3. Click Submit<br>
4. Wait for page to load (the server is downloading the file)<br>
5. Check if the file has been downloaded 100% (at the end of the mad code)<br>
6. Click the Download link<br>
7. After downloading click the remove link to remove the file (this is VERY important as the server has very limited space)<br>
<br>
<button onclick="location.href='index23.html'">Let's GOOOOOO (CLick me!)</button>
<br>
<br>
P.S. Videos banned in Germany cant be downloaded as the server is in Germany (Most music videos)
</span></p>
</body>
</html>
Index23.html (For taking the Youtube url from the user)
<html>
<body>
<link rel="stylesheet" href="style.css" type="text/css" media="screen"/>
<form action="welcome.php" method="post">
<p><span style="color: #ffffff;">Youtube url: <input type="text" name="fname" />
File name: <input type="text" name="age" /></span></p>
<input type="submit" />
</form>
</body>
</html>
welcome.php (Download the video and generate download url and deletion url)
<html>
<body>
<link rel="stylesheet" href="style.css" type="text/css" media="screen"/>
<p><span style="color: #ffffff;">
<?php
$fe = $_POST['fname'];
$ag = $_POST['age'];
$out = "youtube-dl -o ".$ag.".mp4 ".$fe;
echo 'Downloading the file <br><br>';
set_time_limit(0);
$output = passthru ($out);
echo $output;
echo '<br><br>';
$rt = "http://vps.ntweat.com/r/23/".$ag.".mp4";
echo '<a href="' .$rt.'">click here to download your video</a>';
echo '<br><br>';
echo '<a href="remove.php' . '?ag2=' .$ag.'">click here to remove the video</a>';
?>
</span></p>
<\html>
<\body>
remove.php (To remove the downloaded video and save space on server)
<html>
<body>
<link rel="stylesheet" href="style.css" type="text/css" media="screen"/>
<p><span style="color: #ffffff;">
<?php
$ag = $_GET['ag2'];
$yu = "rm ".$ag.".mp4";
$we = exec ($yu);
echo $we
?>
<h1 style="color: #ffffff;">Thank you for Removing the file...</h1>
</span></p>
</html>
</body>
That's it..!! Now you can download videos via your server
You can download the code from here: Click here
P.S. This is a very rough code.
No comments:
Post a Comment