Skip to content

Commit f6d76d8

Browse files
committed
Added size for coolmoviez
1 parent f22c070 commit f6d76d8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

engine/coolmoviez.go

+5
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ func (engine *CoolMoviez) updateDownloadProps(downloadCollector *colly.Collector
113113
downloadCollector.OnHTML("a.fileName", func(e *colly.HTMLElement) {
114114
movie := &(*movies)[getMovieIndexFromCtx(e.Request)]
115115
initialLink := e.Attr("href")
116+
re := regexp.MustCompile(`Size:\s+(.*)`)
117+
stringsub := re.FindStringSubmatch(e.Text)
118+
if len(stringsub) > 1 {
119+
movie.Size = stringsub[1]
120+
}
116121

117122
replacePrefix := "https://www.coolmoviez.buzz/file"
118123
if strings.HasPrefix(initialLink, replacePrefix) {

engine/engines.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (m *Movie) String() string {
182182

183183
// MarshalJSON Json structure to return from api
184184
func (m *Movie) MarshalJSON() ([]byte, error) {
185-
var sDownloadLink map[string]string
185+
sDownloadLink := make(map[string]string)
186186
for key, val := range m.SDownloadLink {
187187
sDownloadLink[key] = val.String()
188188
}

0 commit comments

Comments
 (0)