-proc extractTitlesAndUrls*(html: string): seq[SearchResult] =
- parseHtml(html).findAll("a").
- filter(a => "watch" in a.attrs["href"] and a.attrs.hasKey "title").
- map(a => (a.attrs["title"], "https://www.youtube.com" & a.attrs["href"]))[..(limit-1)]
+func extractTitlesAndUrls*(html: string): seq[SearchResult] =
+ {.noSideEffect.}:
+ parseHtml(html).findAll("a").
+ filter(a => "watch" in a.attrs["href"] and a.attrs.hasKey "title").
+ map(a => (a.attrs["title"], "https://www.youtube.com" & a.attrs["href"]))[..(limit-1)]