Skip to content

Commit

Permalink
添加downloading.txt文件
Browse files Browse the repository at this point in the history
  • Loading branch information
orestonce committed Nov 15, 2023
1 parent dfdf772 commit b362a35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 10 additions & 0 deletions download.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
5 changes: 1 addition & 4 deletions m3u8d-qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b362a35

Please sign in to comment.