From a2b9a1094b8fbf4b365155e59cc88f79eb5bc593 Mon Sep 17 00:00:00 2001 From: zhaarey <157944548+zhaarey@users.noreply.github.com> Date: Wed, 21 Aug 2024 09:39:21 +0800 Subject: [PATCH] fix --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index df7432d..a92d912 100644 --- a/main.go +++ b/main.go @@ -2013,6 +2013,7 @@ func checkM3u8(b string, f string) (string, error) { conn, err := net.Dial("tcp", config.GetM3u8Port) if err != nil { fmt.Println("Error connecting to device:", err) + return "none", err } defer conn.Close() if f == "song" { @@ -2027,17 +2028,20 @@ func checkM3u8(b string, f string) (string, error) { _, err = conn.Write(lengthBuffer) if err != nil { fmt.Println("Error writing length to device:", err) + return "none", err } _, err = conn.Write(adamIDBuffer) if err != nil { fmt.Println("Error writing adamID to device:", err) + return "none", err } // Read the response (URL) from the device response, err := bufio.NewReader(conn).ReadBytes('\n') if err != nil { fmt.Println("Error reading response from device:", err) + return "none", err } // Trim any newline characters from the response