enabled subtitles

pull/18/head
aandrew-me 3 years ago
parent 046e90bcd4
commit f6c54b4965

@ -77,11 +77,19 @@ input[type="checkbox"]{
font-size: large;
color:white;
background-color: rgb(56, 209, 56);
border-bottom: 4px solid rgb(41, 155, 41);
cursor: pointer;
position: relative;
}
#selectLocation:active{
border-bottom: none;
top: 4px;
margin-bottom: 4px;
}
select {
padding: 15px;
background-color: rgb(127, 253, 127);
background-color: rgb(88, 232, 88);
border: none;
border-radius: 8px;
cursor: pointer;

@ -231,10 +231,10 @@ input[type="checkbox"]{
.submitBtn {
padding: 15px;
border-radius: 10px;
background-color: rgb(64, 227, 64);
background-color: rgb(41 203 41);
color: white;
border: none;
border-bottom: 4px solid rgb(50, 185, 50);
border-bottom: 4px solid rgb(31 139 31);
font-size: large;
cursor: pointer;
display: inline-block;

@ -110,11 +110,11 @@
<label id="end">End</label>
<br><br>
<!-- <h3>Subtitles</h3>
<h3>Subtitles</h3>
<span>Download subtitles if available</span>
<input id="subChecked" type="checkbox">
<br><br>
<!-- <br><br>
<span>Download auto generated subtitles</span>
<input id="autoSubChecked" type="checkbox"> -->
</div>

@ -27,7 +27,8 @@ let downloadDir = "";
// Global variables
let title, onlyvideo, id, thumbnail, ytdlp, duration, extractFormat;
let rangeCmd = "";
// let subs = ""
let subs = ""
let subLangs;
// let autoSubs = ""
let rangeOption = "--download-sections";
@ -108,7 +109,7 @@ async function downloadYtdlp() {
console.log("yt-dlp bin Path: " + ytDlp);
}
// Checking is yt-dlp has been installed by user
// Checking if yt-dlp has been installed by user
cp.exec("yt-dlp --version", (error, stdout, stderr) => {
if (error) {
// Checking if yt-dlp has been installed by program
@ -159,7 +160,7 @@ function defaultVideoToggle() {
getId("videoList").style.display = "block";
}
//! Pasting url from clipboard
// Pasting url from clipboard
function pasteUrl() {
defaultVideoToggle();
@ -451,13 +452,15 @@ function manageAdvanced(duration) {
rangeCmd = "";
}
// // If subtitles are checked
// if (getId("subChecked").checked){
// subs = "--write-subs"
// }
// else{
// subs = ""
// }
// If subtitles are checked
if (getId("subChecked").checked){
subs = "--write-subs"
subLangs = "--sub-langs all"
}
else{
subs = ""
subLangs = ""
}
// // If autosubs are checked
// if (getId("autoSubChecked").checked){
@ -581,7 +584,8 @@ function download(type) {
`${path.join(downloadDir, filename + `.${ext}`)}`,
"--ffmpeg-location",
ffmpeg,
// subs,
subs,
subLangs
// autoSubs
],
{ shell: true, detached: false },
@ -601,7 +605,8 @@ function download(type) {
`${path.join(downloadDir, filename + `.${ext}`)}`,
"--ffmpeg-location",
ffmpeg,
// subs,
subs,
subLangs
// autoSubs
],
{ shell: true, detached: false },

@ -0,0 +1,9 @@
export default{
"Click to paste video URL or ID [Ctrl + V]":"Click to paste video URL or ID [Ctrl + V]",
"Preferences":"Preferences",
"About":"About",
"1. Download location":"1. Download location",
"Default location:" : "Default location:",
"2. Enable transparent dark (only Linux, needs restart)" : "2. Enable transparent dark (only Linux, needs restart)",
"yt-dlp is being downloaded"
}
Loading…
Cancel
Save