You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
392 B
21 lines
392 B
package kuaishou
|
|
|
|
import "regexp"
|
|
|
|
func (app *App) ExtractVideoLink(content string) string {
|
|
|
|
//解析正则表达式,如果成功返回解释器
|
|
reg := regexp.MustCompile(`"srcNoMark":"(.*?)"`)
|
|
|
|
//根据规则提取关键信息
|
|
result := reg.FindAllStringSubmatch(content, -1)
|
|
var videoLink string
|
|
|
|
if len(result) > 0 {
|
|
videoLink = result[0][1]
|
|
return videoLink
|
|
}
|
|
|
|
return ""
|
|
}
|