k.zhang 4 years ago
parent
commit
e42122737f
1 changed files with 7 additions and 1 deletions
  1. 7 1
      apis/dyjx/url_jx.go

+ 7 - 1
apis/dyjx/url_jx.go

@@ -56,12 +56,15 @@ func DeWater(in models.DyJieXiInput) (error, models.DyJieXiOutput) {
 
 	res, err := client.Get(baseHost)
 	if err != nil {
+		fmt.Print(err.Error())
 		return errors.New(apis.ClientGetFail), out
 	}
+
 	n, err := res.Body.Read(p)
 	fmt.Println("n=", n)
 	str = res.Header.Get("Location")
-	//fmt.Println("res.Body = ", string(p))
+	fmt.Println("res.Body = ", string(p))
+	fmt.Print("str = ", str)
 
 	comma := strings.Index(str, "/video/")
 	pos := strings.Index(str, "/?")
@@ -116,8 +119,11 @@ func DeWater(in models.DyJieXiInput) (error, models.DyJieXiOutput) {
 	}
 	//client.Head()
 
+	return nil, out
+
 	res1, err := client1.Get(out.Data.VideoUrl)
 	if err != nil {
+		fmt.Print(err.Error())
 		return errors.New(apis.ClientGetFail), out
 	}
 	ss, err := ioutil.ReadAll(res1.Body)