Exemple #1
0
func getVideoUrl(str, resolution dna.String) *VideoUrl {
	su := NewVideoUrl()
	su.Resolution = resolution
	su.Type = getType(str)
	su.Link = str.GetTagAttributes("href").ReplaceWithRegexp(`(http.+/).+(\..+$)`, "${1}file-name${2}")
	size := str.FindAllString(`[0-9\.]+ MB`, -1)
	if size.Length() > 0 {
		su.Size = size[0].ParseBytesFormat() / 1000
	}
	return su

}