From ba7530026d3538ea104880badbec19be7c7ae9a5 Mon Sep 17 00:00:00 2001 From: qydysky Date: Sat, 10 Oct 2020 09:02:46 +0800 Subject: [PATCH] =?utf8?q?=E7=9B=B4=E6=92=AD=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?utf8?q?=E5=A4=87=E9=93=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/F.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Reply/F.go b/Reply/F.go index c04c8b5..8d4a797 100644 --- a/Reply/F.go +++ b/Reply/F.go @@ -256,8 +256,9 @@ func Saveflvf(){ l := p.Logf().New().Open("danmu.log").Base(-1, "saveflv") + cuLinkIndex := 0 api := F.New_api(c.Roomid) - for api.Get_live(saveflv.qn).Live_status == 1 { + for api.Get_live(saveflv.qn).Live_status == 1 && !saveflv.cancel.Islive() { c.Live = api.Live saveflv.path = strconv.Itoa(c.Roomid) + "_" + time.Now().Format("2006_01_02_15:04:05.000") @@ -285,7 +286,7 @@ func Saveflvf(){ retry := 20 for retry > 0 && rr.ResponseCode != 200 { if e := rr.Reqf(p.Rval{ - Url:c.Live[0], + Url:c.Live[cuLinkIndex], Retry:10, SleepTime:5, Cookie:Cookie, @@ -299,6 +300,8 @@ func Saveflvf(){ p.Sys().Timeoutf(5) saveflv.wait.Done() saveflv.cancel.Done() + cuLinkIndex += 1 + if cuLinkIndex >= len(c.Live) {cuLinkIndex = 0} continue } } @@ -307,7 +310,7 @@ func Saveflvf(){ l.I("保存到", saveflv.path + ".flv") if e := rr.Reqf(p.Rval{ - Url:c.Live[0], + Url:c.Live[cuLinkIndex], Retry:10, SleepTime:5, Cookie:Cookie, -- 2.39.2