Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6aa9ecc3d5 | ||
|
196a8f06c6 | ||
|
8c48ace39e | ||
|
b5b992e568 | ||
|
54cb464d0f |
2
.gitignore
vendored
2
.gitignore
vendored
@ -71,5 +71,3 @@ out
|
|||||||
*.mp3
|
*.mp3
|
||||||
*.part
|
*.part
|
||||||
*.ytdl
|
*.ytdl
|
||||||
|
|
||||||
*.webm
|
|
||||||
|
19
README.md
19
README.md
@ -1,15 +1,20 @@
|
|||||||
# Cyb3r Downloader
|
# Cyb3r Downloader
|
||||||
|
|
||||||
![./current-preview.PNG](./current-preview.PNG)
|
![./current-preview.PNG](https://gitlab.thee.moe/theenoro/cyb3r-downloader/raw/master/current-preview.PNG)
|
||||||
|
|
||||||
|
# Download 1.5.2 release
|
||||||
|
- Added WMA
|
||||||
|
|
||||||
|
[Download Installer](https://cl.thee.moe/index.php/s/aACn3iNAMHCFwk7)
|
||||||
|
|
||||||
# Download 1.5.1 release
|
# Download 1.5.1 release
|
||||||
|
|
||||||
So I've changed a lot from 1.5.1, not program technically but for the install process and a bit the design
|
So I've changed a lot from 1.5.1, not program technically but for the install process and a bit the design
|
||||||
The starter is a batch file, you have to keep it open to run it :( but you can minimize it.
|
The starter is a batch file, you have to keep it open to run it :( but you can minimize it.
|
||||||
|
|
||||||
For the browser script located in "browser_out" or [Link](https://git.tooru.thee.moe/theenoro/electron-simple-youtube-downloader/blob/master/browser_out/tampermonkey_plugin.js) in the repo you can use it with "tampermonkey". Create a new script and copy & paste the source code in. Now if you are on YT in the navbar is a new button.
|
For the browser script located in "browser_out" or [Link](https://gitlab.thee.moe/theenoro/cyb3r-downloader/blob/master/browser_out/tampermonkey_plugin.js) in the repo you can use it with "tampermonkey". Create a new script and copy & paste the source code in. Now if you are on YT in the navbar is a new button.
|
||||||
|
|
||||||
[Download](https://cl.thee.moe/index.php/s/Z5YvrlHaPfvEdbu)
|
~~[Download](https://cl.thee.moe/index.php/s/aACn3iNAMHCFwk7)~~
|
||||||
|
|
||||||
> 24.09.2017 Fixed Installer
|
> 24.09.2017 Fixed Installer
|
||||||
|
|
||||||
@ -21,16 +26,16 @@ Checks if node is installed, if not it downloads it for you and you have only to
|
|||||||
# Download 1.5
|
# Download 1.5
|
||||||
|
|
||||||
At the moment it have a few bugs. If you find some talk to me and I will list them here and fix it as soon as possible
|
At the moment it have a few bugs. If you find some talk to me and I will list them here and fix it as soon as possible
|
||||||
or if you have an git account just add them in the issues tab. [Issues](https://git.tooru.thee.moe/theenoro/electron-simple-youtube-downloader/issues)
|
or if you have an git account just add them in the issues tab. [Issues](https://gitlab.thee.moe/theenoro/cyb3r-downloader/issues)
|
||||||
|
|
||||||
[Download](https://cl.thee.moe/index.php/s/hd9ILsF2etPoa6r)
|
~~[Download](https://cl.thee.moe/index.php/s/hd9ILsF2etPoa6r)~~
|
||||||
|
|
||||||
# v 1.4.0 Alpha
|
# v 1.4.0 Alpha
|
||||||
|
|
||||||
Preview [Video](https://cl.thee.moe/index.php/s/T8FEaFFxyhlxIj6)
|
Preview [Video](https://cl.thee.moe/index.php/s/Grfn3gQMAEnB3t3)
|
||||||
|
|
||||||
# Download 1.3.0
|
# Download 1.3.0
|
||||||
|
|
||||||
Win32 / Win64 Install exe
|
Win32 / Win64 Install exe
|
||||||
|
|
||||||
- [Download](https://www.dropbox.com/s/7eoo7yf3f7nwr8j/cyb3r-youtube-downloader-1.3.0%20Setup.exe?dl=0)
|
- ~~[Download](https://www.dropbox.com/s/7eoo7yf3f7nwr8j/cyb3r-youtube-downloader-1.3.0%20Setup.exe?dl=0)~~
|
||||||
|
16820
package-lock.json
generated
16820
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
BIN
src/app.png
BIN
src/app.png
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB |
@ -1,4 +1,3 @@
|
|||||||
const shared = require(global.__dirname + '/../js/shared');
|
|
||||||
$(function() {
|
$(function() {
|
||||||
const Config = require('electron-config');
|
const Config = require('electron-config');
|
||||||
const config = new Config();
|
const config = new Config();
|
||||||
@ -58,8 +57,16 @@ $(function() {
|
|||||||
});
|
});
|
||||||
ipcRenderer.on('process-fin', function(event, arg) {
|
ipcRenderer.on('process-fin', function(event, arg) {
|
||||||
console.log(arg); // prints "pong"
|
console.log(arg); // prints "pong"
|
||||||
|
if(arg.percent==101){
|
||||||
|
$('#download-progress-' + arg.id).css("width", 100);
|
||||||
|
$('#download-progress-' + arg.id).html("CONVERTING");
|
||||||
|
}else{
|
||||||
$('#download-progress-' + arg.id).css("width", arg.percent);
|
$('#download-progress-' + arg.id).css("width", arg.percent);
|
||||||
$('#download-progress-' + arg.id).html("CONVERTED");
|
$('#download-progress-' + arg.id).html("CONVERTED");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
ipcRenderer.on('file', function(event, arg) {
|
ipcRenderer.on('file', function(event, arg) {
|
||||||
console.log('DOWNLOADED')
|
console.log('DOWNLOADED')
|
||||||
@ -148,17 +155,7 @@ $(function() {
|
|||||||
var YT = JSON.parse(body);
|
var YT = JSON.parse(body);
|
||||||
$(
|
$(
|
||||||
`<div class="media">
|
`<div class="media">
|
||||||
<div class="d-flex alogn-self-start mr-3" style="
|
<img id="img-` + video_id + `" class="d-flex align-self-start mr-3" src="`+ YT.thumbnail_url +`" alt="Generic placeholder image">
|
||||||
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 + `
|
||||||
@ -206,8 +203,7 @@ $(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)
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -226,14 +222,10 @@ $(function() {
|
|||||||
|
|
||||||
function getCommandLine() {
|
function getCommandLine() {
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'darwin':
|
case 'darwin' : return 'open';
|
||||||
return 'open';
|
case 'win32' : return 'start';
|
||||||
case 'win32':
|
case 'win64' : return 'start';
|
||||||
return 'start';
|
default : return 'xdg-open';
|
||||||
case 'win64':
|
|
||||||
return 'start';
|
|
||||||
default:
|
|
||||||
return 'xdg-open';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
const shared = require(global.__dirname+'/../js/shared');
|
|
||||||
$(function() {
|
$(function() {
|
||||||
const ipcRenderer = require('electron').ipcRenderer;
|
const ipcRenderer = require('electron').ipcRenderer;
|
||||||
ipcRenderer.send('pot_real_open', {x:"xx"});
|
ipcRenderer.send('pot_real_open', {x:"xx"});
|
||||||
@ -21,4 +20,6 @@ $(function() {
|
|||||||
$('body').on( "mouseenter",function () {
|
$('body').on( "mouseenter",function () {
|
||||||
$('.navbar').css('opacity',"1")
|
$('.navbar').css('opacity',"1")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
var shared = {};
|
|
||||||
var test = "";
|
|
||||||
|
|
||||||
|
|
||||||
shared.setLog = (text)=>{
|
|
||||||
test = text;
|
|
||||||
}
|
|
||||||
shared.log = ()=>{
|
|
||||||
console.log(test);
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = shared;
|
|
@ -148,16 +148,15 @@
|
|||||||
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>
|
||||||
@ -170,8 +169,7 @@
|
|||||||
<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>
|
<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>
|
||||||
<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>
|
||||||
@ -180,11 +178,10 @@
|
|||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
var start = [
|
var start = [
|
||||||
"whbex",
|
"1k7kx5",
|
||||||
"wf0jb",
|
"1nhvi0",
|
||||||
"ulak9",
|
"1qfipa",
|
||||||
"wc5e2",
|
"1kfn1h",
|
||||||
"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')
|
||||||
@ -201,7 +198,7 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -8,14 +8,19 @@
|
|||||||
module = undefined;
|
module = undefined;
|
||||||
}
|
}
|
||||||
</script>
|
</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/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/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" />
|
||||||
@ -28,9 +33,7 @@
|
|||||||
<div class="list-group" role="tablist" id="">
|
<div class="list-group" role="tablist" id="">
|
||||||
<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="#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="#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="#wt" aria-controls="wt" role="tab" data-toggle="tab">Watch Together</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>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -48,7 +51,6 @@
|
|||||||
<div class="list-group" role="tablist" >
|
<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="#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="#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="#wt" aria-controls="wt" role="tab" data-toggle="tab">Watch Together</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>
|
<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>
|
</div>
|
||||||
@ -96,7 +98,7 @@
|
|||||||
|
|
||||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
|
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
|
||||||
<a class="dropdown-item format" href="#" data-format="mp3">MP3</a>
|
<a class="dropdown-item format" href="#" data-format="mp3">MP3</a>
|
||||||
<a class="dropdown-item format" href="#" data-format="vorbis">OGG</a>
|
<a class="dropdown-item format" href="#" data-format="wma">WMA</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item format" href="#" data-format="mp4">MP4</a>
|
<a class="dropdown-item format" href="#" data-format="mp4">MP4</a>
|
||||||
</div>
|
</div>
|
||||||
@ -126,72 +128,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane fade" id="wt">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="input-group">
|
|
||||||
<input type="text" class="form-control" id="webview-url" placeholder="www..." aria-label="Product name">
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<button class="btn btn-secondary" type="button" id="webviewload">-></button>
|
|
||||||
<button class="btn btn-secondary" type="button" id="webviewdownload">Cyb3r Download</button>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<webview id="foo" src="https://youtube.com/" style="display:inline-flex; width:100%; height:calc(100vh - 144px)"></webview>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
$(function(){
|
|
||||||
require('remote').getCurrentWindow().toggleDevTools();
|
|
||||||
const webview = document.querySelector('webview')
|
|
||||||
const indicator = document.querySelector('.indicator')
|
|
||||||
|
|
||||||
const loadstart = () => {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const loadstop = () => {
|
|
||||||
$('#webview-url').val(webview.getURL());
|
|
||||||
}
|
|
||||||
$('#webviewload').click(()=>{
|
|
||||||
var url = $('#webview-url').val();
|
|
||||||
webview.loadURL(url)
|
|
||||||
})
|
|
||||||
$('#webviewdownload').click(()=>{
|
|
||||||
var url = $('#webview-url').val();
|
|
||||||
$.post( "http://127.0.0.1:54167/download?url="+encodeURI(url),function() {
|
|
||||||
|
|
||||||
});
|
|
||||||
})
|
|
||||||
webview.addEventListener('did-start-loading', loadstart)
|
|
||||||
webview.addEventListener('did-stop-loading', loadstop)
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div role="tabpanel" class="tab-pane fade" id="info">
|
<div role="tabpanel" class="tab-pane fade" id="info">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<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>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -206,10 +149,9 @@
|
|||||||
</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,109 +0,0 @@
|
|||||||
const request = require('request');
|
|
||||||
// https://vivo.sx/46b5f0d914
|
|
||||||
|
|
||||||
var vivo = (url,cb)=>{
|
|
||||||
request('https://vivo.sx/76aa530aac', function(error, response, body) {
|
|
||||||
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('body:', body); // Print the HTML for the Google homepage.
|
|
||||||
var html = body;
|
|
||||||
var bse64 = html.split('Core.InitializeStream (\'')[1].split('\');')[0];
|
|
||||||
console.log(bse64)
|
|
||||||
var arr = eval(Base64.decode(bse64));
|
|
||||||
console.log(arr[0])
|
|
||||||
cb(arr[0]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = vivo;
|
|
||||||
|
|
||||||
var Base64 = {
|
|
||||||
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
|
||||||
encode: function(e) {
|
|
||||||
var t = "";
|
|
||||||
var n, r, i, s, o, u, a;
|
|
||||||
var f = 0;
|
|
||||||
e = Base64._utf8_encode(e);
|
|
||||||
while (f < e.length) {
|
|
||||||
n = e.charCodeAt(f++);
|
|
||||||
r = e.charCodeAt(f++);
|
|
||||||
i = e.charCodeAt(f++);
|
|
||||||
s = n >> 2;
|
|
||||||
o = (n & 3) << 4 | r >> 4;
|
|
||||||
u = (r & 15) << 2 | i >> 6;
|
|
||||||
a = i & 63;
|
|
||||||
if (isNaN(r)) {
|
|
||||||
u = a = 64
|
|
||||||
} else if (isNaN(i)) {
|
|
||||||
a = 64
|
|
||||||
}
|
|
||||||
t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a)
|
|
||||||
}
|
|
||||||
return t
|
|
||||||
},
|
|
||||||
decode: function(e) {
|
|
||||||
var t = "";
|
|
||||||
var n, r, i;
|
|
||||||
var s, o, u, a;
|
|
||||||
var f = 0;
|
|
||||||
e = e.replace(/[^A-Za-z0-9+/=]/g, "");
|
|
||||||
while (f < e.length) {
|
|
||||||
s = this._keyStr.indexOf(e.charAt(f++));
|
|
||||||
o = this._keyStr.indexOf(e.charAt(f++));
|
|
||||||
u = this._keyStr.indexOf(e.charAt(f++));
|
|
||||||
a = this._keyStr.indexOf(e.charAt(f++));
|
|
||||||
n = s << 2 | o >> 4;
|
|
||||||
r = (o & 15) << 4 | u >> 2;
|
|
||||||
i = (u & 3) << 6 | a;
|
|
||||||
t = t + String.fromCharCode(n);
|
|
||||||
if (u != 64) {
|
|
||||||
t = t + String.fromCharCode(r)
|
|
||||||
}
|
|
||||||
if (a != 64) {
|
|
||||||
t = t + String.fromCharCode(i)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
t = Base64._utf8_decode(t);
|
|
||||||
return t
|
|
||||||
},
|
|
||||||
_utf8_encode: function(e) {
|
|
||||||
e = e.replace(/rn/g, "n");
|
|
||||||
var t = "";
|
|
||||||
for (var n = 0; n < e.length; n++) {
|
|
||||||
var r = e.charCodeAt(n);
|
|
||||||
if (r < 128) {
|
|
||||||
t += String.fromCharCode(r)
|
|
||||||
} else if (r > 127 && r < 2048) {
|
|
||||||
t += String.fromCharCode(r >> 6 | 192);
|
|
||||||
t += String.fromCharCode(r & 63 | 128)
|
|
||||||
} else {
|
|
||||||
t += String.fromCharCode(r >> 12 | 224);
|
|
||||||
t += String.fromCharCode(r >> 6 & 63 | 128);
|
|
||||||
t += String.fromCharCode(r & 63 | 128)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return t
|
|
||||||
},
|
|
||||||
_utf8_decode: function(e) {
|
|
||||||
var t = "";
|
|
||||||
var n = 0;
|
|
||||||
var r = c1 = c2 = 0;
|
|
||||||
while (n < e.length) {
|
|
||||||
r = e.charCodeAt(n);
|
|
||||||
if (r < 128) {
|
|
||||||
t += String.fromCharCode(r);
|
|
||||||
n++
|
|
||||||
} else if (r > 191 && r < 224) {
|
|
||||||
c2 = e.charCodeAt(n + 1);
|
|
||||||
t += String.fromCharCode((r & 31) << 6 | c2 & 63);
|
|
||||||
n += 2
|
|
||||||
} else {
|
|
||||||
c2 = e.charCodeAt(n + 1);
|
|
||||||
c3 = e.charCodeAt(n + 2);
|
|
||||||
t += String.fromCharCode((r & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
|
|
||||||
n += 3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return t
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +1,7 @@
|
|||||||
const request = require('request');
|
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');
|
|
||||||
|
|
||||||
|
|
||||||
var libsx = {
|
var libsx = {
|
||||||
@ -30,7 +27,6 @@ ipcMain
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var lib in libsx) {
|
for (var lib in libsx) {
|
||||||
if (fs.existsSync(global.dir+"/lib/"+libsx[lib])) {
|
if (fs.existsSync(global.dir+"/lib/"+libsx[lib])) {
|
||||||
|
|
||||||
@ -45,8 +41,6 @@ ipcMain
|
|||||||
if(url === ''){
|
if(url === ''){
|
||||||
libs.checkNext('youtube-dl');
|
libs.checkNext('youtube-dl');
|
||||||
}else{
|
}else{
|
||||||
switch (process.platform) {
|
|
||||||
case "win32":
|
|
||||||
libs.download(url,"ffmpeg",function(data,file){
|
libs.download(url,"ffmpeg",function(data,file){
|
||||||
fs.createReadStream(file)
|
fs.createReadStream(file)
|
||||||
.pipe(unzip.Parse())
|
.pipe(unzip.Parse())
|
||||||
@ -67,43 +61,6 @@ ipcMain
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
break;
|
|
||||||
case "linux":
|
|
||||||
libs.download(url, "ffmpeg", function(data, file) {
|
|
||||||
const ls = spawn('tar', ['xvf', './src/tmp/ffmpeg.x-xz', '-C', './src/tmp']);
|
|
||||||
|
|
||||||
ls.stdout.on('data', (data) => {
|
|
||||||
console.log(`stdout: ${data}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
ls.stderr.on('data', (data) => {
|
|
||||||
console.log(`stderr: ${data}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
ls.on('close', (code) => {
|
|
||||||
var folder = "";
|
|
||||||
console.log(`child process exited with code ${code}`);
|
|
||||||
const ls = spawn('rm', ['./src/tmp/ffmpeg.x-xz']).on('close', () => {
|
|
||||||
const ls = spawn('ls', ['./src/tmp/']).stdout.on(data, (data) => {
|
|
||||||
console.log(data)
|
|
||||||
if (data.match('ffmpeg-') && data.match('-static')) {
|
|
||||||
folder = data;
|
|
||||||
}
|
|
||||||
}).on('close', () => {
|
|
||||||
const ls = spawn('cp', ['./src/tmp/' + folder + '/ffmpeg', './src/lib/ffmpeg']).on('close', () => {
|
|
||||||
const ls = spawn('cp', ['./src/tmp/' + folder + '/ffprobe', './src/lib/ffprobe']).on('close', () => {
|
|
||||||
libs.checkNext('youtube-dl');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
libs.checkNext('youtube-dl');
|
libs.checkNext('youtube-dl');
|
||||||
@ -129,7 +86,7 @@ libs.ff = (os) => {
|
|||||||
url = 'http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-latest-win32-static.zip';
|
url = 'http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-latest-win32-static.zip';
|
||||||
break;
|
break;
|
||||||
case "linux":
|
case "linux":
|
||||||
url = 'https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz'
|
url = ''
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
@ -140,18 +97,15 @@ libs.yt_dl = (os, cb) => {
|
|||||||
var url = "";
|
var url = "";
|
||||||
switch (os) {
|
switch (os) {
|
||||||
case "win32":
|
case "win32":
|
||||||
url = 'https://yt-dl.org/downloads/2017.08.13/youtube-dl.exe';
|
url = 'https://yt-dl.org/downloads/latest/youtube-dl.exe';
|
||||||
libs.download(url,"youtube-dl",function(data,file){
|
libs.download(url,"youtube-dl",function(data,file){
|
||||||
fs.renameSync(file,global.dir+'/lib/youtube-dl.exe');
|
fs.renameSync(file,global.dir+'/lib/youtube-dl.exe');
|
||||||
cb();
|
cb();
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case "linux":
|
case "linux":
|
||||||
url = 'https://yt-dl.org/downloads/latest/youtube-dl'
|
url = ''
|
||||||
libs.download(url, "youtube-dl", function(data, file) {
|
|
||||||
fs.renameSync(file, global.dir + '/lib/youtube-dl');
|
|
||||||
cb();
|
cb();
|
||||||
})
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -167,9 +121,7 @@ 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', {
|
libs.listen.sender.send('progress',{percent :Math.floor(perc)});
|
||||||
percent: Math.floor(perc)
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
r.on('response', function (res) {
|
r.on('response', function (res) {
|
||||||
@ -181,8 +133,6 @@ libs.download = (url, data, cb) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function win_ffmpeg() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = libs;
|
module.exports = libs;
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
const {
|
const { exec } = require('child_process');
|
||||||
exec
|
|
||||||
} = require('child_process');
|
|
||||||
|
|
||||||
var install = {};
|
var install = {};
|
||||||
|
|
||||||
@ -42,9 +40,7 @@ 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', {
|
libs.listen.sender.send('progress',{percent :Math.floor(perc)});
|
||||||
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,18 +37,14 @@ 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', {
|
e.sender.send('play-in-Window',{do :false});
|
||||||
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', {
|
s.sender.send('play-in-Window',{do :false});
|
||||||
do: false
|
|
||||||
});
|
|
||||||
win.close();
|
win.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,9 +60,7 @@ class playerOnTop {
|
|||||||
alwaysOnTop: true,
|
alwaysOnTop: true,
|
||||||
icon: global.dir + '/app.ico'
|
icon: global.dir + '/app.ico'
|
||||||
})
|
})
|
||||||
e.sender.send('play-in-Window', {
|
e.sender.send('play-in-Window',{do :true});
|
||||||
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', () => {
|
||||||
@ -80,9 +74,7 @@ class playerOnTop {
|
|||||||
});
|
});
|
||||||
win.on('closed', () => {
|
win.on('closed', () => {
|
||||||
pot.isOpen = false;
|
pot.isOpen = false;
|
||||||
e.sender.send('play-in-Window', {
|
e.sender.send('play-in-Window',{do :false});
|
||||||
do: false
|
|
||||||
});
|
|
||||||
win = null;
|
win = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,41 +1,20 @@
|
|||||||
const {
|
const {app, Menu, Tray} = require('electron')
|
||||||
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')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = ()=>{
|
module.exports = ()=>{
|
||||||
|
|
||||||
switch (process.platform) {
|
|
||||||
case 'win32':
|
|
||||||
|
|
||||||
break;
|
let tray = new Tray(global.dir+'/app.ico')
|
||||||
case 'linux':
|
const contextMenu = Menu.buildFromTemplate([
|
||||||
|
{label: 'Open', click(){ main_window.open() }},
|
||||||
break;
|
|
||||||
}
|
|
||||||
let tray = new Tray(path.join(global.dir + '/app.png'))
|
|
||||||
const contextMenu = Menu.buildFromTemplate([{
|
|
||||||
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,10 +22,7 @@ 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', {
|
watch_event.sender.send('watchr_file',{type:"add",file:files[i]});
|
||||||
type: "add",
|
|
||||||
file: files[i]
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function listener(changeType, fullPath, currentStat, previousStat) {
|
function listener(changeType, fullPath, currentStat, previousStat) {
|
||||||
@ -39,16 +36,10 @@ 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', {
|
watch_event.sender.send('watchr_file',{type:"add",file:fullPath});
|
||||||
type: "add",
|
|
||||||
file: fullPath
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
watch_event.sender.send('watchr_file', {
|
watch_event.sender.send('watchr_file',{type:"remove",file:fullPath});
|
||||||
type: "remove",
|
|
||||||
file: fullPath
|
|
||||||
});
|
|
||||||
files.splice(files.indexOf(fullPath), 1);
|
files.splice(files.indexOf(fullPath), 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
BrowserWindow,
|
BrowserWindow,
|
||||||
session
|
session
|
||||||
@ -16,9 +18,7 @@ class browser {
|
|||||||
icon: global.dir + '/app.ico'
|
icon: global.dir + '/app.ico'
|
||||||
})
|
})
|
||||||
setInterval(function(){
|
setInterval(function(){
|
||||||
session.defaultSession.cookies.get({
|
session.defaultSession.cookies.get({url:'http://crunchyroll.com'}, (error, cookies) => {
|
||||||
url: 'http://crunchyroll.com'
|
|
||||||
}, (error, cookies) => {
|
|
||||||
//console.log(error, cookies)
|
//console.log(error, cookies)
|
||||||
crunch.session_save(cookies);
|
crunch.session_save(cookies);
|
||||||
})
|
})
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
const {
|
const { spawn } = require('child_process');
|
||||||
spawn
|
const {Notification,ipcMain}= require('electron');
|
||||||
} = 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');
|
||||||
|
|
||||||
@ -20,24 +15,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({
|
var request = require('request').defaults({ encoding: null });
|
||||||
encoding: null
|
|
||||||
});
|
|
||||||
|
|
||||||
var list = [];
|
|
||||||
|
|
||||||
ipcMain
|
ipcMain
|
||||||
.on('start-download', (event, arg)=>{
|
.on('start-download', (event, arg)=>{
|
||||||
path = orig_path;
|
path = orig_path
|
||||||
if(list.length != 0){
|
var download = new yt_dl(arg.url,arg.id);
|
||||||
list.push([arg,event]);
|
|
||||||
}else{
|
|
||||||
list.push([arg,event]);
|
|
||||||
var download = new yt_dl(arg.url, arg.id, arg.title);
|
|
||||||
download.addListen(event)
|
download.addListen(event)
|
||||||
download.download();
|
download.download();
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
.on('set-format',(event,arg)=>{
|
.on('set-format',(event,arg)=>{
|
||||||
format = arg.format;
|
format = arg.format;
|
||||||
@ -68,12 +53,11 @@ ipcMain
|
|||||||
});
|
});
|
||||||
|
|
||||||
var yt_dl = class{
|
var yt_dl = class{
|
||||||
constructor(url, id, title) {
|
constructor(url,id){
|
||||||
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
|
||||||
@ -86,8 +70,7 @@ var yt_dl = class {
|
|||||||
var me = this;
|
var me = this;
|
||||||
var ls;
|
var ls;
|
||||||
|
|
||||||
var m = dl_routine(path, this.url, format, this.title);
|
var m = dl_routine(path,this.url,format);
|
||||||
console.log('CMD: '+m[0]+' '+ m[1]);
|
|
||||||
ls = spawn(m[0],m[1]);
|
ls = spawn(m[0],m[1]);
|
||||||
|
|
||||||
|
|
||||||
@ -112,10 +95,7 @@ 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', {
|
me.lwrite.sender.send('download-progress',{percent :me.percent,id:me.id});
|
||||||
percent: me.percent,
|
|
||||||
id: me.id
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
@ -131,10 +111,7 @@ var yt_dl = class {
|
|||||||
}
|
}
|
||||||
file = z[x];
|
file = z[x];
|
||||||
}
|
}
|
||||||
me.lwrite.sender.send('file', {
|
me.lwrite.sender.send('file',{id:me.id,file:file});
|
||||||
id: me.id,
|
|
||||||
file: file
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -150,59 +127,69 @@ 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,
|
switch(format){
|
||||||
file: log[log.length - 2].split('[ffmpeg] Destination: ')[1]
|
case "wma":
|
||||||
});
|
me.lwrite.sender.send('process-fin',{percent :101,id:me.id});
|
||||||
me.lwrite.sender.send('process-fin', {
|
setTimeout(function(){
|
||||||
percent: me.percent,
|
var fo = log[log.length-2].split('[ffmpeg] Destination: ')[1].replace(/\\/g,'/').trim();
|
||||||
id: me.id
|
var f = fo.replace('.mp3','.'+format);
|
||||||
|
console.log(f)
|
||||||
|
const bat = spawn(global.dir+'/lib/ffmpeg', ['-i',fo,f,'-loglevel','repeat+level+verbose']);
|
||||||
|
console.dir(bat)
|
||||||
|
bat.stdout.on('data', (data) => {
|
||||||
|
console.log(data.toString());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
bat.stderr.on('data', (data) => {
|
||||||
|
console.log(data.toString());
|
||||||
|
});
|
||||||
|
|
||||||
list.splice(0,1);
|
bat.on('exit', (code) => {
|
||||||
if(list.length>0){
|
console.log(`Child exited with code ${code}`);
|
||||||
dl(list[0][0],list[0][1]);
|
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});
|
||||||
|
});
|
||||||
|
},2000)
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
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});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
var title = this.title;
|
|
||||||
|
|
||||||
if (this.url.match('youtube') && format === 'mp3') {
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 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];
|
||||||
var ampersandPosition = video_id.indexOf('&');
|
var ampersandPosition = video_id.indexOf('&');
|
||||||
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 " + title,
|
body :"finished download for "+url,
|
||||||
//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, path + '/' + title + '.' + format);
|
var success = nodeID3.write(tags, log[log.length-2].split('[ffmpeg] Destination: ')[1]);
|
||||||
console.log(success);
|
console.log(success);
|
||||||
});
|
});
|
||||||
}
|
}*/
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function dl(arg,event){
|
|
||||||
var download = new yt_dl(arg.url, arg.id, arg.title);
|
|
||||||
download.addListen(event)
|
|
||||||
download.download();
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = yt_dl;
|
module.exports = yt_dl;
|
||||||
|
@ -1,23 +1,27 @@
|
|||||||
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);
|
||||||
if(url.match('youtube')){
|
if(url.match('youtube')){
|
||||||
console.log('youtube')
|
console.log('youtube')
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case "vorbis":
|
|
||||||
param = ['-x', '-f', 'bestaudio[acodec^=opus]', '--audio-format', 'vorbis', '-i', url, '-o', path + '/'+title+'.%(ext)s'];
|
|
||||||
break;
|
|
||||||
case "mp3":
|
case "mp3":
|
||||||
param = ['--audio-quality', '0','-f','bestaudio[ext=m4a]','--audio-format','mp3', url, '-o', path + '/'+title+'.%(ext)s'];
|
param = ['-x','--audio-format','mp3','-i',url,'-o',path+'/%(title)s.%(ext)s'];
|
||||||
|
break;
|
||||||
|
case "wma":
|
||||||
|
param = ['-x','--audio-format','mp3','-i',url,'-o',path+'/%(title)s.%(ext)s'];
|
||||||
break;
|
break;
|
||||||
case "mp4":
|
case "mp4":
|
||||||
param = ['-w', '-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4', url, '-o', path + '/'+title+'.%(ext)s'];
|
param = ['-w','-f','bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4',url,'-o',path+'/%(title)s.%(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,6 +20,29 @@ 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')
|
||||||
@ -33,6 +56,8 @@ 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();
|
||||||
@ -42,18 +67,27 @@ 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