|
@@ -43,6 +43,7 @@ func DouYinUrlJieXi(c *gin.Context) {
|
|
|
func DeWater(in models.DyJieXiInput) (error, models.DyJieXiOutput) {
|
|
|
var out models.DyJieXiOutput
|
|
|
var dysy mysql.DysyUrlInfo
|
|
|
+ var p []byte
|
|
|
//fmt.Println("test")
|
|
|
str := ""
|
|
|
baseHost := in.Url
|
|
@@ -56,8 +57,10 @@ func DeWater(in models.DyJieXiInput) (error, models.DyJieXiOutput) {
|
|
|
if err != nil {
|
|
|
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))
|
|
|
|
|
|
comma := strings.Index(str, "/video/")
|
|
|
pos := strings.Index(str, "/?")
|
|
@@ -118,6 +121,16 @@ func DeWater(in models.DyJieXiInput) (error, models.DyJieXiOutput) {
|
|
|
dysy.CreateTime = tools.GetCurrntTimeStr()
|
|
|
dysy.Create(dysy.DeWaterVideoURL)
|
|
|
|
|
|
+ fmt.Println("out.Data.VideoUrl = ", out.Data.VideoUrl)
|
|
|
+ //打开视频连接
|
|
|
+ reqq := requests.Requests()
|
|
|
+
|
|
|
+ resp, err = reqq.Post(out.Data.VideoUrl)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("err =", err.Error())
|
|
|
+ }
|
|
|
+ //fmt.Println("resp = ", resp.Text())
|
|
|
+
|
|
|
return nil, out
|
|
|
|
|
|
}
|