diff --git a/src/app/style/style.css b/src/app/style/style.css new file mode 100644 index 0000000..571a90d --- /dev/null +++ b/src/app/style/style.css @@ -0,0 +1,4 @@ +body { + margin: 0; + background: #333; +} \ No newline at end of file diff --git a/src/app/view/layout.html b/src/app/view/layout.html index d956a49..757c4b0 100644 --- a/src/app/view/layout.html +++ b/src/app/view/layout.html @@ -16,6 +16,7 @@ +
diff --git a/src/controller/download.js b/src/controller/download.js index bc0d7bf..10267e5 100644 --- a/src/controller/download.js +++ b/src/controller/download.js @@ -37,26 +37,31 @@ ipcMain libs.libs = libsx; if(libsx['ffmpeg'] === null || libsx['ffplay'] === null || libsx['ffprobe'] === null ){ var z = 0; - libs.download(libs.ff(process.platform),"ffmpeg",function(data,file){ - fs.createReadStream(file) - .pipe(unzip.Parse()) - .on('entry', function (entry) { - var fileName = entry.path; - var type = entry.type; // 'Directory' or 'File' - var size = entry.size; - console.log(fileName) - if (fileName === "ffmpeg-latest-win32-static/bin/ffmpeg.exe" || fileName === "ffmpeg-latest-win32-static/bin/ffprobe.exe" || fileName === "ffmpeg-latest-win32-static/bin/ffplay.exe") { - entry.pipe(fs.createWriteStream(global.dir+'/lib/'+fileName.split('/')[2])); - console.log('TEST') - z++; - if(z == 3){ - libs.checkNext('youtube-dl'); + var url = libs.ff(process.platform); + if(url === ''){ + libs.checkNext('youtube-dl'); + }else{ + libs.download(url,"ffmpeg",function(data,file){ + fs.createReadStream(file) + .pipe(unzip.Parse()) + .on('entry', function (entry) { + var fileName = entry.path; + var type = entry.type; // 'Directory' or 'File' + var size = entry.size; + console.log(fileName) + if (fileName === "ffmpeg-latest-win32-static/bin/ffmpeg.exe" || fileName === "ffmpeg-latest-win32-static/bin/ffprobe.exe" || fileName === "ffmpeg-latest-win32-static/bin/ffplay.exe") { + entry.pipe(fs.createWriteStream(global.dir+'/lib/'+fileName.split('/')[2])); + console.log('TEST') + z++; + if(z == 3){ + libs.checkNext('youtube-dl'); + } + } else { + entry.autodrain(); } - } else { - entry.autodrain(); - } - }); - }); + }); + }); + } }else{ libs.checkNext('youtube-dl'); } @@ -80,6 +85,9 @@ libs.ff = (os)=>{ case "win32": url = 'http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-latest-win32-static.zip'; break; + case "linux": + url = '' + default: } @@ -89,15 +97,19 @@ libs.yt_dl = (os,cb)=>{ var url = ""; switch (os) { case "win32": - url = 'https://yt-dl.org/downloads/2017.08.13/youtube-dl.exe' + url = 'https://yt-dl.org/downloads/2017.08.13/youtube-dl.exe'; + libs.download(url,"youtube-dl",function(data,file){ + fs.renameSync(file,global.dir+'/lib/youtube-dl.exe'); + cb(); + }) break; + case "linux": + url = '' + cb(); default: - + } - libs.download(url,"youtube-dl",function(data,file){ - fs.renameSync(file,global.dir+'/lib/youtube-dl.exe'); - cb(); - }) + } libs.download = (url,data,cb)=>{ diff --git a/src/controller/install/linux/script.js b/src/controller/install/linux/script.js new file mode 100644 index 0000000..41b1810 --- /dev/null +++ b/src/controller/install/linux/script.js @@ -0,0 +1,53 @@ +const { exec } = require('child_process'); + +var install = {}; + + + + + +install.init = (cb)=>{ + var url = [ + ['ffmpeg','https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz'], + ['youtube-dl' ,'https://yt-dl.org/downloads/latest/youtube-dl'] + ] + var download = (i)=>{ + install.download(url[i],function(path){ + switch (i) { + case 0: + shell. + break; + default: + + } + + + if(i