Still not done
This commit is contained in:
parent
184f58a147
commit
78d50b2ca7
3 changed files with 66 additions and 50 deletions
12
index.js
12
index.js
|
@ -9,21 +9,17 @@ const app = express()
|
|||
app.get("/download", (req, res) => {
|
||||
const filename = req.query.filename
|
||||
const url = req.query.url
|
||||
const format= req.query.format
|
||||
const format = req.query.format
|
||||
const quality = req.query.quality
|
||||
|
||||
if ((filename === 'string' && url === 'string' && format === 'string' && quality === 'string')) {
|
||||
res.header('Content-Disposition', `attachment; filename="${filename}.${format}"`);
|
||||
ytdl(url, {'format': format, 'quality': quality}).pipe(res);
|
||||
} else {
|
||||
res.send('Please input proper values in all fields.')
|
||||
}
|
||||
res.header('Content-Disposition', `attachment; filename="${filename}.${format}"`);
|
||||
ytdl(url, { 'format': format, 'quality': quality }).pipe(res);
|
||||
|
||||
});
|
||||
|
||||
|
||||
app.use(express.static(path.join(__dirname, 'static')))
|
||||
|
||||
app.listen(PORT, function() {
|
||||
app.listen(PORT, function () {
|
||||
console.log("Hosted on port " + PORT)
|
||||
})
|
|
@ -6,46 +6,51 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4"
|
||||
crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
|
||||
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="./style.css">
|
||||
|
||||
<title>Youtube Downloader</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Youtube Downloader
|
||||
<h1>Youtube Downloader <p>v1.0</p>
|
||||
<hr>
|
||||
</h1>
|
||||
|
||||
<form action="download" method="get" target="_blank">
|
||||
<p style="margin-bottom: 1px;">Video URL:</p>
|
||||
<div class="grid-container">
|
||||
<input required id="url" placeholder="Enter url" name="url"><br>
|
||||
<!-- <label for="quality">Quality:</label> -->
|
||||
<p>Quality:</p>
|
||||
<select required id="quality" name="quality">
|
||||
<option value="lowestaudio">Lowest (Audio Only)</option>
|
||||
<option value="highestaudio">Highest (Audio Only)</option>
|
||||
<option value="highestvideo">Highest (Video Only)</option>
|
||||
<option value="lowestvideo">Lowest (Video Only)</option>
|
||||
<option value="highest">Highest</option>
|
||||
<option value="lowest">Lowest</option>
|
||||
</select><br>
|
||||
<!-- <label for="filename">Save As:</label> -->
|
||||
<input id="filename" placeholder="Enter filename" name="filename"><br>
|
||||
<!-- <label for="format">Format:</label> -->
|
||||
<select required id="format" name="format">
|
||||
<option value="mp4">mp4</option>
|
||||
<option value="wmv">wmv</option>
|
||||
<option value="flv">flv</option>
|
||||
<option value="avi">avi</option>
|
||||
<option value="mp3">mp3</option>
|
||||
<option value="mpg">mpg</option>
|
||||
</select><br>
|
||||
<input type="submit" placeholder="test">
|
||||
</div>
|
||||
<input required id="url" placeholder="Enter url" name="url">
|
||||
<p>Quality:</p>
|
||||
<select required id="quality" name="quality">
|
||||
<option value="lowestaudio">Lowest (Audio Only)</option>
|
||||
<option value="highestaudio">Highest (Audio Only)</option>
|
||||
<option value="highestvideo">Highest (Video Only)</option>
|
||||
<option value="lowestvideo">Lowest (Video Only)</option>
|
||||
<option value="highest">Highest</option>
|
||||
<option value="lowest">Lowest</option>
|
||||
</select>
|
||||
<p>Filename:</p>
|
||||
<input id="filename" placeholder="Enter filename" name="filename"><br>
|
||||
<p>Format:</p>
|
||||
<select required id="format" name="format">
|
||||
<option value="mp4">.mp4</option>
|
||||
<option value="wmv">.wmv</option>
|
||||
<option value="flv">.flv</option>
|
||||
<option value="avi">.avi</option>
|
||||
<option value="mp3">.mp3</option>
|
||||
<option value="mpg">.mpg</option>
|
||||
</select>
|
||||
<input type="submit" placeholder="test">
|
||||
</form>
|
||||
<hr>
|
||||
<p>Thank you, <a>please consider donating</a> so that I may pay for hosting costs! (Or, you may also help me out by
|
||||
hosting it <em>yourself</em> instead of using this site! (Check github for more details)</p><br>
|
||||
<p>Check out the <a id="github" href="https://github.com/Violets-puragtory/YoutubeConverter">Github page</a> to
|
||||
learn how to host it yourself, how it works, report bugs, and more.</p>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,5 +1,6 @@
|
|||
:root {
|
||||
--text-color: rgb(230, 210, 255);
|
||||
--primary-color: rgb(230, 210, 255);
|
||||
--text-color: white;
|
||||
--background-color: rgb(50, 35, 75);
|
||||
--second-bg-color: black;
|
||||
}
|
||||
|
@ -10,7 +11,14 @@
|
|||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
}
|
||||
|
||||
p, select, input {
|
||||
h1,
|
||||
h1>* {
|
||||
color: var(--primary-color)
|
||||
}
|
||||
|
||||
p,
|
||||
select,
|
||||
input {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
|
@ -18,30 +26,37 @@ p {
|
|||
margin: 5px;
|
||||
}
|
||||
|
||||
body, html {
|
||||
body,
|
||||
html {
|
||||
background-color: var(--background-color);
|
||||
}
|
||||
|
||||
.grid-container {
|
||||
width: 100%;
|
||||
margin: auto;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
/* .grid-container > *:not(select, input) {
|
||||
float: left;
|
||||
} */
|
||||
|
||||
select, input{
|
||||
select,
|
||||
input {
|
||||
display: inline-grid;
|
||||
background-color: var(--second-bg-color);
|
||||
color: var(--text-color);
|
||||
color: var(--primary-color);
|
||||
margin: 5px auto;
|
||||
border: 2px var(--text-color) solid;
|
||||
border: 2px var(--primary-color) solid;
|
||||
border-radius: 5px;
|
||||
/* width: 70%; */
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.col-sm-3 {
|
||||
outline: white solid 2px
|
||||
}
|
||||
|
||||
select:hover,
|
||||
input:hover {
|
||||
color: var(--text-color);
|
||||
border-color: var(--text-color)
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 1.5rem;
|
||||
}
|
Loading…
Reference in a new issue