Enhancements

pull/204/head v3.17.0
Andrew 2 years ago
parent 672bd5c954
commit 0b51534b3d

@ -339,7 +339,7 @@ body {
left: 0; left: 0;
right: 0; right: 0;
margin: auto; margin: auto;
top: 16%; top: 20%;
background-color: var(--box-main); background-color: var(--box-main);
border-radius: 10px; border-radius: 10px;
width: 80%; width: 80%;
@ -582,6 +582,7 @@ button {
h2{ h2{
margin: 12px; margin: 12px;
font-size: 24px;
} }
/* Scrollbar */ /* Scrollbar */

@ -10,12 +10,12 @@
<p>ytDownloader lets you download videos and audios of different qualities from hundreds of <p>ytDownloader lets you download videos and audios of different qualities from hundreds of
sites including the popular ones but not limited to Youtube, Facebook, Instagram, Tiktok, sites including the popular ones but not limited to Youtube, Facebook, Instagram, Tiktok,
Twitter, Twitch and so on.</p> Twitter, Twitch and so on.</p>
<p>✔️ Supports Light/Dark/Transparent mode</p>
<p>✔️ Supports high quality video resolutions</p> <p>✔️ Supports high quality video resolutions</p>
<p>✔️ Supports audio extraction in multiple formats</p> <p>✔️ Supports audio extraction in multiple formats</p>
<p>✔️ Supports playlist downloads</p> <p>✔️ Supports playlist downloads</p>
<p>✔️ Supports downloading particular ranges</p> <p>✔️ Supports downloading particular ranges</p>
<p>✔️ Supports downloading subtitles</p> <p>✔️ Supports downloading subtitles</p>
<p>✔️ Supports multiple themes</p>
<p>✔️ Completely free and open source</p> <p>✔️ Completely free and open source</p>
<p>✔️ Fast download speeds</p> <p>✔️ Fast download speeds</p>
</description> </description>

@ -95,7 +95,7 @@
<!-- Video tab --> <!-- Video tab -->
<div id="videoList"> <div id="videoList">
<div class="separationBox"> <div class="separationBox">
<h2>Video</h2> <h2 id="videoHeader">Video</h2>
<label class="formatSelect">Select Format </label> <label class="formatSelect">Select Format </label>
<select id="videoFormatSelect" class="select"> <select id="videoFormatSelect" class="select">
</select> </select>
@ -104,7 +104,7 @@
<!-- Audio options for video --> <!-- Audio options for video -->
<div id="audioForVideo"> <div id="audioForVideo">
<h2>Audio</h2> <h2 id="audioHeader">Audio</h2>
<label class="formatSelect">Select Audio Format </label> <label class="formatSelect">Select Audio Format </label>
<select id="audioForVideoFormatSelect" class="select"> <select id="audioForVideoFormatSelect" class="select">
</select> </select>

4
package-lock.json generated

@ -1,12 +1,12 @@
{ {
"name": "ytdownloader", "name": "ytdownloader",
"version": "3.16.1", "version": "3.17.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ytdownloader", "name": "ytdownloader",
"version": "3.16.1", "version": "3.17.0",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"electron-updater": "^5.3.0", "electron-updater": "^5.3.0",

@ -4,7 +4,7 @@
"yt-dlp-wrap-plus": "^2.3.18" "yt-dlp-wrap-plus": "^2.3.18"
}, },
"name": "ytdownloader", "name": "ytdownloader",
"version": "3.16.2", "version": "3.17.0",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
"start": "electron .", "start": "electron .",
@ -88,7 +88,6 @@
"snap", "snap",
"rpm", "rpm",
"zip", "zip",
"pacman",
"deb" "deb"
], ],
"category": "Utility", "category": "Utility",

@ -261,7 +261,7 @@ async function getInfo(url) {
// Cleaning text // Cleaning text
getId("videoFormatSelect").innerHTML = ""; getId("videoFormatSelect").innerHTML = "";
getId("audioFormatSelect").innerHTML = ""; getId("audioFormatSelect").innerHTML = "";
getId("audioForVideoFormatSelect").innerHTML = ""; getId("audioForVideoFormatSelect").innerHTML = `<option value="none|none">No Audio</option>`;
const startTime = getId("startTime"); const startTime = getId("startTime");
startTime.value = ""; startTime.value = "";
@ -488,7 +488,7 @@ async function getInfo(url) {
if ( if (
(format.video_ext !== "none" && (format.video_ext !== "none" &&
format.audio_ext === "none" && format.acodec === "none" &&
!( !(
format.video_ext === "mp4" && format.video_ext === "mp4" &&
format.vcodec && format.vcodec &&
@ -626,30 +626,7 @@ async function getInfo(url) {
format.audio_ext !== "none" || format.audio_ext !== "none" ||
(format.acodec !== "none" && format.video_ext !== "none") (format.acodec !== "none" && format.video_ext !== "none")
) { ) {
let size; // Skip them
if (format.filesize || format.filesize_approx) {
size = (
Number(format.filesize || format.filesize_approx) /
1000000
).toFixed(2);
} else {
size = i18n.__("Unknown size");
}
const element =
"<option value='" +
(format.format_id + "|" + format.ext) +
"'>" +
(i18n.__(format.format_note) ||
format.resolution ||
i18n.__("Unknown quality")) +
" | " +
format.ext +
" | " +
size +
" " +
i18n.__("MB") +
"</option>";
getId("videoFormatSelect").innerHTML += element;
} }
// When there is no audio // When there is no audio
@ -940,7 +917,7 @@ function download(
audioForVideoExt = audioForVideoValue.split("|")[1]; audioForVideoExt = audioForVideoValue.split("|")[1];
} }
if ((videoExt === "mp4" && audioForVideoExt === "opus") || (videoExt === "webm" && audioForVideoExt === "m4a")) { if ((videoExt === "mp4" && audioForVideoExt === "opus") || (videoExt === "webm" && (audioForVideoExt === "m4a" || audioForVideoExt === "mp4"))) {
ext = "mkv" ext = "mkv"
} else { } else {
ext = videoExt; ext = videoExt;
@ -1031,24 +1008,23 @@ function download(
console.log("Filename:", filename); console.log("Filename:", filename);
/**@type {string} */ /**@type {string} */
let audioFormat; let audioFormat = "+ba";
if (audioForVideoFormat_id === "auto") { if (audioForVideoFormat_id === "auto") {
if (ext === "mp4") { if (ext === "mp4") {
if (!(audioExtensionList.length == 0)) { if (!(audioExtensionList.length == 0)) {
if (audioExtensionList.includes("m4a")) { if (audioExtensionList.includes("m4a")) {
audioFormat = "+m4a"; audioFormat = "+m4a";
} else {
audioFormat = "+ba";
} }
} else { } else {
audioFormat = ""; audioFormat = "";
} }
} else {
audioFormat = "+ba";
} }
} else { } else if (audioForVideoFormat_id === "none") {
audioFormat = ""
}
else {
audioFormat = `+${audioForVideoFormat_id}`; audioFormat = `+${audioForVideoFormat_id}`;
} }
@ -1159,6 +1135,8 @@ function download(
); );
} }
console.log("Spawn args:" + downloadProcess.ytDlpProcess.spawnargs[downloadProcess.ytDlpProcess.spawnargs.length - 1])
getId(randomId + ".close").addEventListener("click", () => { getId(randomId + ".close").addEventListener("click", () => {
controller.abort() controller.abort()
try { try {

@ -20,7 +20,9 @@ document.querySelectorAll(".formatSelect").forEach((element) => {
getId("videoDownload").textContent = i18n.__("Download"); getId("videoDownload").textContent = i18n.__("Download");
getId("audioDownload").textContent = i18n.__("Download"); getId("audioDownload").textContent = i18n.__("Download");
getId("videoToggle").textContent = i18n.__("Video"); getId("videoToggle").textContent = i18n.__("Video");
getId("videoHeader").textContent = i18n.__("Video");
getId("audioToggle").textContent = i18n.__("Audio"); getId("audioToggle").textContent = i18n.__("Audio");
getId("audioHeader").textContent = i18n.__("Audio");
getId("advancedVideoToggle").textContent = i18n.__("More options"); getId("advancedVideoToggle").textContent = i18n.__("More options");
getId("advancedAudioToggle").textContent = i18n.__("More options"); getId("advancedAudioToggle").textContent = i18n.__("More options");
getId("rangeText").textContent = i18n.__("Download particular time-range"); getId("rangeText").textContent = i18n.__("Download particular time-range");

@ -109,5 +109,6 @@
"Solarized Dark": "Solarized Dark", "Solarized Dark": "Solarized Dark",
"Preferred video codec": "Preferred video codec", "Preferred video codec": "Preferred video codec",
"Show more format options": "Show more format options", "Show more format options": "Show more format options",
"You need to give the app permission to access home directory to use this. You can do it with Flatseal by enabling the permission with text 'filesystem=home'": "You need to give the app permission to access home directory to use this. You can do it with Flatseal by enabling the permission with text 'filesystem=home'" "You need to give the app permission to access home directory to use this. You can do it with Flatseal by enabling the permission with text 'filesystem=home'": "You need to give the app permission to access home directory to use this. You can do it with Flatseal by enabling the permission with text 'filesystem=home'",
"No Audio":"No Audio"
} }

Loading…
Cancel
Save