mirror of
https://github.com/zhaarey/apple-music-downloader.git
synced 2025-10-23 15:11:05 +00:00
fix
This commit is contained in:
4
main.go
4
main.go
@@ -2013,6 +2013,7 @@ func checkM3u8(b string, f string) (string, error) {
|
|||||||
conn, err := net.Dial("tcp", config.GetM3u8Port)
|
conn, err := net.Dial("tcp", config.GetM3u8Port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error connecting to device:", err)
|
fmt.Println("Error connecting to device:", err)
|
||||||
|
return "none", err
|
||||||
}
|
}
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
if f == "song" {
|
if f == "song" {
|
||||||
@@ -2027,17 +2028,20 @@ func checkM3u8(b string, f string) (string, error) {
|
|||||||
_, err = conn.Write(lengthBuffer)
|
_, err = conn.Write(lengthBuffer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error writing length to device:", err)
|
fmt.Println("Error writing length to device:", err)
|
||||||
|
return "none", err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = conn.Write(adamIDBuffer)
|
_, err = conn.Write(adamIDBuffer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error writing adamID to device:", err)
|
fmt.Println("Error writing adamID to device:", err)
|
||||||
|
return "none", err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the response (URL) from the device
|
// Read the response (URL) from the device
|
||||||
response, err := bufio.NewReader(conn).ReadBytes('\n')
|
response, err := bufio.NewReader(conn).ReadBytes('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error reading response from device:", err)
|
fmt.Println("Error reading response from device:", err)
|
||||||
|
return "none", err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trim any newline characters from the response
|
// Trim any newline characters from the response
|
||||||
|
|||||||
Reference in New Issue
Block a user