1.5.3
This commit is contained in:
parent
6a3d4820c1
commit
c569c0beca
@ -148,7 +148,17 @@ $(function() {
|
|||||||
var YT = JSON.parse(body);
|
var YT = JSON.parse(body);
|
||||||
$(
|
$(
|
||||||
`<div class="media">
|
`<div class="media">
|
||||||
<img id="img-` + video_id + `" class="d-flex align-self-start mr-3" src="`+ YT.thumbnail_url +`" alt="Generic placeholder image">
|
<div class="d-flex alogn-self-start mr-3" style="
|
||||||
|
background:url(` + YT.thumbnail_url + `);
|
||||||
|
width: 189px;
|
||||||
|
height: 104px;
|
||||||
|
background-size: 189px;
|
||||||
|
background-position: 0px -18px;
|
||||||
|
">
|
||||||
|
<div class="media-out-` + video_id + `" style=" color: #FFF !important;
|
||||||
|
text-shadow: #454545 1px 1px 1px;
|
||||||
|
margin: auto;"></div>
|
||||||
|
</div>
|
||||||
<div class="media-body" id="body-` + video_id + `">
|
<div class="media-body" id="body-` + video_id + `">
|
||||||
<h5 class="mt-0">` + YT.title + `</h5>
|
<h5 class="mt-0">` + YT.title + `</h5>
|
||||||
Author: ` + YT.author_name + `
|
Author: ` + YT.author_name + `
|
||||||
@ -196,7 +206,8 @@ $(function() {
|
|||||||
cache[video_id] = YT.title;
|
cache[video_id] = YT.title;
|
||||||
ipcRenderer.send('start-download', {
|
ipcRenderer.send('start-download', {
|
||||||
url: $('#url').val(),
|
url: $('#url').val(),
|
||||||
id: video_id
|
id: video_id,
|
||||||
|
title: helper.replace(YT.title)
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -215,10 +226,14 @@ $(function() {
|
|||||||
|
|
||||||
function getCommandLine() {
|
function getCommandLine() {
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'darwin' : return 'open';
|
case 'darwin':
|
||||||
case 'win32' : return 'start';
|
return 'open';
|
||||||
case 'win64' : return 'start';
|
case 'win32':
|
||||||
default : return 'xdg-open';
|
return 'start';
|
||||||
|
case 'win64':
|
||||||
|
return 'start';
|
||||||
|
default:
|
||||||
|
return 'xdg-open';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -148,15 +148,16 @@
|
|||||||
transform: rotate(-48deg);
|
transform: rotate(-48deg);
|
||||||
-webkit-transform: rotate(-48deg);
|
-webkit-transform: rotate(-48deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress {
|
.progress {
|
||||||
height: 10px;
|
height: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress .progress-bar {
|
.progress .progress-bar {
|
||||||
height: 5px;
|
height: 5px;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
background-color: #FFF;
|
background-color: #FFF;
|
||||||
content: "";
|
content: "";
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
@ -169,7 +170,8 @@
|
|||||||
<div class="center"></div>
|
<div class="center"></div>
|
||||||
<div class="inner"></div>
|
<div class="inner"></div>
|
||||||
</div>
|
</div>
|
||||||
<iframe id="coub" src="https://coub.com/embed/ulak9?muted=false&autostart=true&originalSize=false&startWithHD=false" allowfullscreen="true" frameborder="0" width="320" height="180"></iframe><script async src="https://c-cdn.coub.com/embed-runner.js"></script>
|
<iframe id="coub" src="https://coub.com/embed/ulak9?muted=false&autostart=true&originalSize=false&startWithHD=false" allowfullscreen="true" frameborder="0" width="320" height="180"></iframe>
|
||||||
|
<script async src="https://c-cdn.coub.com/embed-runner.js"></script>
|
||||||
<hr/>
|
<hr/>
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
<div class="progress-bar" id="main"></div>
|
<div class="progress-bar" id="main"></div>
|
||||||
@ -181,8 +183,8 @@
|
|||||||
"whbex",
|
"whbex",
|
||||||
"wf0jb",
|
"wf0jb",
|
||||||
"ulak9",
|
"ulak9",
|
||||||
"wcmxa",
|
"wc5e2",
|
||||||
"wc5e2"
|
"xza2z"
|
||||||
];
|
];
|
||||||
var x = Math.floor(Math.random() * start.length)
|
var x = Math.floor(Math.random() * start.length)
|
||||||
$('#coub').attr('src', 'https://coub.com/embed/' + start[x] + '?muted=false&autostart=true&originalSize=false&startWithHD=false')
|
$('#coub').attr('src', 'https://coub.com/embed/' + start[x] + '?muted=false&autostart=true&originalSize=false&startWithHD=false')
|
||||||
@ -199,7 +201,7 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -8,19 +8,14 @@
|
|||||||
module = undefined;
|
module = undefined;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<!--<script src="./../libs/jquery/jquery-3.2.1.min.js"></script>
|
|
||||||
<script src="./../libs/bootstrap/js/bootstrap.js"></script>-->
|
|
||||||
<script src="./../libs/jquery/jquery-3.2.1.min.js"></script>
|
<script src="./../libs/jquery/jquery-3.2.1.min.js"></script>
|
||||||
<script src="./../libs/popper.min.js"></script>
|
<script src="./../libs/popper.min.js"></script>
|
||||||
<script src="./../libs/bootstrap/bootstrap.min.js"></script>
|
<script src="./../libs/bootstrap/bootstrap.min.js"></script>
|
||||||
<script src="./../js/player.js"></script>
|
<script src="./../js/player.js"></script>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Cyb3r Downloader</title>
|
<title>Cyb3r Downloader</title>
|
||||||
<!--<link rel="stylesheet" href="./../libs/bootstrap/css/bootstrap.css" />
|
|
||||||
<link rel="stylesheet" href="./../libs/bootstrap/css/bootstrap-theme.css" />-->
|
|
||||||
<link rel="stylesheet" href="./../libs/bootstrap/bootstrap.min.css">
|
<link rel="stylesheet" href="./../libs/bootstrap/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="./../libs/font-awesome/css/font-awesome.min.css" />
|
<link rel="stylesheet" href="./../libs/font-awesome/css/font-awesome.min.css" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="./../style/bootstrap.min.css" />
|
<link rel="stylesheet" href="./../style/bootstrap.min.css" />
|
||||||
<link rel="stylesheet" href="./../style/style.css" />
|
<link rel="stylesheet" href="./../style/style.css" />
|
||||||
<link rel="stylesheet" href="./../style/player.css" />
|
<link rel="stylesheet" href="./../style/player.css" />
|
||||||
@ -144,17 +139,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
|
require('remote').getCurrentWindow().toggleDevTools();
|
||||||
const webview = document.querySelector('webview')
|
const webview = document.querySelector('webview')
|
||||||
const indicator = document.querySelector('.indicator')
|
const indicator = document.querySelector('.indicator')
|
||||||
|
|
||||||
const loadstart = () => {
|
const loadstart = () => {
|
||||||
console.log('LEL');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadstop = () => {
|
const loadstop = () => {
|
||||||
$('#webview-url').val(webview.getURL());
|
$('#webview-url').val(webview.getURL());
|
||||||
|
|
||||||
console.log('stop');
|
|
||||||
}
|
}
|
||||||
$('#webviewload').click(()=>{
|
$('#webviewload').click(()=>{
|
||||||
var url = $('#webview-url').val();
|
var url = $('#webview-url').val();
|
||||||
@ -177,6 +171,23 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<h1>Info</h1>
|
<h1>Info</h1>
|
||||||
<a href="https://git.tooru.thee.moe/theenoro/electron-simple-youtube-downloader" target="_blank">Git</a>
|
<a href="https://git.tooru.thee.moe/theenoro/electron-simple-youtube-downloader" target="_blank">Git</a>
|
||||||
|
<div id="rss">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
/*
|
||||||
|
$(()=>{
|
||||||
|
$.get( "https://git.tooru.thee.moe/theenoro/electron-simple-youtube-downloader/commits/master?format=atom", function( data ) {
|
||||||
|
$xml = $( data ),
|
||||||
|
$title = $xml.find( "title" );
|
||||||
|
console.log($xml)
|
||||||
|
$('#rss').html(data.toString());
|
||||||
|
alert( "Load was performed." );
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
|
*/
|
||||||
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -194,9 +205,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="./../js/app.js"></script>
|
<script src="./../js/app.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
document.addEventListener("keydown", function(e) {
|
document.addEventListener("keydown", function(e) {
|
||||||
if (e.which === 123) {
|
if (e.which === 123) {
|
||||||
require('remote').getCurrentWindow().toggleDevTools();
|
|
||||||
} else if (e.which === 116) {
|
} else if (e.which === 116) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
var request = require('request');
|
const request = require('request');
|
||||||
|
|
||||||
request('https://vivo.sx/76aa530aac', function(error, response, body) {
|
request('https://vivo.sx/76aa530aac', function(error, response, body) {
|
||||||
console.log('error:', error); // Print the error if one occurred
|
console.log('error:', error); // Print the error if one occurred
|
||||||
console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
|
console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
|
||||||
|
@ -2,7 +2,9 @@ const request = require('request');
|
|||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const ipcMain = require('electron').ipcMain;
|
const ipcMain = require('electron').ipcMain;
|
||||||
const unzip = require('unzip');
|
const unzip = require('unzip');
|
||||||
const { spawn } = require('child_process');
|
const {
|
||||||
|
spawn
|
||||||
|
} = require('child_process');
|
||||||
|
|
||||||
|
|
||||||
var libsx = {
|
var libsx = {
|
||||||
@ -165,7 +167,9 @@ libs.download = (url,data,cb)=>{
|
|||||||
actual += chunk.length;
|
actual += chunk.length;
|
||||||
perc = actual / full * 100;
|
perc = actual / full * 100;
|
||||||
console.log(perc);
|
console.log(perc);
|
||||||
libs.listen.sender.send('progress',{percent :Math.floor(perc)});
|
libs.listen.sender.send('progress', {
|
||||||
|
percent: Math.floor(perc)
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
r.on('response', function(res) {
|
r.on('response', function(res) {
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
const { exec } = require('child_process');
|
const {
|
||||||
|
exec
|
||||||
|
} = require('child_process');
|
||||||
|
|
||||||
var install = {};
|
var install = {};
|
||||||
|
|
||||||
@ -40,7 +42,9 @@ install.download = (url,cb) =>{
|
|||||||
actual += chunk.length;
|
actual += chunk.length;
|
||||||
perc = actual / full * 100;
|
perc = actual / full * 100;
|
||||||
console.log(perc);
|
console.log(perc);
|
||||||
libs.listen.sender.send('progress',{percent :Math.floor(perc)});
|
libs.listen.sender.send('progress', {
|
||||||
|
percent: Math.floor(perc)
|
||||||
|
});
|
||||||
});
|
});
|
||||||
r.on('response', function(res) {
|
r.on('response', function(res) {
|
||||||
var path = global.dir + '/tmp/' + url.split('/')[url.split('/').length - 1];
|
var path = global.dir + '/tmp/' + url.split('/')[url.split('/').length - 1];
|
||||||
|
@ -37,14 +37,18 @@ pot.isOpen = false;
|
|||||||
pot.open = (e) => {
|
pot.open = (e) => {
|
||||||
s = e;
|
s = e;
|
||||||
if (win !== null) {
|
if (win !== null) {
|
||||||
e.sender.send('play-in-Window',{do :false});
|
e.sender.send('play-in-Window', {
|
||||||
|
do: false
|
||||||
|
});
|
||||||
win.close();
|
win.close();
|
||||||
}
|
}
|
||||||
var x = new playerOnTop(e);
|
var x = new playerOnTop(e);
|
||||||
}
|
}
|
||||||
pot.close = () => {
|
pot.close = () => {
|
||||||
console.log('CLOSE')
|
console.log('CLOSE')
|
||||||
s.sender.send('play-in-Window',{do :false});
|
s.sender.send('play-in-Window', {
|
||||||
|
do: false
|
||||||
|
});
|
||||||
win.close();
|
win.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +64,9 @@ class playerOnTop {
|
|||||||
alwaysOnTop: true,
|
alwaysOnTop: true,
|
||||||
icon: global.dir + '/app.ico'
|
icon: global.dir + '/app.ico'
|
||||||
})
|
})
|
||||||
e.sender.send('play-in-Window',{do :true});
|
e.sender.send('play-in-Window', {
|
||||||
|
do: true
|
||||||
|
});
|
||||||
win = this.win;
|
win = this.win;
|
||||||
win.loadURL(`file://${global.dir}/app/view/pot.html`)
|
win.loadURL(`file://${global.dir}/app/view/pot.html`)
|
||||||
win.once('ready-to-show', () => {
|
win.once('ready-to-show', () => {
|
||||||
@ -74,7 +80,9 @@ class playerOnTop {
|
|||||||
});
|
});
|
||||||
win.on('closed', () => {
|
win.on('closed', () => {
|
||||||
pot.isOpen = false;
|
pot.isOpen = false;
|
||||||
e.sender.send('play-in-Window',{do :false});
|
e.sender.send('play-in-Window', {
|
||||||
|
do: false
|
||||||
|
});
|
||||||
win = null;
|
win = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
const {app, Menu, Tray} = require('electron')
|
const {
|
||||||
|
app,
|
||||||
|
Menu,
|
||||||
|
Tray
|
||||||
|
} = require('electron')
|
||||||
const main_window = require('./windows.js/main.js')
|
const main_window = require('./windows.js/main.js')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
@ -15,14 +19,23 @@ module.exports = ()=>{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
let tray = new Tray(path.join(global.dir + '/app.png'))
|
let tray = new Tray(path.join(global.dir + '/app.png'))
|
||||||
const contextMenu = Menu.buildFromTemplate([
|
const contextMenu = Menu.buildFromTemplate([{
|
||||||
{label: 'Open', click(){ main_window.open() }},
|
label: 'Open',
|
||||||
|
click() {
|
||||||
|
main_window.open()
|
||||||
|
}
|
||||||
|
},
|
||||||
/*{label: 'About',click() { console.log('item 1 clicked') }},
|
/*{label: 'About',click() { console.log('item 1 clicked') }},
|
||||||
{label: 'Item1', type: 'radio'},
|
{label: 'Item1', type: 'radio'},
|
||||||
{type: 'separator'},
|
{type: 'separator'},
|
||||||
{label: 'Item2', type: 'radio'},
|
{label: 'Item2', type: 'radio'},
|
||||||
{label: 'Item3', type: 'radio', checked: true},*/
|
{label: 'Item3', type: 'radio', checked: true},*/
|
||||||
{label: 'Beenden', click() { main_window.close(); }},
|
{
|
||||||
|
label: 'Beenden',
|
||||||
|
click() {
|
||||||
|
main_window.close();
|
||||||
|
}
|
||||||
|
},
|
||||||
])
|
])
|
||||||
tray.setToolTip('Cyb3r Downloader.')
|
tray.setToolTip('Cyb3r Downloader.')
|
||||||
tray.setContextMenu(contextMenu)
|
tray.setContextMenu(contextMenu)
|
||||||
|
@ -22,7 +22,10 @@ class folderWatchr {
|
|||||||
});
|
});
|
||||||
for (var i = 0; i < files.length; i++) {
|
for (var i = 0; i < files.length; i++) {
|
||||||
files[i] = files[i].replace(/\\/g, "/");
|
files[i] = files[i].replace(/\\/g, "/");
|
||||||
watch_event.sender.send('watchr_file',{type:"add",file:files[i]});
|
watch_event.sender.send('watchr_file', {
|
||||||
|
type: "add",
|
||||||
|
file: files[i]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function listener(changeType, fullPath, currentStat, previousStat) {
|
function listener(changeType, fullPath, currentStat, previousStat) {
|
||||||
@ -36,10 +39,16 @@ class folderWatchr {
|
|||||||
|
|
||||||
console.log('the file', fullPath, 'was created', currentStat)
|
console.log('the file', fullPath, 'was created', currentStat)
|
||||||
files.push(fullPath);
|
files.push(fullPath);
|
||||||
watch_event.sender.send('watchr_file',{type:"add",file:fullPath});
|
watch_event.sender.send('watchr_file', {
|
||||||
|
type: "add",
|
||||||
|
file: fullPath
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
watch_event.sender.send('watchr_file',{type:"remove",file:fullPath});
|
watch_event.sender.send('watchr_file', {
|
||||||
|
type: "remove",
|
||||||
|
file: fullPath
|
||||||
|
});
|
||||||
files.splice(files.indexOf(fullPath), 1);
|
files.splice(files.indexOf(fullPath), 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
BrowserWindow,
|
BrowserWindow,
|
||||||
session
|
session
|
||||||
@ -18,7 +16,9 @@ class browser {
|
|||||||
icon: global.dir + '/app.ico'
|
icon: global.dir + '/app.ico'
|
||||||
})
|
})
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
session.defaultSession.cookies.get({url:'http://crunchyroll.com'}, (error, cookies) => {
|
session.defaultSession.cookies.get({
|
||||||
|
url: 'http://crunchyroll.com'
|
||||||
|
}, (error, cookies) => {
|
||||||
//console.log(error, cookies)
|
//console.log(error, cookies)
|
||||||
crunch.session_save(cookies);
|
crunch.session_save(cookies);
|
||||||
})
|
})
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
const { spawn } = require('child_process');
|
const {
|
||||||
const {Notification,ipcMain}= require('electron');
|
spawn
|
||||||
|
} = require('child_process');
|
||||||
|
const {
|
||||||
|
Notification,
|
||||||
|
ipcMain
|
||||||
|
} = require('electron');
|
||||||
const dl_routine = require('./youtube-dl.routine')
|
const dl_routine = require('./youtube-dl.routine')
|
||||||
const nodeID3 = require('node-id3');
|
const nodeID3 = require('node-id3');
|
||||||
|
|
||||||
@ -15,12 +20,14 @@ var format = "mp3";
|
|||||||
var fol = null;
|
var fol = null;
|
||||||
|
|
||||||
var pot_open_ev = null;
|
var pot_open_ev = null;
|
||||||
var request = require('request').defaults({ encoding: null });
|
var request = require('request').defaults({
|
||||||
|
encoding: null
|
||||||
|
});
|
||||||
|
|
||||||
ipcMain
|
ipcMain
|
||||||
.on('start-download', (event, arg) => {
|
.on('start-download', (event, arg) => {
|
||||||
path = orig_path
|
path = orig_path
|
||||||
var download = new yt_dl(arg.url,arg.id);
|
var download = new yt_dl(arg.url, arg.id, arg.title);
|
||||||
download.addListen(event)
|
download.addListen(event)
|
||||||
download.download();
|
download.download();
|
||||||
})
|
})
|
||||||
@ -53,11 +60,12 @@ ipcMain
|
|||||||
});
|
});
|
||||||
|
|
||||||
var yt_dl = class {
|
var yt_dl = class {
|
||||||
constructor(url,id){
|
constructor(url, id, title) {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
this.percent = 0;
|
this.percent = 0;
|
||||||
this.lwrite = null;
|
this.lwrite = null;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
this.title = title
|
||||||
}
|
}
|
||||||
addListen(e) {
|
addListen(e) {
|
||||||
this.lwrite = e
|
this.lwrite = e
|
||||||
@ -70,7 +78,7 @@ var yt_dl = class{
|
|||||||
var me = this;
|
var me = this;
|
||||||
var ls;
|
var ls;
|
||||||
|
|
||||||
var m = dl_routine(path,this.url,format);
|
var m = dl_routine(path, this.url, format, this.title);
|
||||||
ls = spawn(m[0], m[1]);
|
ls = spawn(m[0], m[1]);
|
||||||
|
|
||||||
|
|
||||||
@ -95,7 +103,10 @@ var yt_dl = class{
|
|||||||
var percent = data.split(']')[1].split('of')[0];
|
var percent = data.split(']')[1].split('of')[0];
|
||||||
//console.log(z)
|
//console.log(z)
|
||||||
me.percent = percent.trim();
|
me.percent = percent.trim();
|
||||||
me.lwrite.sender.send('download-progress',{percent :me.percent,id:me.id});
|
me.lwrite.sender.send('download-progress', {
|
||||||
|
percent: me.percent,
|
||||||
|
id: me.id
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
@ -111,7 +122,10 @@ var yt_dl = class{
|
|||||||
}
|
}
|
||||||
file = z[x];
|
file = z[x];
|
||||||
}
|
}
|
||||||
me.lwrite.sender.send('file',{id:me.id,file:file});
|
me.lwrite.sender.send('file', {
|
||||||
|
id: me.id,
|
||||||
|
file: file
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,13 +141,19 @@ var yt_dl = class{
|
|||||||
});
|
});
|
||||||
ls.on('close', (code) => {
|
ls.on('close', (code) => {
|
||||||
console.log(`child process exited with code ${code}`);
|
console.log(`child process exited with code ${code}`);
|
||||||
me.lwrite.sender.send('file',{id:me.id,file:log[log.length-2].split('[ffmpeg] Destination: ')[1]});
|
me.lwrite.sender.send('file', {
|
||||||
me.lwrite.sender.send('process-fin',{percent :me.percent,id:me.id});
|
id: me.id,
|
||||||
|
file: log[log.length - 2].split('[ffmpeg] Destination: ')[1]
|
||||||
|
});
|
||||||
|
me.lwrite.sender.send('process-fin', {
|
||||||
|
percent: me.percent,
|
||||||
|
id: me.id
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var title = this.title;
|
||||||
if (this.url.match('youtube')) {
|
if (this.url.match('youtube')) {
|
||||||
var url = this.url;
|
var url = this.url;
|
||||||
var video_id = this.url.split('v=')[1];
|
var video_id = this.url.split('v=')[1];
|
||||||
@ -141,24 +161,27 @@ var yt_dl = class{
|
|||||||
if (ampersandPosition != -1) {
|
if (ampersandPosition != -1) {
|
||||||
video_id = video_id.substring(0, ampersandPosition);
|
video_id = video_id.substring(0, ampersandPosition);
|
||||||
}
|
}
|
||||||
/*
|
var fornoti = title;
|
||||||
|
if (title === "") {
|
||||||
|
fornoti = url;
|
||||||
|
}
|
||||||
var x = new Notification({
|
var x = new Notification({
|
||||||
title: "Cyb3r Downloader",
|
title: "Cyb3r Downloader",
|
||||||
body :"finished download for "+url,
|
body: "finished download for " + title,
|
||||||
//icon : body
|
//icon : body
|
||||||
})
|
})
|
||||||
x.show()
|
x.show()
|
||||||
//request.get('https://i.ytimg.com/vi/'+video_id+'/hqdefault.jpg', function (err, res, body) {
|
request.get('https://i.ytimg.com/vi/' + video_id + '/hqdefault.jpg', function(err, res, body) {
|
||||||
|
|
||||||
|
|
||||||
//log[log.length-2].split('[ffmpeg] Destination: ')[1]
|
//log[log.length-2].split('[ffmpeg] Destination: ')[1]
|
||||||
|
|
||||||
/*var tags = {
|
var tags = {
|
||||||
image: body
|
image: body
|
||||||
}
|
}
|
||||||
var success = nodeID3.write(tags, log[log.length-2].split('[ffmpeg] Destination: ')[1]);
|
var success = nodeID3.write(tags, path + '/' + title + '.' + format);
|
||||||
console.log(success);*/
|
console.log(success);
|
||||||
//});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
|
module.exports = (path, url, format, title = "%(title)s") => {
|
||||||
|
|
||||||
|
|
||||||
module.exports = (path,url,format)=>{
|
|
||||||
var command = global.dir + '/lib/youtube-dl';
|
var command = global.dir + '/lib/youtube-dl';
|
||||||
var param = [];
|
var param = [];
|
||||||
console.log(url);
|
console.log(url);
|
||||||
@ -9,16 +6,15 @@ module.exports = (path,url,format)=>{
|
|||||||
console.log('youtube')
|
console.log('youtube')
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case "mp3":
|
case "mp3":
|
||||||
param = ['-x','--audio-format','mp3','-i',url,'-o',path+'/%(title)s.%(ext)s'];
|
param = ['-x', '--audio-format', 'mp3', '-i', url, '-o', path + '/'+title+'.%(ext)s'];
|
||||||
break;
|
break;
|
||||||
case "mp4":
|
case "mp4":
|
||||||
param = ['-w','-f','bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4',url,'-o',path+'/%(title)s.%(ext)s'];
|
param = ['-w', '-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4', url, '-o', path + '/'+title+'.%(ext)s'];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
} else if (url.match('crunchyroll')) {
|
||||||
else if(url.match('crunchyroll')){
|
|
||||||
console.log('crunchyroll')
|
console.log('crunchyroll')
|
||||||
param = ['--cookie', global.dir + '/tmp/c', '--all-subs', '--sub-format', 'srt', '--write-sub', '--embed-subs', url, '-o', path + '/%(title)s.%(ext)s'];
|
param = ['--cookie', global.dir + '/tmp/c', '--all-subs', '--sub-format', 'srt', '--write-sub', '--embed-subs', url, '-o', path + '/%(title)s.%(ext)s'];
|
||||||
}
|
}
|
||||||
|
34
src/index.js
34
src/index.js
@ -20,29 +20,6 @@ let tray_win = null;
|
|||||||
if (!fs.existsSync(global.dir+'/tmp/inst')) {
|
if (!fs.existsSync(global.dir+'/tmp/inst')) {
|
||||||
fs.writeFileSync(global.dir+'/tmp/inst',"out");
|
fs.writeFileSync(global.dir+'/tmp/inst',"out");
|
||||||
app.quit();
|
app.quit();
|
||||||
/*var win;
|
|
||||||
const createWindow = () =>{
|
|
||||||
win = new BrowserWindow({
|
|
||||||
width: 320,
|
|
||||||
height: 500,
|
|
||||||
show: false,
|
|
||||||
frame: false,
|
|
||||||
icon: __dirname + '/app.ico'
|
|
||||||
})
|
|
||||||
win.once('ready-to-show', () => {
|
|
||||||
})
|
|
||||||
|
|
||||||
win.on('closed', () => {
|
|
||||||
win = null;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
app.on('ready', createWindow);
|
|
||||||
app.on('window-all-closed', () => {
|
|
||||||
if (process.platform !== 'darwin') {
|
|
||||||
app.quit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
}else{
|
}else{
|
||||||
var win ;
|
var win ;
|
||||||
app.getPath('documents')
|
app.getPath('documents')
|
||||||
@ -56,8 +33,6 @@ if (!fs.existsSync(global.dir+'/tmp/inst')) {
|
|||||||
})
|
})
|
||||||
ipcMain
|
ipcMain
|
||||||
.on('start-full', (event, arg)=>{
|
.on('start-full', (event, arg)=>{
|
||||||
|
|
||||||
|
|
||||||
//main_window.createWindow();
|
//main_window.createWindow();
|
||||||
//main_window.open();
|
//main_window.open();
|
||||||
tray_win = tray();
|
tray_win = tray();
|
||||||
@ -67,27 +42,18 @@ if (!fs.existsSync(global.dir+'/tmp/inst')) {
|
|||||||
win.loadURL(`file://${__dirname}/app/view/init.html`)
|
win.loadURL(`file://${__dirname}/app/view/init.html`)
|
||||||
win.once('ready-to-show', () => {
|
win.once('ready-to-show', () => {
|
||||||
win.show()
|
win.show()
|
||||||
//var x = new yt_dl("https://www.youtube.com/watch?v=UbQgXeY_zi4")
|
|
||||||
//x.download();
|
|
||||||
})
|
})
|
||||||
win.on('closed', () => {
|
win.on('closed', () => {
|
||||||
// Dereference the window object, usually you would store windows
|
|
||||||
// in an array if your app supports multi windows, this is the time
|
|
||||||
// when you should delete the corresponding element.
|
|
||||||
win = null;
|
win = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
app.on('ready', createWindow);
|
app.on('ready', createWindow);
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
// On OS X it is common for applications and their menu bar
|
|
||||||
// to stay active until the user quits explicitly with Cmd + Q
|
|
||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
app.on('activate', () => {
|
app.on('activate', () => {
|
||||||
// On OS X it's common to re-create a window in the app when the
|
|
||||||
// dock icon is clicked and there are no other windows open.
|
|
||||||
if (mainWindow === null) {
|
if (mainWindow === null) {
|
||||||
createWindow();
|
createWindow();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user