Alternative download ETA string

This commit is contained in:
Justin Hawkins 2022-04-09 17:46:03 +09:30
parent 9d3f54d2ee
commit 15ee200615
2 changed files with 10 additions and 1 deletions

View File

@ -266,7 +266,8 @@ func (dl *Download) updateMetadata(s string) {
defer dl.mutex.Unlock()
// [download] 49.7% of ~15.72MiB at 5.83MiB/s ETA 00:07
etaRE := regexp.MustCompile(`download.+ETA +(\d\d:\d\d(?::\d\d)?)$`)
// [download] 99.3% of ~1.42GiB at 320.87KiB/s ETA 00:07 (frag 212/214)
etaRE := regexp.MustCompile(`download.+ETA +(\d\d:\d\d(?::\d\d)?)`)
matches := etaRE.FindStringSubmatch(s)
if len(matches) == 2 {
dl.Eta = matches[1]

View File

@ -40,6 +40,14 @@ func TestUpdateMetadata(t *testing.T) {
t.Fatalf("%v", newD.Files)
}
// different download
newD.updateMetadata("[download] 99.3% of ~1.42GiB at 320.87KiB/s ETA 00:07 (frag 212/214)")
if newD.Eta != "00:07" {
t.Fatalf("bad short eta in dl with frag\n%v", newD)
}
// [FixupM3u8] Fixing MPEG-TS in MP4 container of "file [-168849776_456239489].mp4"
// deletes
// TODO. Not sure why I don't always see the "Deleting original file" messages after merge -
// maybe a youtube-dl fork thing?