* 删除m3u8-impl.a

* 使用gomedia替换ffmpeg进行格式转换
main v1.3
orestonce 2022-06-20 07:47:33 +08:00
parent 8319753280
commit a2b06bb449
6 changed files with 9 additions and 6 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/cmd/m3u8d_cache.cdb /cmd/m3u8d_cache.cdb
/.idea /.idea
/bin /bin
/m3u8d-qt/m3u8d-impl.a

View File

@ -1,15 +1,16 @@
## m3u8d 一款m3u8下载工具 ## m3u8d 一款m3u8下载工具
* 提供windows图形界面(Qt), mac\linux命令行, linux支持arm和386 * 提供windows图形界面(Qt), mac\linux命令行, linux支持arm和386
* 使用ffmpeg转换格式为mp4 * 使用ffmpeg转换格式为mp4
* windows自带GUI界面的版本下载: [m3u8d_qt_v1.2_windows_amd64.exe](https://github.com/orestonce/m3u8d/releases/download/v1.2/m3u8d_qt_v1.2_windows_amd64.exe): * windows自带GUI界面的版本下载: [m3u8d_qt_v1.3_windows_amd64.exe](https://github.com/orestonce/m3u8d/releases/download/v1.2/m3u8d_qt_v1.3_windows_amd64.exe):
![](m3u8d-qt/screenshot.png) ![](m3u8d-qt/screenshot.png)
* 全部版本下载, 包括windows图形界面/linux命令行/mac命令行: https://github.com/orestonce/m3u8d/releases * 全部版本下载, 包括windows图形界面/linux命令行/mac命令行: https://github.com/orestonce/m3u8d/releases
## 实现说明 ## 实现说明
* download.go 大部分抄自 https://github.com/llychao/m3u8-downloader * download.go 大部分抄自 https://github.com/llychao/m3u8-downloader
* 将ffmpeg直接编译进windows/linux-arm/linux-386/darwin的二进制了. * <del>将ffmpeg直接编译进windows/linux-arm/linux-386/darwin的二进制了.
转换mp4时,会自动将二进制里的ffmpeg解压到系统临时目录,然后使用. 转换mp4时,会自动将二进制里的ffmpeg解压到系统临时目录,然后使用.
因此linux/mac版本的可执行文件达到了32MB, 带Qt ui的可执行文件达到了惊人的 50MB 因此linux/mac版本的可执行文件达到了32MB, 带Qt ui的可执行文件达到了惊人的 50MB</del>
* 使用 https://github.com/yapingcat/gomedia 代替ffmpeg进行格式转换
* 支持跳过前面几个ts文件(一般是广告, 嘿嘿) * 支持跳过前面几个ts文件(一般是广告, 嘿嘿)
* 程序会在下载保存目录创建: * 程序会在下载保存目录创建:
* downloading/ 目录, 用于存放正在下载的分段ts视频, 按照m3u8的url进行划分 * downloading/ 目录, 用于存放正在下载的分段ts视频, 按照m3u8的url进行划分
@ -22,10 +23,10 @@
## TODO: ## TODO:
* [x] 如果不是m3u8样子的URL自动下载html下来、搜索其中的m3u8链接进行下载 * [x] 如果不是m3u8样子的URL自动下载html下来、搜索其中的m3u8链接进行下载
* [x] windows、linux、mac都支持ffmpeg合并ts列表为mp4 * [x] windows、linux、mac都支持ffmpeg合并ts列表为mp4
* [x] 充分测试后,使用 https://github.com/yapingcat/gomedia 代替ffmpeg进行格式转换
* [ ] 支持嵌套m3u8的url * [ ] 支持嵌套m3u8的url
* [ ] 支持设置代理 * [ ] 支持设置代理
* [ ] 支持从curl命令解析出需要的header、auth-basic、cookie等信息正如 https://github.com/cxjava/m3u8-downloader 一样 * [ ] 支持从curl命令解析出需要的header、auth-basic、cookie等信息正如 https://github.com/cxjava/m3u8-downloader 一样
* [ ] 充分测试后,使用 https://github.com/yapingcat/gomedia 代替ffmpeg进行格式转换
## 二次开发操作手册: ## 二次开发操作手册:
* 如果只开发命令行版本, 则只需要修改*.go文件, 然后编译 cmd/main.go 即可 * 如果只开发命令行版本, 则只需要修改*.go文件, 然后编译 cmd/main.go 即可
* 如果涉及到Qt界面打包, 则需要运行 export/main.go 将 *.go导出为Qt界面需要的 * 如果涉及到Qt界面打包, 则需要运行 export/main.go 将 *.go导出为Qt界面需要的

View File

@ -463,13 +463,14 @@ func DrawProgressBar(total int, current int) {
proportion := float32(current) / float32(total) proportion := float32(current) / float32(total)
gProgressPercentLocker.Lock() gProgressPercentLocker.Lock()
gProgressPercent = int(proportion * 100) gProgressPercent = int(proportion * 100)
title := gProgressBarTitle
gProgressPercentLocker.Unlock() gProgressPercentLocker.Unlock()
gShowProgressBarLocker.Lock() gShowProgressBarLocker.Lock()
if gShowProgressBar { if gShowProgressBar {
width := 50 width := 50
pos := int(proportion * float32(width)) pos := int(proportion * float32(width))
fmt.Printf("[下载进度] %s%*s %6.2f%%\r", strings.Repeat("■", pos), width-pos, "", proportion*100) fmt.Printf("["+title+"] %s%*s %6.2f%%\r", strings.Repeat("■", pos), width-pos, "", proportion*100)
} }
gShowProgressBarLocker.Unlock() gShowProgressBarLocker.Unlock()
} }

View File

@ -10,7 +10,7 @@ import (
) )
func main() { func main() {
//BuildCliBinary() // 编译二进制 BuildCliBinary() // 编译二进制
CreateLibForQtUi() // 创建Qt需要使用的.a库文件 CreateLibForQtUi() // 创建Qt需要使用的.a库文件
} }

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB