Further enhancements

pull/9/head
aandrew-me 4 years ago
parent b6e425b5c2
commit d36bba4b0e

@ -83,6 +83,7 @@ body {
text-align: left; text-align: left;
opacity: 1; opacity: 1;
font-size: large; font-size: large;
z-index:2;
} }
.menuItem { .menuItem {
color: white; color: white;
@ -150,6 +151,17 @@ body {
height:15px; height:15px;
} }
#closeHidden{
bottom:5px;
position: absolute;
right:5px;
cursor: pointer;
cursor: pointer;
width:15px;
height:15px;
}
#hidden { #hidden {
display: none; display: none;
/* display: inline-block; */ /* display: inline-block; */

@ -14,12 +14,10 @@
<a id="back">Home</a> <a id="back">Home</a>
<h1>ytDownloader</h1> <h1>ytDownloader</h1>
<p>ytDownloader allows you to download videos of all resolutions provided by YouTube. <p>ytDownloader lets you download videos (and sometimes audios) from hundreds of sites like Youtube, Facebook, Instagram, Tiktok, Twitter and so on.
They can be downloaded in different encoding formats. The same goes for audio files.
</p> </p>
<p>It's a Free and Open Source app built on top of Node.js and Electron. ytdl-core has been used for downloading <p>It's a Free and Open Source app built on top of Node.js and Electron. yt-dlp has been used for downloading</p>
from YouTube</p>
<p>Source Code is available <a id="sourceLink">here</a></p> <p>Source Code is available <a id="sourceLink">here</a></p>

@ -46,7 +46,6 @@
<a id="aboutWin" class="menuItem">About</a> <a id="aboutWin" class="menuItem">About</a>
</div> </div>
<button id="pasteUrl" class="submitBtn">Click to paste video URL or ID [Ctrl + V]</button> <button id="pasteUrl" class="submitBtn">Click to paste video URL or ID [Ctrl + V]</button>
<div id="loadingWrapper"> <div id="loadingWrapper">
@ -67,7 +66,7 @@
<p id="incorrectMsg"></p> <p id="incorrectMsg"></p>
<div id="hidden"> <div id="hidden">
<img src="../assets/images/close.png" alt="close" id="closeHidden">
<div id="btnContainer"> <div id="btnContainer">
<button class="toggleBtn" id="videoToggle">Video</button> <button class="toggleBtn" id="videoToggle">Video</button>
<button class="toggleBtn" id="audioToggle">Audio</button> <button class="toggleBtn" id="audioToggle">Audio</button>

@ -10,14 +10,13 @@
<body> <body>
<a id="back">Home</a> <a id="back">Home</a>
<h1>Preferences</h1> <h1>Preferences</h1>
<strong>Restart app for changes to take place</strong>
<p>1. Download location</p> <p>1. Download location</p>
<p>Default location: <span id="path"></span></p> <p>Default location: <span id="path"></span></p>
<button id="selectLocation">Select Download Location</button> <button id="selectLocation">Select Download Location</button>
<p id="msg"></pid> <p id="msg"></pid>
<p>2. Enable transparent dark (only Linux) <input type="checkbox" id="enableTransparent"></p> <p>2. Enable transparent dark (only Linux, needs restart) <input type="checkbox" id="enableTransparent"></p>
<script> <script>
let downloadPath = localStorage.getItem("downloadPath") let downloadPath = localStorage.getItem("downloadPath")

File diff suppressed because it is too large Load Diff

@ -5,7 +5,7 @@
"yt-dlp-wrap": "^2.3.11" "yt-dlp-wrap": "^2.3.11"
}, },
"name": "ytdownloader", "name": "ytdownloader",
"version": "2.1.0", "version": "3.0.0",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
"start": "electron .", "start": "electron .",

@ -23,15 +23,21 @@ function getId(id) {
return document.getElementById(id); return document.getElementById(id);
} }
let localPath = localStorage.getItem("downloadPath"); function downloadPathSelection(){
let localPath = localStorage.getItem("downloadPath");
if (localPath) { if (localPath) {
downloadDir = localPath; downloadDir = localPath;
} else { } else {
downloadDir = appdir; downloadDir = appdir;
localStorage.setItem("downloadPath", appdir); localStorage.setItem("downloadPath", appdir);
}
fs.mkdir(downloadDir, { recursive: true }, () => {});
} }
fs.mkdir(downloadDir, { recursive: true }, () => {});
downloadPathSelection()
// Checking for yt-dlp // Checking for yt-dlp
let ytDlp; let ytDlp;
@ -105,6 +111,11 @@ function pasteUrl() {
getInfo(url); getInfo(url);
} }
getId("closeHidden").addEventListener("click", ()=>{
getId("hidden").style.display = "none";
getId("loadingWrapper").style.display = "none";
})
document.addEventListener("keydown", (event) => { document.addEventListener("keydown", (event) => {
if (event.ctrlKey && event.key == "v") { if (event.ctrlKey && event.key == "v") {
pasteUrl(); pasteUrl();
@ -117,6 +128,7 @@ getId("pasteUrl").addEventListener("click", () => {
// Getting video info // Getting video info
async function getInfo(url) { async function getInfo(url) {
downloadPathSelection()
getId("videoFormatSelect").innerHTML = ""; getId("videoFormatSelect").innerHTML = "";
getId("audioFormatSelect").innerHTML = ""; getId("audioFormatSelect").innerHTML = "";
let info; let info;

Loading…
Cancel
Save