|
@@ -6,6 +6,7 @@ import (
|
|
"io"
|
|
"io"
|
|
"log"
|
|
"log"
|
|
"net/http"
|
|
"net/http"
|
|
|
|
+ "net/url"
|
|
"os"
|
|
"os"
|
|
"strings"
|
|
"strings"
|
|
|
|
|
|
@@ -51,8 +52,10 @@ func msgProccess(msg map[string]interface{}, connBot api.WsBot) {
|
|
fmt.Println("http://" + os.Getenv("HOST") + ":" + os.Getenv("BVDLPORT") + "/api/download?bv=" + bv + "&title=" + title)
|
|
fmt.Println("http://" + os.Getenv("HOST") + ":" + os.Getenv("BVDLPORT") + "/api/download?bv=" + bv + "&title=" + title)
|
|
// result, err := http.PostForm("http://"+os.Getenv("HOST")+":"+os.Getenv("BVDLPORT")+"/api/download?bv="+bv+"&title="+title, nil)
|
|
// result, err := http.PostForm("http://"+os.Getenv("HOST")+":"+os.Getenv("BVDLPORT")+"/api/download?bv="+bv+"&title="+title, nil)
|
|
|
|
|
|
- url := "http://" + os.Getenv("HOST") + ":" + os.Getenv("BVDLPORT") + "/api/download?bv=" + bv + "&title=" + title
|
|
|
|
- result, err := http.Get(url)
|
|
|
|
|
|
+ qbv := url.QueryEscape(bv)
|
|
|
|
+ qtitle := url.QueryEscape(title)
|
|
|
|
+ geturl := "http://" + os.Getenv("HOST") + ":" + os.Getenv("BVDLPORT") + "/api/download?bv=" + qbv + "&title=" + qtitle
|
|
|
|
+ result, err := http.Get(geturl)
|
|
|
|
|
|
// url := "http://" + os.Getenv("HOST") + ":" + os.Getenv("BVDLPORT") + "/api/download"
|
|
// url := "http://" + os.Getenv("HOST") + ":" + os.Getenv("BVDLPORT") + "/api/download"
|
|
// body := fmt.Sprintf(`{"bv":"%s","title":"%s"}`, bv, title)
|
|
// body := fmt.Sprintf(`{"bv":"%s","title":"%s"}`, bv, title)
|
|
@@ -62,7 +65,7 @@ func msgProccess(msg map[string]interface{}, connBot api.WsBot) {
|
|
connBot.Send_private_msg(user_id, "下载失败")
|
|
connBot.Send_private_msg(user_id, "下载失败")
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
} else {
|
|
} else {
|
|
- fmt.Print(result)
|
|
|
|
|
|
+ fmt.Print(result.Body)
|
|
connBot.Send_private_msg(user_id, title)
|
|
connBot.Send_private_msg(user_id, title)
|
|
}
|
|
}
|
|
|
|
|