diff --git a/download.go b/download.go index bf7af14..eb07902 100644 --- a/download.go +++ b/download.go @@ -182,6 +182,16 @@ func (this *downloadEnv) RunDownload(req RunDownload_Req) (resp RunDownload_Resp return resp } } + + downloadingFilePath := filepath.Join(downloadDir, "downloading.txt") + if !isFileExists(downloadingFilePath) { + err = ioutil.WriteFile(downloadingFilePath, []byte(req.M3u8Url), 0666) + if err != nil { + resp.ErrMsg = "os.WriteUrl error: " + err.Error() + return resp + } + } + beginSeq := parseBeginSeq(m3u8Body) // 获取m3u8地址的内容体 encInfo, err := this.getEncryptInfo(req.M3u8Url, string(m3u8Body)) diff --git a/m3u8d-qt/mainwindow.cpp b/m3u8d-qt/mainwindow.cpp index 3b32737..a10eda8 100644 --- a/m3u8d-qt/mainwindow.cpp +++ b/m3u8d-qt/mainwindow.cpp @@ -20,12 +20,9 @@ MainWindow::MainWindow(QWidget *parent) : ui->lineEdit_SkipTsCountFromHead->setPlaceholderText("[0,9999]"); ui->lineEdit_SaveDir->setPlaceholderText(QString::fromStdString(GetWd())); m_syncUi.AddRunFnOn_OtherThread([this](){ - while(true) + while(!this->m_syncUi.Get_Done()) { QThread::msleep(50); - if (this->m_syncUi.Get_Done()) { - break; - } m_syncUi.AddRunFnOn_UiThread([this](){ GetProgress_Resp resp = GetProgress(); ui->progressBar->setValue(resp.Percent);