k.zhang 4 年之前
父節點
當前提交
952e23f821
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      apis/dyjx/url_jx.go

+ 5 - 3
apis/dyjx/url_jx.go

@@ -124,16 +124,18 @@ func DeWater(in models.DyJieXiInput) (error, models.DyJieXiOutput) {
 	fmt.Println(string(ss))
 	videoStr := string(ss)
 	//截取字符串
-	//comma := strings.Index(videoStr, "\"")
 	comma = strings.Index(videoStr, "\"")
 	pos = strings.Index(videoStr[comma+1:], "\">")
 
 	fmt.Println(videoStr[comma+1 : pos+comma+1])
-	//strings.Index(videoStr[comma:])
-	//fmt.Println(videoStr[comma:lastComma])
 	out.Data.VideoUrl = strings.Replace(videoStr[comma+1:pos+comma+1], "http", "https", 1)
 	out.Data.VideoUrl = out.Data.VideoUrl + ".mp4"
 
+	//截取
+	comma = strings.Index(out.Data.VideoUrl, "https://")
+	pos = strings.Index(out.Data.VideoUrl[comma+1:], ".com")
+	fmt.Println(out.Data.VideoUrl[comma+1 : pos+comma+1])
+
 	return nil, out
 
 }