diff --git a/README.md b/README.md index 5a7d6cc..6ff85e4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # M3U8-Downloader HLS Downloader,一个Electron App,可以下载、播放HLS视频流。 -![HLSDownload Show](https://github.com/HeiSir2014/M3U8-Downloader/blob/master/resource/HLSDownloadShow.gif?raw=true) +![HLSDownload Show](https://github.com/HeiSir2014/M3U8-Downloader/blob/master/resource/HLSDownloadShow-2.gif?raw=true) # 官网 [M3U8-Downloader 官网](https://tools.heisir.cn/HLSDownload) @@ -18,3 +18,31 @@ QQ交流群:341972319 目前仅编译了Windows Release. 下载地址:[Release](https://github.com/HeiSir2014/M3U8-Downloader/releases) + +# 运行源码 +### 1.NodeJS开发环境搭建 + +安装NodeJs最新版,[NodeJs Download](http://nodejs.cn/download/) + +### 2.Clone 代码 + +在任意文件夹下新建一个文件夹存放代码,并执行以下命令 +``` +cd newdir + +git clone https://github.com/HeiSir2014/M3U8-Downloader.git . +``` + +### 3.环境初始化 + +``` +npm install +``` + +### 4.运行M3U8-Downloader + +``` +npm run start2 +``` + +### 5.Enjoy it \ No newline at end of file diff --git a/css/style.css b/css/style.css index 71c1e1b..f0f38a3 100644 --- a/css/style.css +++ b/css/style.css @@ -147,7 +147,8 @@ html{ .heisir .main .TaskList{ width: 85%; height: calc(100% - 160px); - margin: 40px auto; + margin: 15px auto; + padding: 10px; overflow-y: auto; padding: 0px; border-radius: 28px; diff --git a/ffmpegTest.js b/ffmpegTest.js new file mode 100644 index 0000000..c15d503 --- /dev/null +++ b/ffmpegTest.js @@ -0,0 +1,40 @@ +"use strict"; +const ffmpeg = require('fluent-ffmpeg'); +const fs = require('fs'); +const { Readable} = require('stream'); +const path = require('path'); + + +const dir = 'E:\\Project\\my_project\\M3U8-Downloader\\source\\download\\1592447619950\\'; +let inputStream = new Readable(); +let _ffmpeg = ffmpeg(inputStream) +.setFfmpegPath('E:\\Project\\my_project\\M3U8-Downloader\\source\\ffmpeg.exe') +.videoCodec('copy') +.audioCodec('copy') +.save("E:\\Project\\my_project\\M3U8-Downloader\\source\\download\\1592447619950\\output.mp4") +.on('progress', function(info) { + console.log(info); +}) +.on('end', function() { + console.log('done processing input stream'); +}) +.on('error', function(err) { + console.log('an error happened: ' + err.message); +}); + +function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +fs.readdir(dir,function(err,files){ + for (let index = 0; index < files.length; index++) { + const file = files[index]; + if(file.endsWith(".ts")) + { + inputStream.push( fs.readFileSync(path.join(dir,file)) ); + //console.log(`file : ${index}`); + } + } + inputStream.push(null); +}); + diff --git a/index.html b/index.html index 1d429f7..afe5e12 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@
-