1.5 b
This commit is contained in:
parent
bb905111ec
commit
42e12189a4
@ -1,10 +1,9 @@
|
||||
// ==UserScript==
|
||||
// @name Cyber Downloader ADD
|
||||
// @namespace http://tampermonkey.net/
|
||||
// @version 0.1
|
||||
// @description try to take over the world!
|
||||
// @author You
|
||||
// @require http://code.jquery.com/jquery-latest.js
|
||||
// @name Tampermonkey Plugin for Cyb3r Downloader
|
||||
// @version 1.0
|
||||
// @description Tampermonkey Plugin for Cyb3r Downloader
|
||||
// @author Theenoro
|
||||
// @require http://code.jquery.com/jquery-latest.js
|
||||
// @match https://www.youtube.com/watch?v=*
|
||||
// @grant none
|
||||
// ==/UserScript==
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 98 KiB |
23
package.json
23
package.json
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "cyb3r-youtube-downloader",
|
||||
"productName": "cyb3r-youtube-downloader",
|
||||
"version": "1.0.0",
|
||||
"description": "My Electron application description",
|
||||
"version": "1.5.0",
|
||||
"description": "Cyb3r Downloader",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
"start": "electron-forge start",
|
||||
@ -28,10 +28,19 @@
|
||||
]
|
||||
},
|
||||
"electronPackagerConfig": {
|
||||
"packageManager": "npm"
|
||||
"packageManager": "npm",
|
||||
"win32metadata": {
|
||||
"ProductName": "Cyb3r Downloader",
|
||||
"CompanyName": "Thee.moe"
|
||||
},
|
||||
"version-string": {
|
||||
"ProductName": "Cyb3r Downloader",
|
||||
"CompanyName": "Thee.moe"
|
||||
}
|
||||
},
|
||||
"electronWinstallerConfig": {
|
||||
"name": "cyb3r_youtube_downloader",
|
||||
"name": "Cyb3r Downloader",
|
||||
"packageName": "Cyb3r_Downloader",
|
||||
"icon": "app.ico"
|
||||
},
|
||||
"electronInstallerDebian": {},
|
||||
@ -41,8 +50,8 @@
|
||||
"name": "https://git.tooru.thee.moe/theenoro/electron-simple-youtube-downloader"
|
||||
},
|
||||
"windowsStoreConfig": {
|
||||
"packageName": "",
|
||||
"name": "cyb3ryoutubedownloader"
|
||||
"packageName": "Cyb3r Downloader",
|
||||
"name": "Cyb3r Downloader"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -51,9 +60,11 @@
|
||||
"cors": "^2.8.4",
|
||||
"electron": "^1.6.11",
|
||||
"electron-compile": "^6.4.1",
|
||||
"electron-config": "^1.0.0",
|
||||
"express": "^4.15.4",
|
||||
"fs": "0.0.1-security",
|
||||
"mkdirp": "^0.5.1",
|
||||
"node-id3": "0.0.10",
|
||||
"path": "^0.12.7",
|
||||
"request": "^2.81.0",
|
||||
"unzip": "^0.1.11",
|
||||
|
@ -1,23 +1,41 @@
|
||||
$(function() {
|
||||
const Config = require('electron-config');
|
||||
const config = new Config();
|
||||
|
||||
var download_progress = $('#download-progress');
|
||||
var format = null;
|
||||
var format = "mp3";
|
||||
if(typeof config.get('format') !== 'undefined'){
|
||||
format = config.get('format');
|
||||
}
|
||||
var path = "";
|
||||
if(typeof config.get('path') !== 'undefined'){
|
||||
path = config.get('path');
|
||||
}
|
||||
var out = $('#output');
|
||||
var video = document.getElementById('video');
|
||||
const ipcRenderer = require('electron').ipcRenderer;
|
||||
const request = require('request');
|
||||
const helper = require('./../../helper/string');
|
||||
const helperx = require('./../../controller/webLoader/router');
|
||||
|
||||
var shell = require('electron').shell;
|
||||
//open links externally by default
|
||||
$(document).on('click', 'a[href^="http"]', function(event) {
|
||||
event.preventDefault();
|
||||
shell.openExternal(this.href);
|
||||
});
|
||||
|
||||
const {
|
||||
dialog
|
||||
} = require('electron').remote;
|
||||
|
||||
var cache = {};
|
||||
var path = "";
|
||||
|
||||
|
||||
var pot = false;
|
||||
|
||||
ipcRenderer.send('watchr_event', {});
|
||||
ipcRenderer.on('play-in-Window',function(event,arg){
|
||||
ipcRenderer.on('play-in-Window', function(event, arg) {
|
||||
pot = arg.do;
|
||||
})
|
||||
ipcRenderer.on('watchr_file', function(event, arg) {
|
||||
@ -51,25 +69,28 @@ $(function() {
|
||||
path = dialog.showOpenDialog({
|
||||
properties: ['openDirectory']
|
||||
})[0];
|
||||
config.set('path', path);
|
||||
console.log(path)
|
||||
ipcRenderer.send('setPath', {
|
||||
path: path
|
||||
});
|
||||
})
|
||||
$('#pot').click(function(){
|
||||
ipcRenderer.send('open-pot', {
|
||||
});
|
||||
$('#pot').click(function() {
|
||||
ipcRenderer.send('open-pot', {});
|
||||
});
|
||||
$('body').delegate('.play-file', 'click', function(e) {
|
||||
if(pot === false){
|
||||
if (pot === false) {
|
||||
video.setAttribute("src", e.currentTarget.dataset.file);
|
||||
video.play();
|
||||
}else{
|
||||
ipcRenderer.send('pot_run', {file:e.currentTarget.dataset.file});
|
||||
} else {
|
||||
ipcRenderer.send('pot_run', {
|
||||
file: e.currentTarget.dataset.file
|
||||
});
|
||||
}
|
||||
})
|
||||
$('body').delegate('.format', 'click', function(e) {
|
||||
format = e.currentTarget.dataset.format;
|
||||
config.set('format', format);
|
||||
ipcRenderer.send('set-format', {
|
||||
format: e.currentTarget.dataset.format
|
||||
});
|
||||
@ -80,7 +101,18 @@ $(function() {
|
||||
|
||||
if (url.match('crunchyroll')) {
|
||||
var video_id = Math.floor(Date.now() / 1000);
|
||||
$('<div class="media" ><div class="media-left"><a href="#"><img id="img-' + video_id + '" width="128" class="media-object" src="' + '" alt="..."></a></div><div class="media-body" id="body-' + video_id + '"><h4 class="media-heading">' + url + '</h4> Author: ' + '<div class="progress"><div class="progress-bar" id="download-progress-' + video_id + '" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">0%</div></div><div class="media-out-' + video_id + '"></div></div></div>').prependTo('#output');
|
||||
$(`
|
||||
<div class="media">
|
||||
<img id="img-` + video_id + `" class="d-flex align-self-start mr-3" src="..." alt="Generic placeholder image">
|
||||
<div class="media-body" id="body-` + video_id + `">
|
||||
<h5 class="mt-0">` + url + `</h5>
|
||||
Author: ` + `
|
||||
<div class="progress">
|
||||
<div class="progress-bar"id="download-progress-` + video_id + `" role="progressbar" style="width: 0%; height: 20px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<div class="media-out-` + video_id + `"></div>
|
||||
</div>
|
||||
</div>`).prependTo('#output');
|
||||
ipcRenderer.send('start-download', {
|
||||
url: $('#url').val(),
|
||||
id: video_id
|
||||
@ -102,7 +134,18 @@ $(function() {
|
||||
request
|
||||
.get('https://www.youtube.com/oembed?url=https://www.youtube.com/playlist?list=' + playlist_id + '&format=json', function(err, httpResponse, body) {
|
||||
var YT = JSON.parse(body);
|
||||
$('<div class="media" ><div class="media-left"><a href="#"><img id="img-' + video_id + '" width="128" class="media-object" src="' + YT.thumbnail_url + '" alt="..."></a></div><div class="media-body" id="body-' + video_id + '"><h4 class="media-heading">' + YT.title + '</h4> Playlistauthor: ' + YT.author_name + '<div class="progress"><div class="progress-bar" id="download-progress-' + video_id + '" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">0%</div></div><div class="media-out-' + video_id + '"></div></div></div>').prependTo('#output');
|
||||
$(
|
||||
`<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="media-body" id="body-` + video_id + `">
|
||||
<h5 class="mt-0">` + YT.title + `</h5>
|
||||
Author: ` + YT.author_name + `
|
||||
<div class="progress">
|
||||
<div class="progress-bar"id="download-progress-` + video_id + `" role="progressbar" style="width: 0%; height: 20px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<div class="media-out-` + video_id + `"></div>
|
||||
</div>
|
||||
</div>`).prependTo('#output');
|
||||
cache[video_id] = YT.title;
|
||||
ipcRenderer.send('start-download-pl', {
|
||||
url: $('#url').val(),
|
||||
@ -114,7 +157,27 @@ $(function() {
|
||||
request
|
||||
.get('https://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=' + video_id + '&format=json', function(err, httpResponse, body) {
|
||||
var YT = JSON.parse(body);
|
||||
$('<div class="media" ><div class="media-left"><a href="#"><img id="img-' + video_id + '" width="128" class="media-object" src="' + YT.thumbnail_url + '" alt="..."></a></div><div class="media-body" id="body-' + video_id + '"><h4 class="media-heading">' + YT.title + '</h4> Author: ' + YT.author_name + '<div class="progress"><div class="progress-bar" id="download-progress-' + video_id + '" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">0%</div></div><div class="media-out-' + video_id + '"></div></div></div>').prependTo('#output');
|
||||
$(
|
||||
`<div class="media">
|
||||
<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>
|
||||
<div class="media-body" id="body-` + video_id + `">
|
||||
<h5 class="mt-0">` + YT.title + `</h5>
|
||||
Author: ` + YT.author_name + `
|
||||
<div class="progress">
|
||||
<div class="progress-bar"id="download-progress-` + video_id + `" role="progressbar" style="width: 0%; height: 20px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<div class="media-out-` + video_id + `"></div>
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
|
||||
).prependTo('#output');
|
||||
cache[video_id] = YT.title;
|
||||
ipcRenderer.send('start-download', {
|
||||
url: $('#url').val(),
|
||||
@ -127,4 +190,11 @@ $(function() {
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
$('#close').click(function() {
|
||||
console.log('TEST')
|
||||
ipcRenderer.send('winHide', {
|
||||
|
||||
});
|
||||
})
|
||||
})
|
||||
|
7
src/app/libs/bootstrap/bootstrap.min.css
vendored
Normal file
7
src/app/libs/bootstrap/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
6
src/app/libs/bootstrap/bootstrap.min.js
vendored
Normal file
6
src/app/libs/bootstrap/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
src/app/libs/jquery/jquery-3.2.1.slim.min.js
vendored
Normal file
4
src/app/libs/jquery/jquery-3.2.1.slim.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
src/app/libs/popper.min.js
vendored
Normal file
5
src/app/libs/popper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
9150
src/app/style/bootstrap.css
vendored
Normal file
9150
src/app/style/bootstrap.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
cursor: pointer;
|
||||
height: 10px;
|
||||
margin-bottom: 10px;
|
||||
outline: thin solid #FFF;
|
||||
outline: thin solid #1D1D1D;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
@ -17,7 +17,7 @@
|
||||
cursor: pointer;
|
||||
height: 10px;
|
||||
margin-bottom: 10px;
|
||||
outline: thin solid #FFF;
|
||||
outline: thin solid #1D1D1D;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 200px;
|
||||
@ -29,7 +29,7 @@
|
||||
}
|
||||
|
||||
#time span, #volume span {
|
||||
background-color: #FFF;
|
||||
background-color: #1D1D1D;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
@ -1 +1 @@
|
||||
body{margin:0;margin-top:50px;background:#111;color:#f8f8f8}.btn-success{color:#f8f8f8;background-color:#111;border-color:#f8f8f8;transition:all .3s}.btn-success.active,.btn-success:active,.btn-success:focus,.btn-success:hover,.dropdown-toggle:active,.dropdown-toggle:focus,.open>.dropdown-toggle.btn-success{color:#111!important;background-color:#f8f8f8!important;border-color:#f8f8f8!important;transition:all .3s}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{text-decoration:none;color:#f8f8f8;background-color:#111}.dropdown-menu{background-color:#111}span.input-group-btn.open>ul>li>a{background-image:none}.progress{background-image:none;background-color:#111;box-shadow:inset 0 0 3px 0 #f8f8f8}.progress-bar{background-image:none;background-color:#111;box-shadow:inset 0 0 12px 0 #f8f8f8;transition:.3s all}.media:first-child{margin-top:15px}.media{box-shadow:0 0 6px 1px #f8f8f8}.sidebar-nav{padding:10px}.nav.nav-list a{padding:5px 10px}.nav-header{font-weight:700}.scroll{overflow-y:scroll;height:calc(100vh - 96px)}.left-playlist{box-shadow:0 0 6px 1px #f8f8f8;height:calc(100vh - 20vw - 30px)}.row-flex{word-break:break-all;width:100%;display:flex}.row-flex .flex-btn{width:50px}.row-flex .cont{width:100%}
|
||||
body{margin:0;margin-top:70px}.navbar{background:#111!important;color:#f8f8f8}.btn-success{color:#111;background-color:#f8f8f8;border-color:#111;transition:all .3s}.btn-success.active,.btn-success:active,.btn-success:focus,.btn-success:hover,.dropdown-toggle:active,.dropdown-toggle:focus,.open>.dropdown-toggle.btn-success{color:#f8f8f8!important;background-color:#111!important;border-color:#111!important;transition:all .3s}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{text-decoration:none;color:#111;background-color:#f8f8f8}.dropdown-menu{background-color:#f8f8f8}span.input-group-btn.open>ul>li>a{background-image:none}.media:first-child{margin-top:15px}.media{box-shadow:0 0 12px 1px rgba(105,105,105,.28);margin-top:14px}.sidebar-nav{padding:10px}.nav.nav-list a{padding:5px 10px}.nav-header{font-weight:700}.scroll{overflow-y:scroll;height:calc(100vh - 96px)}.left-playlist{box-shadow:0 0 6px 1px #111;height:calc(100vh - 20vw - 30px)}.row-flex{word-break:break-all;width:100%;display:flex}.row-flex .flex-btn{width:50px}.row-flex .cont{width:100%}*{border-radius:0!important}
|
@ -5,15 +5,19 @@
|
||||
|
||||
*/
|
||||
|
||||
@main-front-color : #f8f8f8;
|
||||
@background-color : #111111;
|
||||
@background-2ndcolor: #232323;
|
||||
@main-front-color : #111111;
|
||||
@background-color : #F8F8F8;
|
||||
@background-2ndcolor: #F8F8F8;
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
margin-top: 50px;
|
||||
background: @background-color;
|
||||
color:@main-front-color;
|
||||
margin-top: 70px;
|
||||
/*background: @background-color;
|
||||
color:@main-front-color;*/
|
||||
}
|
||||
.navbar{
|
||||
background: @main-front-color !important;
|
||||
color:@background-color;
|
||||
}
|
||||
.btn-success {
|
||||
color: @main-front-color;
|
||||
@ -38,6 +42,7 @@ body {
|
||||
span.input-group-btn.open > ul > li> a{
|
||||
background-image:none;
|
||||
}
|
||||
/*
|
||||
.progress{
|
||||
background-image:none;
|
||||
background-color: @background-color;
|
||||
@ -48,12 +53,13 @@ span.input-group-btn.open > ul > li> a{
|
||||
background-color: @background-color;
|
||||
box-shadow: inset 0px 0px 12px 0px @main-front-color;
|
||||
transition: .3s all;
|
||||
}
|
||||
}*/
|
||||
.media:first-child {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.media {
|
||||
box-shadow: 0px 0px 6px 1px @main-front-color;
|
||||
box-shadow: 0 0 12px 1px rgba(105, 105, 105, 0.28);
|
||||
margin-top: 14px;
|
||||
}
|
||||
.sidebar-nav {
|
||||
padding: 10px;
|
||||
@ -86,3 +92,6 @@ span.input-group-btn.open > ul > li> a{
|
||||
width:100%;
|
||||
}
|
||||
}
|
||||
*{
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
|
@ -8,28 +8,38 @@
|
||||
module = undefined;
|
||||
}
|
||||
</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/bootstrap/js/bootstrap.js"></script>-->
|
||||
<script src="./../libs/jquery/jquery-3.2.1.slim.min.js"></script>
|
||||
<script src="./../libs/popper.min.js"></script>
|
||||
<script src="./../libs/bootstrap/bootstrap.min.js"></script>
|
||||
<script src="./../js/player.js"></script>
|
||||
<meta charset="utf-8">
|
||||
<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/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/font-awesome/css/font-awesome.min.css" />
|
||||
<link rel="stylesheet" href="./../style/progress.css" />
|
||||
|
||||
<link rel="stylesheet" href="./../style/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="./../style/style.css" />
|
||||
<link rel="stylesheet" href="./../style/player.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<nav class="navbar fixed-top navbar-dark bg-dark justify-content-between" style="-webkit-app-region: drag">
|
||||
<a class="navbar-brand">Cyb3r Downloader</a>
|
||||
<form class="form-inline">
|
||||
<button class="btn btn-outline-success my-2 my-sm-0" id="close" style="-webkit-app-region: no-drag;">X</button>
|
||||
</form>
|
||||
</nav>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="sidebar-nav">
|
||||
<ul class="nav nav-tabs nav-pills nav-stacked" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#download" aria-controls="download" role="tab" data-toggle="tab">Download</a></li>
|
||||
<li role="presentation"><a href="#player" aria-controls="player" role="tab" data-toggle="tab">Player</a></li>
|
||||
</ul>
|
||||
<div class="list-group" role="tablist">
|
||||
<li role="presentation" class="list-group-item list-group-item-action"><a href="#download" aria-controls="download" role="tab" data-toggle="tab">Download</a></li>
|
||||
<li role="presentation" class="list-group-item list-group-item-action"><a href="#player" aria-controls="player" role="tab" data-toggle="tab">Player</a></li>
|
||||
<li role="presentation" class="list-group-item list-group-item-action"><a href="#info" aria-controls="info" role="tab" data-toggle="tab">Info</a></li>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@ -38,24 +48,27 @@
|
||||
<input id="business" type="file" style="display: none" />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="input-group input-group-lg">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<button id="party" class="very-sweet-looking btn btn-success btn-sm">Select Folder</button>
|
||||
</span>
|
||||
<input type="text" class="form-control input-sm" maxlength="128" id="url" placeholder="YT-Url" />
|
||||
<button id="party" class="btn btn-secondary" type="button">Select Folder</button>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="url" placeholder="YT-Url" aria-label="Product name">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Format <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" id="format">
|
||||
<li><a href="#" class="format" data-format="mp3">MP3</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li><a href="#" class="format" data-format="mp4">MP4</a></li>
|
||||
</ul>
|
||||
</span>
|
||||
<div class="dropdown show">
|
||||
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Format
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
|
||||
<a class="dropdown-item format" href="#" data-format="mp3">MP3</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item format" href="#" data-format="mp4">MP4</a>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
<span class="input-group-btn">
|
||||
<button type="button" id="start-download" class="btn btn-success btn-sm">Download</button>
|
||||
</span>
|
||||
<button class="btn btn-secondary" type="button" id="start-download">Download</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -74,6 +87,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane fade" id="info">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h1>Info</h1>
|
||||
<a href="https://git.tooru.thee.moe/theenoro/electron-simple-youtube-downloader" target="_blank">Git</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
19
src/controller/tray.js
Normal file
19
src/controller/tray.js
Normal file
@ -0,0 +1,19 @@
|
||||
const {app, Menu, Tray} = require('electron')
|
||||
const main_window = require('./windows.js/main.js')
|
||||
|
||||
|
||||
module.exports = ()=>{
|
||||
let tray = new Tray(global.dir+'/app.ico')
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{label: 'Open', click(){ main_window.open(); }},
|
||||
/*{label: 'About',click() { console.log('item 1 clicked') }},
|
||||
{label: 'Item1', type: 'radio'},
|
||||
{type: 'separator'},
|
||||
{label: 'Item2', type: 'radio'},
|
||||
{label: 'Item3', type: 'radio', checked: true},*/
|
||||
{label: 'Beenden', click() { main_window.close(); }},
|
||||
])
|
||||
tray.setToolTip('Cyb3r Downloader.')
|
||||
tray.setContextMenu(contextMenu)
|
||||
return tray;
|
||||
}
|
@ -13,6 +13,8 @@ app.post('/download', function(req, res) {
|
||||
var log = req.query.url;
|
||||
console.log(log)
|
||||
// ...
|
||||
$('#url').val(log);
|
||||
$('#start-download').click();
|
||||
});
|
||||
|
||||
|
||||
|
39
src/controller/windows.js/main.js
Normal file
39
src/controller/windows.js/main.js
Normal file
@ -0,0 +1,39 @@
|
||||
const {
|
||||
app,
|
||||
BrowserWindow,
|
||||
Menu,
|
||||
dialog,
|
||||
ipcMain
|
||||
} = require('electron');
|
||||
var win = {};
|
||||
|
||||
win.win = null;
|
||||
|
||||
ipcMain
|
||||
.on('winHide', (event, arg)=>{
|
||||
win.win.hide();
|
||||
})
|
||||
|
||||
win.createWindow = ()=>{
|
||||
win.win = new BrowserWindow({
|
||||
width: 1010,
|
||||
height: 800,
|
||||
minWidth: 1010,
|
||||
minHeight: 565,
|
||||
show: true,
|
||||
frame: false,
|
||||
icon: global.dir + '/app.ico'
|
||||
})
|
||||
win.win.loadURL(`file://${global.dir}/app/view/layout.html`);
|
||||
win.win.show();
|
||||
win.win.on('closed', () => {
|
||||
//win.win = null;
|
||||
});
|
||||
}
|
||||
win.open = ()=>{
|
||||
win.win.show()
|
||||
}
|
||||
win.close = ()=>{
|
||||
win.win.close();
|
||||
}
|
||||
module.exports = win;
|
@ -1,8 +1,9 @@
|
||||
const { spawn } = require('child_process');
|
||||
const ipcMain = require('electron').ipcMain;
|
||||
const {Notification,ipcMain}= require('electron');
|
||||
const dl_routine = require('./youtube-dl.routine')
|
||||
const nodeID3 = require('node-id3');
|
||||
|
||||
const web = require('./webLoader/router');
|
||||
//const web = require('./webLoader/router');
|
||||
|
||||
const pot = require('./player_onTop');
|
||||
const folderWatchr = require('./watchr')
|
||||
@ -14,6 +15,8 @@ var format = "mp3";
|
||||
var fol = null;
|
||||
|
||||
var pot_open_ev = null;
|
||||
var request = require('request').defaults({ encoding: null });
|
||||
|
||||
ipcMain
|
||||
.on('start-download', (event, arg)=>{
|
||||
path = orig_path
|
||||
@ -69,6 +72,11 @@ var yt_dl = class{
|
||||
|
||||
var m = dl_routine(path,this.url,format);
|
||||
ls = spawn(m[0],m[1]);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(path == ''){
|
||||
//ls = spawn(global.dir+'/lib/youtube-dl', ['-x','--audio-format','mp3','-i',this.url]);
|
||||
}else{
|
||||
@ -121,6 +129,36 @@ var yt_dl = class{
|
||||
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('process-fin',{percent :me.percent,id:me.id});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(this.url.match('youtube')){
|
||||
var url = this.url;
|
||||
var video_id = this.url.split('v=')[1];
|
||||
var ampersandPosition = video_id.indexOf('&');
|
||||
if (ampersandPosition != -1) {
|
||||
video_id = video_id.substring(0, ampersandPosition);
|
||||
}
|
||||
var x = new Notification({
|
||||
title:"Cyb3r Downloader",
|
||||
body :"finished download for "+url,
|
||||
//icon : body
|
||||
})
|
||||
x.show()
|
||||
//request.get('https://i.ytimg.com/vi/'+video_id+'/hqdefault.jpg', function (err, res, body) {
|
||||
|
||||
|
||||
//log[log.length-2].split('[ffmpeg] Destination: ')[1]
|
||||
|
||||
/*var tags = {
|
||||
image: body
|
||||
}
|
||||
var success = nodeID3.write(tags, log[log.length-2].split('[ffmpeg] Destination: ')[1]);
|
||||
console.log(success);*/
|
||||
//});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
39
src/index.js
39
src/index.js
@ -11,14 +11,16 @@ const fs = require('fs');
|
||||
const yt_dl = require('./controller/youtube-dl')
|
||||
const dl = require('./controller/download');
|
||||
const browser = require('./controller/windows.js/browser');
|
||||
const tray = require('./controller/tray')
|
||||
|
||||
const main_window = require('./controller/windows.js/main.js')
|
||||
|
||||
let tray_win = null;
|
||||
|
||||
if (!fs.existsSync(global.dir+'/tmp/inst')) {
|
||||
fs.writeFileSync(global.dir+'/tmp/inst',"out");
|
||||
var win;
|
||||
const createWindow = () =>{
|
||||
|
||||
win = new BrowserWindow({
|
||||
width: 320,
|
||||
height: 500,
|
||||
@ -41,23 +43,8 @@ if (!fs.existsSync(global.dir+'/tmp/inst')) {
|
||||
});
|
||||
}else{
|
||||
var win ;
|
||||
|
||||
|
||||
app.getPath('documents')
|
||||
const createWindow = () =>{
|
||||
|
||||
//dl.download(dl.ff(process.platform));
|
||||
/*
|
||||
|
||||
win = new BrowserWindow({
|
||||
width: 1010,
|
||||
height: 800,
|
||||
minWidth: 1010,
|
||||
minHeight: 565,
|
||||
show: false,
|
||||
frame: true
|
||||
})
|
||||
*/
|
||||
win = new BrowserWindow({
|
||||
width: 320,
|
||||
height: 500,
|
||||
@ -68,19 +55,12 @@ if (!fs.existsSync(global.dir+'/tmp/inst')) {
|
||||
ipcMain
|
||||
.on('start-full', (event, arg)=>{
|
||||
|
||||
var win2 = new BrowserWindow({
|
||||
width: 1010,
|
||||
height: 800,
|
||||
minWidth: 1010,
|
||||
minHeight: 565,
|
||||
show: true,
|
||||
frame: true,
|
||||
icon: __dirname + '/app.ico'
|
||||
})
|
||||
win.close();
|
||||
//var z = new browser('http://www.crunchyroll.com/');
|
||||
win2.loadURL(`file://${__dirname}/app/view/layout.html`)
|
||||
win = win2;
|
||||
|
||||
main_window.createWindow();
|
||||
main_window.open();
|
||||
tray_win = tray();
|
||||
win.close();
|
||||
|
||||
});
|
||||
win.loadURL(`file://${__dirname}/app/view/init.html`)
|
||||
win.once('ready-to-show', () => {
|
||||
@ -88,7 +68,6 @@ if (!fs.existsSync(global.dir+'/tmp/inst')) {
|
||||
//var x = new yt_dl("https://www.youtube.com/watch?v=UbQgXeY_zi4")
|
||||
//x.download();
|
||||
})
|
||||
|
||||
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
|
||||
|
12
src/main.js
12
src/main.js
@ -4,28 +4,29 @@ var handleStartupEvent = function() {
|
||||
console.log(process.platform);
|
||||
switch (process.platform) {
|
||||
case 'win32':
|
||||
|
||||
|
||||
break;
|
||||
case 'linux':
|
||||
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
|
||||
}
|
||||
if (process.platform !== 'win32') {
|
||||
return false;
|
||||
}
|
||||
|
||||
const exeName = path.basename(process.execPath);
|
||||
var squirrelCommand = process.argv[1];
|
||||
console.log(squirrelCommand);
|
||||
switch (squirrelCommand) {
|
||||
case '--squirrel-updated':
|
||||
case '--squirrel-install':
|
||||
target = path.basename(process.execPath);
|
||||
updateDotExe = path.resolve(path.dirname(process.execPath), '..', 'update.exe');
|
||||
var createShortcut = updateDotExe + ' --createShortcut=' + target + ' --shortcut-locations=Desktop,StartMenu' ;
|
||||
console.log (createShortcut);
|
||||
exec(createShortcut);
|
||||
// Always quit when done
|
||||
spawnUpdate(['--createShortcut', exeName]);
|
||||
app.quit();
|
||||
return true;
|
||||
|
||||
@ -37,6 +38,7 @@ var handleStartupEvent = function() {
|
||||
var createShortcut = updateDotExe + ' --removeShortcut=' + target ;
|
||||
console.log (createShortcut);
|
||||
exec(createShortcut);
|
||||
spawnUpdate(['--removeShortcut', exeName]);
|
||||
// Always quit when done
|
||||
app.quit();
|
||||
return true;
|
||||
|
@ -5,15 +5,19 @@
|
||||
|
||||
*/
|
||||
|
||||
@main-front-color : #f8f8f8;
|
||||
@background-color : #111111;
|
||||
@background-2ndcolor: #232323;
|
||||
@main-front-color : #111111;
|
||||
@background-color : #F8F8F8;
|
||||
@background-2ndcolor: #F8F8F8;
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
margin-top: 50px;
|
||||
background: @background-color;
|
||||
color:@main-front-color;
|
||||
margin-top: 70px;
|
||||
/*background: @background-color;
|
||||
color:@main-front-color;*/
|
||||
}
|
||||
.navbar{
|
||||
background: @main-front-color !important;
|
||||
color:@background-color;
|
||||
}
|
||||
.btn-success {
|
||||
color: @main-front-color;
|
||||
@ -38,6 +42,7 @@ body {
|
||||
span.input-group-btn.open > ul > li> a{
|
||||
background-image:none;
|
||||
}
|
||||
/*
|
||||
.progress{
|
||||
background-image:none;
|
||||
background-color: @background-color;
|
||||
@ -48,12 +53,13 @@ span.input-group-btn.open > ul > li> a{
|
||||
background-color: @background-color;
|
||||
box-shadow: inset 0px 0px 12px 0px @main-front-color;
|
||||
transition: .3s all;
|
||||
}
|
||||
}*/
|
||||
.media:first-child {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.media {
|
||||
box-shadow: 0px 0px 6px 1px @main-front-color;
|
||||
box-shadow: 0 0 12px 1px rgba(105, 105, 105, 0.28);
|
||||
margin-top: 14px;
|
||||
}
|
||||
.sidebar-nav {
|
||||
padding: 10px;
|
||||
@ -86,3 +92,6 @@ span.input-group-btn.open > ul > li> a{
|
||||
width:100%;
|
||||
}
|
||||
}
|
||||
*{
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
|
15
src/tmp/c
15
src/tmp/c
@ -1,15 +0,0 @@
|
||||
# Netscape HTTP Cookie File
|
||||
# http://curl.haxx.se/rfc/cookie_spec.html
|
||||
# This is a generated file! Do not edit.
|
||||
|
||||
.crunchyroll.com TRUE / FALSE 1534887951 __cfduid db1426254a0b86e7ca8b70551a18644361503351951
|
||||
.crunchyroll.com TRUE / FALSE 1537220753 __qca P0-1835482882-1503351953593
|
||||
.crunchyroll.com TRUE / FALSE 1566942248 _ga GA1.2.1843711990.1503351953
|
||||
.crunchyroll.com TRUE / FALSE 1503956648 _gid GA1.2.1726060626.1503868189
|
||||
.crunchyroll.com TRUE / FALSE 1504561873 c_d p%3D1
|
||||
.crunchyroll.com TRUE / FALSE 1504561873 c_userid 64927993
|
||||
.crunchyroll.com TRUE / FALSE 1504561873 c_userkey 2%3AZxOX%2BsILKGFm2Nmfc6%2FX12lxWjo%3D
|
||||
.crunchyroll.com TRUE / FALSE 1518903952 c_visitor 95852853-d74d-4e9c-b5ad-182b74e6f44f
|
||||
.crunchyroll.com TRUE / FALSE 1503960371 cf_clearance fb4b8c534496cdfec5683c51ec28dc2e4c70e5ce-1503351970-604800
|
||||
.crunchyroll.com TRUE / FALSE 1537220753 sess_id jjdcwcg0amrsbt44eviz34disrmrqd2m
|
||||
.crunchyroll.com TRUE / FALSE 1537220753 session_id 2074779edf6db7782876092c0d2f03db
|
@ -1 +0,0 @@
|
||||
out
|
Loading…
Reference in New Issue
Block a user