From 44042f5d5e2df085733d93cb512f70a01ff52371 Mon Sep 17 00:00:00 2001 From: Theenoro Date: Mon, 21 Aug 2017 23:54:57 +0200 Subject: [PATCH 1/4] 1.3.2.1 --- src/controller/windows.js/browser.js | 35 ++++++++++++++++++++++++++++ src/index.js | 5 ++++ 2 files changed, 40 insertions(+) create mode 100644 src/controller/windows.js/browser.js diff --git a/src/controller/windows.js/browser.js b/src/controller/windows.js/browser.js new file mode 100644 index 0000000..2be50c7 --- /dev/null +++ b/src/controller/windows.js/browser.js @@ -0,0 +1,35 @@ + + +const { + BrowserWindow, + session +} = require('electron'); + +class browser { + constructor(url){ + console.log("TEST") + this.window = new BrowserWindow({ + width: 500, + height: 500, + show: true, + frame: true, + icon: global.dir + '/app.ico' + }) + setInterval(function(){ + session.defaultSession.cookies.get({url:'http://crunchyroll.com'}, (error, cookies) => { + console.log(error, cookies) + }) + },3000) + var window = this.window + window.loadURL(url) + window.once('ready-to-show', () => { + + }) + + this.window.on('closed', () => { + window = null; + }); + } +} + +module.exports = browser; diff --git a/src/index.js b/src/index.js index 5ee1289..1361122 100644 --- a/src/index.js +++ b/src/index.js @@ -10,11 +10,15 @@ const { const fs = require('fs'); const yt_dl = require('./controller/youtube-dl') const dl = require('./controller/download'); +const browser = require('./controller/windows.js/browser'); + + 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, @@ -74,6 +78,7 @@ if (!fs.existsSync(global.dir+'/tmp/inst')) { icon: __dirname + '/app.ico' }) win.close(); + var z = new browser('http://www.crunchyroll.com/'); win2.loadURL(`file://${__dirname}/app/view/layout.html`) win = win2; }); From acab4b1908d6ee7f5f6ab852c652d7116e6881db Mon Sep 17 00:00:00 2001 From: Theenoro Date: Wed, 23 Aug 2017 00:20:53 +0200 Subject: [PATCH 2/4] 1.3.2.2 Offline watch --- src/app/js/app.js | 115 ++++++++++++++++----------- src/controller/crunchyroll.js | 34 ++++++++ src/controller/windows.js/browser.js | 5 +- src/controller/youtube-dl.js | 12 +-- src/controller/youtube-dl.routine.js | 31 ++++++++ 5 files changed, 142 insertions(+), 55 deletions(-) create mode 100644 src/controller/crunchyroll.js create mode 100644 src/controller/youtube-dl.routine.js diff --git a/src/app/js/app.js b/src/app/js/app.js index 686f356..61d458c 100644 --- a/src/app/js/app.js +++ b/src/app/js/app.js @@ -1,68 +1,93 @@ -$(function(){ +$(function() { var download_progress = $('#download-progress'); var out = $('#output'); const ipcRenderer = require('electron').ipcRenderer; const request = require('request'); - const {dialog} = require('electron').remote; + const { + dialog + } = require('electron').remote; var cache = {}; var path = ""; ipcRenderer.on('download-progress', function(event, arg) { - console.log(arg); // prints "pong" - $('#download-progress-'+arg.id).css("width",arg.percent); - $('#download-progress-'+arg.id).html(arg.percent); + console.log(arg); // prints "pong" + $('#download-progress-' + arg.id).css("width", arg.percent); + $('#download-progress-' + arg.id).html(arg.percent); }); ipcRenderer.on('process-fin', function(event, arg) { - console.log(arg); // prints "pong" - $('#download-progress-'+arg.id).css("width",arg.percent); - $('#download-progress-'+arg.id).html("CONVERTED"); + console.log(arg); // prints "pong" + $('#download-progress-' + arg.id).css("width", arg.percent); + $('#download-progress-' + arg.id).html("CONVERTED"); }); ipcRenderer.on('file', function(event, arg) { - console.log(arg); // prints "pong" - $('#body-'+arg.id).append('