Skip to content

Commit

Permalink
Check length before obtaining upload date
Browse files Browse the repository at this point in the history
  • Loading branch information
deven96 committed Jun 7, 2020
1 parent 8d4881c commit de33151
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion engine/fzmovies.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ func (engine *FzEngine) parseSingleMovie(el *colly.HTMLElement, index int) (Movi
}
movie.CoverPhotoLink = cover.String()
// Remove all Video: or Movie: Prefixes
movie.UploadDate = strings.TrimSpace(el.ChildTexts("small")[1])
if len(el.ChildTexts("small")) >= 2 {
movie.UploadDate = strings.TrimSpace(el.ChildTexts("small")[1])
}
movie.Title = strings.TrimSuffix(strings.TrimSpace(el.ChildText("b")), "<more>")
if len(el.ChildTexts("small")) > 3 {
movie.Description = strings.TrimSpace(el.ChildTexts("small")[3])
Expand Down

0 comments on commit de33151

Please sign in to comment.