1.4.0 Alpha

This commit is contained in:
Theenoro 2017-08-28 03:50:31 +02:00
parent acab4b1908
commit d7958e1594
17 changed files with 637 additions and 102 deletions

View File

@ -3,6 +3,9 @@
![./current-preview.PNG](./current-preview.PNG)
# v 1.4.0 Alpha
Preview [Video](https://cl.thee.moe/index.php/s/T8FEaFFxyhlxIj6)
# Download 1.3.0

View File

@ -49,9 +49,12 @@
"dependencies": {
"electron": "^1.6.11",
"electron-compile": "^6.4.1",
"fs": "0.0.1-security",
"mkdirp": "^0.5.1",
"path": "^0.12.7",
"request": "^2.81.0",
"unzip": "^0.1.11"
"unzip": "^0.1.11",
"watchr": "^3.0.1"
},
"devDependencies": {
"babel-plugin-transform-async-to-generator": "^6.24.1",

View File

@ -1,14 +1,34 @@
$(function() {
var download_progress = $('#download-progress');
var format = null;
var out = $('#output');
var video = document.getElementById('video');
const ipcRenderer = require('electron').ipcRenderer;
const request = require('request');
const helper = require('./../../helper/string');
const {
dialog
} = require('electron').remote;
var cache = {};
var path = "";
var pot = false;
ipcRenderer.send('watchr_event', {});
ipcRenderer.on('play-in-Window',function(event,arg){
pot = arg.do;
})
ipcRenderer.on('watchr_file', function(event, arg) {
arg.file = encodeURI(arg.file)
if (arg.type === "add") {
$('#watchr_files').append('<tr class="file" data-file="' + arg.file + '"><td>' + arg.file + '</td><td><button class="play-file btn btn-success" data-file="' + 'file://' + arg.file + '"><i class="fa fa-play-circle-o" aria-hidden="true"></i></button></td></tr>')
} else if (arg.type === "remove") {
$('.file[data-file="' + arg.file + '"]').remove();
}
$('#download-progress-' + arg.id).html(arg.percent);
})
ipcRenderer.on('download-progress', function(event, arg) {
console.log(arg); // prints "pong"
$('#download-progress-' + arg.id).css("width", arg.percent);
@ -20,8 +40,12 @@ $(function() {
$('#download-progress-' + arg.id).html("CONVERTED");
});
ipcRenderer.on('file', function(event, arg) {
console.log('DOWNLOADED')
console.log(arg); // prints "pong"
$('#body-' + arg.id).append('<audio src="file://' + path + '/' + cache[arg.id] + '.mp3" controls="true"/>');
$('.media-out-' + arg.id).html('<button class="play-file" data-file="' + 'file://' + path + '/' + encodeURI(cache[arg.id]) + '.' + format + '">Play</button>');
//var video = document.getElementById('video');
//$('#body-' + arg.id).append('<audio src="file://' + path + '/' + cache[arg.id] + '.'+format+'" controls="true"/>');
});
document.getElementById('party').addEventListener('click', _ => {
path = dialog.showOpenDialog({
@ -32,7 +56,20 @@ $(function() {
path: path
});
})
$('#pot').click(function(){
ipcRenderer.send('open-pot', {
});
});
$('body').delegate('.play-file', 'click', function(e) {
if(pot === false){
video.setAttribute("src", e.currentTarget.dataset.file);
video.play();
}else{
ipcRenderer.send('pot_run', {file:e.currentTarget.dataset.file});
}
})
$('body').delegate('.format', 'click', function(e) {
format = e.currentTarget.dataset.format;
ipcRenderer.send('set-format', {
format: e.currentTarget.dataset.format
});
@ -43,7 +80,7 @@ $(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></div>').prependTo('#output');
$('<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');
ipcRenderer.send('start-download', {
url: $('#url').val(),
id: video_id
@ -65,19 +102,19 @@ $(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></div>').prependTo('#output');
$('<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');
cache[video_id] = YT.title;
ipcRenderer.send('start-download-pl', {
url: $('#url').val(),
id: video_id,
folder: YT.author_name + '-' + YT.title
folder: YT.author_name + '-' + YT.title.replace(/\|/g, "_")
});
})
} else {
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></div>').prependTo('#output');
$('<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');
cache[video_id] = YT.title;
ipcRenderer.send('start-download', {
url: $('#url').val(),

66
src/app/js/pot_main.js Normal file
View File

@ -0,0 +1,66 @@
$(function() {
const ipcRenderer = require('electron').ipcRenderer;
ipcRenderer.send('pot_real_open', {x:"xx"});
var video = document.getElementById('video');
console.log('TEST')
ipcRenderer.on('pot_play',function(event,arg){
var file = arg.file;
video.setAttribute("src", file);
video.play();
})
// btn
var st_play = '<i class="fa fa-play-circle-o" aria-hidden="true"></i>';
var st_pause = '<i class="fa fa-pause-circle-o" aria-hidden="true"></i>';
video.ontimeupdate = function(){
var percentage = ( video.currentTime / video.duration ) * 100;
$("#time span").css("width", percentage+"%");
};
$("#time").on("click", function(e){
var offset = $(this).offset();
var left = (e.pageX - offset.left);
var totalWidth = $("#time").width();
var percentage = ( left / totalWidth );
var vidTime = video.duration * percentage;
video.currentTime = vidTime;
})
$("#volume span").css('width',(100*video.volume)+'%')
$("#volume").on("click", function(e){
var offset = $(this).offset();
var left = (e.pageX - offset.left);
var totalWidth = $("#volume").width();
var percentage = ( left / totalWidth );
var volume = 1 * percentage;
video.volume = volume;
$("#volume span").css('width',(100*percentage)+'%')
console.log(volume)
})
$('#close').click(function () {
ipcRenderer.send('close_pot',{});
});
$('#play').click(function(){
if(video.paused){
video.play();
$('#play').html(st_pause)
}else{
video.pause();
$('#play').html(st_play)
}
})
$('.navbar').on( "mouseleave",function () {
$('.navbar').css('opacity',"0")
});
$('.navbar').on( "mouseenter",function () {
$('.navbar').css('opacity',"1")
});
$('body').on( "mouseenter",function () {
$('.navbar').css('opacity',"1")
});
})

View File

@ -1,59 +1 @@
body {
margin: 0;
background: #131313;
color:#e9188d;
}
.btn-success {
color: #e9188d;
background-color: #131313;
border-color: #e9188d;
transition: all .3s;
}
.btn-success:hover ,.btn-success:active,.btn-success:focus,.dropdown-toggle:focus,.dropdown-toggle:active,.btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success {
color: #131313 !important;
background-color: #e9188d !important;
border-color: #e9188d !important;
transition: all .3s;
}
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
text-decoration: none;
color: rgb(233, 24, 141);
background-color: #131313;
}
.dropdown-menu{
background-color: #131313;
}
span.input-group-btn.open > ul > li> a{
background-image:none;
}
.progress{
background-image:none;
background-color: #131313;
box-shadow: inset 0px 0px 3px 0px #da1985;
}
.progress-bar{
background-image:none;
background-color: #131313;
box-shadow: inset 0px 0px 12px 0px #da1985;
}
.media:first-child {
margin-top: 15px;
}
.media {
box-shadow: 0px 0px 6px 1px #ff008e;
}
.sidebar-nav {
padding: 10px;
}
.nav.nav-list a {
padding: 5px 10px;
}
.nav-header {
font-weight: bold;
}
.scroll{
overflow-y: scroll;
height: calc( 100vh - 46px);
}
body{margin:0;margin-top:50px;background:#1d2247;color:#e01931}.btn-success{color:#e01931;background-color:#1d2247;border-color:#e01931;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:#1d2247!important;background-color:#e01931!important;border-color:#e01931!important;transition:all .3s}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{text-decoration:none;color:#e01931;background-color:#1d2247}.dropdown-menu{background-color:#1d2247}span.input-group-btn.open>ul>li>a{background-image:none}.progress{background-image:none;background-color:#1d2247;box-shadow:inset 0 0 3px 0 #e01931}.progress-bar{background-image:none;background-color:#1d2247;box-shadow:inset 0 0 12px 0 #e01931;transition:.3s all}.media:first-child{margin-top:15px}.media{box-shadow:0 0 6px 1px #e01931}.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 #e01931;height:calc(100vh - 20vw - 30px)}

76
src/app/style/style.less Normal file
View File

@ -0,0 +1,76 @@
/*
*/
@main-front-color: #E01931;
@background-color: #1D2247;
body {
margin: 0;
margin-top: 50px;
background: @background-color;
color:@main-front-color;
}
.btn-success {
color: @main-front-color;
background-color: @background-color;
border-color: @main-front-color;
transition: all .3s;
}
.btn-success:hover ,.btn-success:active,.btn-success:focus,.dropdown-toggle:focus,.dropdown-toggle:active,.btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success {
color: @background-color !important;
background-color: @main-front-color !important;
border-color: @main-front-color !important;
transition: all .3s;
}
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
text-decoration: none;
color: @main-front-color;
background-color: @background-color;
}
.dropdown-menu{
background-color: @background-color;
}
span.input-group-btn.open > ul > li> a{
background-image:none;
}
.progress{
background-image:none;
background-color: @background-color;
box-shadow: inset 0px 0px 3px 0px @main-front-color;
}
.progress-bar{
background-image:none;
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;
}
.sidebar-nav {
padding: 10px;
}
.nav.nav-list a {
padding: 5px 10px;
}
.nav-header {
font-weight: bold;
}
.scroll{
overflow-y: scroll;
height: ~"calc( 100vh - 96px)";
}
.left-playlist{
box-shadow: 0px 0px 6px 1px @main-front-color;
height: ~"calc(100vh - 20vw - 30px )";
}

View File

@ -25,43 +25,61 @@
<div class="row">
<div class="col-md-2">
<div class="sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Navigation</li>
<li class="active"><a href=""><i class="fa fa-download" aria-hidden="true"></i> Downloader</a></li>
<li><a href="#"><i class="fa fa-play-circle-o" aria-hidden="true"></i> Player</a></li>
</ul>
<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>
</div>
<dic class="col-md-10">
<input id="business" type="file" style="display: none" />
<div class="row">
<div class="col-md-12">
<div class="input-group input-group-lg">
<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" />
<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>
<span class="input-group-btn">
<button type="button" id="start-download" class="btn btn-success btn-sm">Download</button>
</span>
<div class="col-md-6">
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="download">
<input id="business" type="file" style="display: none" />
<div class="row">
<div class="col-md-12">
<div class="input-group input-group-lg">
<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" />
<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>
<span class="input-group-btn">
<button type="button" id="start-download" class="btn btn-success btn-sm">Download</button>
</span>
</div>
</div>
</div>
<div class="row scroll">
<div class="col-md-12" id="output">
</div>
</div>
</div>
</div>
<div class="row scroll">
<div class="col-md-12" id="output">
<div role="tabpanel" class="tab-pane fade" id="player">
<table class="table table-striped" id="watchr_files">
</table>
</div>
</div>
</div>
<div class="col-md-4">
<div class="embed-responsive embed-responsive-16by9">
<video controls="true" id="video"></video>
</div>
<button id="pot">POT</button>
<div class="left-playlist">
</div>
</div>
</div>
</div>

112
src/app/view/pot.html Normal file
View File

@ -0,0 +1,112 @@
<!DOCTYPE html>
<html>
<head>
<script>
if (typeof module === 'object') {
window.module = module;
module = undefined;
}
</script>
<script src="./../libs/jquery/jquery-3.2.1.min.js"></script>
<script src="./../libs/bootstrap/js/bootstrap.js"></script>
<meta charset="utf-8">
<title>Cyb3r Downloader - Player on Top</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/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="./../style/progress.css" />
<link rel="stylesheet" href="./../style/style.css" />
<style>
video {
max-width: 100%;
width:100%;
max-height: 100%;
}
body{
overflow:hidden;
}
body > nav > div > button {
margin: 0;
background-color: transparent !important;
}
.navbar{
padding: 0;
margin: 0;
height: 35px;
min-height: 35px;
width:100%;
}
#time
{
cursor: pointer;
height: 10px;
margin-bottom: 10px;
outline: thin solid #e01931;
overflow: hidden;
position: relative;
width: 100%;
vertical-align: -webkit-baseline-middle;
line-height: 1.42857143; height: 9px;
display:inline-block;
top: 13px;
}
#volume
{
cursor: pointer;
height: 10px;
margin-bottom: 10px;
outline: thin solid #e01931;
overflow: hidden;
position: relative;
width: 200px;
vertical-align: -webkit-baseline-middle;
line-height: 1.42857143; height: 9px;
display:inline-block;
top: 13px;
}
#time span ,#volume span
{
background-color: #e01931;
position: absolute;
top: 0;
left: 0;
height: 10px;
width: 0px;
}
body .navbar{
opacity: 0;
transition: .3s all;
position: fixed;
}
body:hover .navbar{
opacity: 1;
transition: .3s all;
background-color: rgba(51, 51, 51, 0.64);
box-shadow: 5px 0px 6px 6px rgba(51, 51, 51, 0.64);
}
</style>
</head>
<body style="margin:0">
<nav class="navbar navbar-static-top">
<div style=" margin: 0; padding: 0; height: 35px; display:flex;">
<button class="btn nabbar-btn btn-success" style="margin:0;" id="play"><i class="fa fa-pause-circle-o" aria-hidden="true"></i></button>
<div id="time">
<span></span>
</div>
<button class="btn nabbar-btn btn-success" style="margin:0;" ><i class="fa fa-volume-up" aria-hidden="true"></i></button>
<div id="volume">
<span></span>
</div>
<button class="btn navbar-btn btn-success" style="-webkit-app-region: drag;margin: 0;"><i class="fa fa-arrows" aria-hidden="true"></i></button>
<button class="btn navbar-btn btn-success" id="close" style="margin:0;"><i class="fa fa-window-close-o" aria-hidden="true"></i></button>
</div>
</nav>
<video id="video"></video>
<script src="./../js/pot_main.js"></script>
</body>
</html>

View File

@ -22,13 +22,13 @@ crunch.session_save = (session)=>{
}
net += session[i].domain+' '+session[i].httpOnly.toString().toUpperCase()+' '+session[i].path+' '+session[i].secure.toString().toUpperCase()+' '+Math.ceil(session[i].expirationDate)+' '+session[i].name+' '+session[i].value+'\n';
}
console.log(net);
fs.writeFile(global.dir+"/tmp/c", net, function(err) {
//console.log(net);
/*fs.writeFile(global.dir+"/tmp/c", net, function(err) {
if(err) {
return console.log(err);
}
console.log("T!");
});
//console.log("T!");
});*/
}
module.exports = crunch;

View File

@ -0,0 +1,73 @@
const {
app,
BrowserWindow,
Menu,
dialog,
ipcMain
} = require('electron');
//alwaysOnTop
var win = null;
var pot = {};
var s = null;
ipcMain
.on('close_pot',(event,arg)=>{
console.log('CLOSE')
pot.close(event);
})
pot.isOpen = false;
pot.open = (e) => {
s = e;
if (win !== null) {
e.sender.send('play-in-Window',{do :false});
win.close();
}
var x = new playerOnTop(e);
console.log('XX');
}
pot.close = ()=>{
console.log('CLOSE')
s.sender.send('play-in-Window',{do :false});
win.close();
}
class playerOnTop {
constructor(e) {
pot.isOpen = true;
this.win = new BrowserWindow({
width: 320,
height: 500,
show: false,
frame: false,
alwaysOnTop: true,
icon: global.dir + '/app.ico'
})
e.sender.send('play-in-Window',{do :true});
win = this.win;
win.loadURL(`file://${global.dir}/app/view/pot.html`)
win.once('ready-to-show', () => {
win.show();
console.log('XX');
})
win.on('resize', function () {
setTimeout(function () {
var size = win.getSize();
win.setSize(size[0], parseInt(size[0] * 9 / 16));
}, 0);
});
win.on('closed', () => {
pot.isOpen = false;
e.sender.send('play-in-Window',{do :false});
win = null;
console.log('XX');
});
}
}
module.exports = pot;

61
src/controller/watchr.js Normal file
View File

@ -0,0 +1,61 @@
const watchr = require('watchr');
const fs = require('fs')
const path = require('path')
const ipcMain = require('electron').ipcMain;
var watch_event = null;
ipcMain
.on('watchr_event', (event, arg)=>{
watch_event = event
})
class folderWatchr {
constructor(folder) {
this.folder = folder;
this.files = [];
var files = this.files;
fs.readdirSync(this.folder).forEach(file => {
files.push(folder + '/' + file);
});
for(var i = 0;i<files.length;i++){
files[i]=files[i].replace(/\\/g, "/");
watch_event.sender.send('watchr_file',{type:"add",file:files[i]});
}
function listener(changeType, fullPath, currentStat, previousStat) {
console.log(changeType);
fullPath = fullPath.replace(/\\/g, "/");
switch (changeType) {
case 'update':
break;
case 'create':
console.log('the file', fullPath, 'was created', currentStat)
files.push(fullPath);
watch_event.sender.send('watchr_file',{type:"add",file:fullPath});
break;
case 'delete':
watch_event.sender.send('watchr_file',{type:"remove",file:fullPath});
files.splice(files.indexOf(fullPath), 1);
break;
}
}
function next(err) {
if (err) return console.log('watch failed on', path, 'with error', err);
console.log('watch successful on', path);
}
// Watch the path with the change listener and completion callback
this.stalker = watchr.open(this.folder , listener, next);
}
destroy(){
this.stalker.close()
}
}
module.exports = folderWatchr;

View File

@ -1,13 +1,31 @@
const { spawn } = require('child_process');
const ipcMain = require('electron').ipcMain;
const dl_routine = require('./youtube-dl.routine')
const pot = require('./player_onTop')
const folderWatchr = require('./watchr')
console.log(global.dir);
var orig_path = "";
var path = "";
var format = "mp3";
var fol = null;
var pot_open_ev = null;
ipcMain
.on('pot_run',(event,arg)=>{
pot_open_ev.sender.send('pot_play',arg);
})
.on('pot_real_open',(event,arg)=>{
console.log('POT EVENT SET')
pot_open_ev = event;
})
ipcMain
.on('open-pot',(event,arg)=>{
pot.open(event);
})
.on('start-download', (event, arg)=>{
path = orig_path
var download = new yt_dl(arg.url,arg.id);
@ -35,6 +53,10 @@ ipcMain
ipcMain.on('setPath', function(event, arg) {
path = arg.path;
orig_path = arg.path;
if(fol !== null){
fol.destroy()
}
fol = new folderWatchr(path);
console.log('SET Path: '+path)
});
@ -79,7 +101,23 @@ var yt_dl = class{
me.lwrite.sender.send('download-progress',{percent :me.percent,id:me.id});
break;
default:
}
var m = z.length;
for(var i = 0;i<m;i++){
if(z[i] === '[ffmpeg]'){
if(z[i+1] === 'Merging'){
var file = "";
for(var x = i+4;x<m;x++){
console.log(z[x])
if(z[x] === 'has' && z[x+1] === "already" && z[x+2] === "been" && z[x+3] === 'downloaded'){
break;
}
file = z[x];
}
me.lwrite.sender.send('file',{id:me.id,file:file});
break;
}
}
}
}catch(e){
console.log(e);

View File

@ -12,7 +12,7 @@ module.exports = (path,url,format)=>{
param = ['-x','--audio-format','mp3','-i',url,'-o',path+'/%(title)s.%(ext)s'];
break;
case "mp4":
param = ['-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)s.%(ext)s'];
break;
default:

15
src/helper/string.js Normal file
View File

@ -0,0 +1,15 @@
var st = {};
st.replace = (str)=>{
return sub
.replace(/\|/g, "_");
}
module.exports = st;

View File

@ -78,7 +78,7 @@ if (!fs.existsSync(global.dir+'/tmp/inst')) {
icon: __dirname + '/app.ico'
})
win.close();
var z = new browser('http://www.crunchyroll.com/');
//var z = new browser('http://www.crunchyroll.com/');
win2.loadURL(`file://${__dirname}/app/view/layout.html`)
win = win2;
});

View File

@ -0,0 +1,76 @@
/*
*/
@main-front-color: #E01931;
@background-color: #1D2247;
body {
margin: 0;
margin-top: 50px;
background: @background-color;
color:@main-front-color;
}
.btn-success {
color: @main-front-color;
background-color: @background-color;
border-color: @main-front-color;
transition: all .3s;
}
.btn-success:hover ,.btn-success:active,.btn-success:focus,.dropdown-toggle:focus,.dropdown-toggle:active,.btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success {
color: @background-color !important;
background-color: @main-front-color !important;
border-color: @main-front-color !important;
transition: all .3s;
}
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
text-decoration: none;
color: @main-front-color;
background-color: @background-color;
}
.dropdown-menu{
background-color: @background-color;
}
span.input-group-btn.open > ul > li> a{
background-image:none;
}
.progress{
background-image:none;
background-color: @background-color;
box-shadow: inset 0px 0px 3px 0px @main-front-color;
}
.progress-bar{
background-image:none;
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;
}
.sidebar-nav {
padding: 10px;
}
.nav.nav-list a {
padding: 5px 10px;
}
.nav-header {
font-weight: bold;
}
.scroll{
overflow-y: scroll;
height: ~"calc( 100vh - 96px)";
}
.left-playlist{
box-shadow: 0px 0px 6px 1px @main-front-color;
height: ~"calc(100vh - 20vw - 30px )";
}

15
src/tmp/c Normal file
View File

@ -0,0 +1,15 @@
# 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