main_web/youtube1.php
Chris Edwards 8fb28b1f95
2021-02-21 10:02:34 -05:00

96 lines
3.6 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
//str_replace(' ', '_', $name);
$URL = $_POST["url"];
$DIR = str_replace(' ', '_', $_POST["dir"]);
$TYPE = $_POST["type"];
//system(`/var/www/html/youtube.sh'. $URL. $DIR.' > /ftp/youtube/log`, $out);
exec("/var/www/chrisedwards.tech/youtube.sh $URL $TYPE $DIR ; echo $URL+$DIR+$TYPE > /home/chrisserver/youtube_log");
$dir = "/var/www/chrisedwards.tech/youtube/";
$DIR = "";
$TYPE = "null";
echo '
<!DOCTYPE html>
<html>
<head>
<meta name="theme-color" content="#bb0000">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" type="text/css" href="menu.css" />
<title>YouTube Music</title>
<style>
body {background-color:#8f98a8; color:white}
#spinner {display:none; margin:auto; text-align:center}
#loading {width: 100%;height: 100%;top: 0px;left: 0px;position: fixed;display: block; z-index: 99}
#loading-image {position: absolute;top: 40%;left: 45%;z-index: 100}
</style>
</head>
<body onload="">
<div id="nav_menu">
</div>
<div id="loading">
<img id="loading-image" src="spinner.gif" alt="Loading..." />
</div>
<script src="menu.js"></script> 
<script language="javascript">
window.onload = function(){ document.getElementById("loading").style.display = "none" }
function reload(){
console.log("reload run");
document.getElementById("ftp_page").contentWindow.location = "youtube/";
}
function loader(){
console.log("loader run");
if ( document.getElementById("spinner").style.display == "inline"){
document.getElementById("spinner").style.display = "hidden"; alert("hide")}
else {document.getElementById("spinner").style.display = "inline";}
// document.getElementById("ftp_page").contentWindow.location = "youtube/";
}
</script>
<div style="text-align: center; width:47%; margin:auto;">
<br />
<h2 style="margin:auto; text-align:center; font-size: 85%">
Take a youtube URL and convert it into an mp3 or mp4 video, in its highest quality. <br/>
Files will be erased every hour from when they are created
</h2>
<button style="box-shadow: 7px 5px 2.5px #5F5F5F;" onclick="reload()">Refresh Download Box</button>
</div>
<div style="margin:auto; width:47%;">
<form style="margin:auto; text-align:center; " method="post" action="youtube.php
';
//$OUTPUT = system(`/var/www/html/hearmewhisper.ddns.net/youtube.sh'. $URL.' > /ftp/youtube/log`, $out);
//shell_exec("/var/www/html/hearmewhisper.ddns.net/youtube.sh $DIR $URL");
echo ' "><h4>URL of Video: </h4><input required="" style="box-shadow: 7px 5px 2.5px #5F5F5F;" autocomplete="off" type="text" size="13" name="url"> <span style="white-space: nowrap">
<br /><input type="checkbox" name="type" value="--extract-audio" checked> Audio Only</span><br>
<h4>Folder: </h4><input type="text" required="" size="13" style="box-shadow: 7px 5px 2.5px #5F5F5F;" autocomplete="off" name="dir" id="dir" value="">
<button name="submit" style="box-shadow: 7px 5px 2.5px #5F5F5F;">Submit</button>
</form>
</div>
<div id="spinner" style="">
<img style="margin:auto; text-align:center; position:absolute; left: 50%; margin-left: -120px; top: 50%; margin-top: -50px;" src="loader." />
</div>
<div style="width:75%; margin:auto; height:100%">
<iframe sandbox="allow-same-origin allow-scripts" height="275px" width="100%" style="background-color:#eeccff; border-radius:12px; box-shadow: 7px 5px 2.5px #5F5F5F;
margin-top:50px" id="ftp_page" src="youtube/">
<p>Your browser does not support iframes.</p>
</iframe>
<br /><br />
<!--<form>
<input type="hidden" value="$DIR">
<button style="box-shadow: 7px 5px 2.5px #5F5F5F;" action="delete.php">Delete folder and music</button>
</form>-->
</div>
</body>
</html>';
?>