]> njoseph.me Git - nimcoon.git/blobdiff - lib.nim
Add option to play "all" the search results
[nimcoon.git] / lib.nim
diff --git a/lib.nim b/lib.nim
index de088b403d679784de4b993e0a828af2917434bc..893422ecec8138285d2ea1051f28b8ed6f468a30 100644 (file)
--- a/lib.nim
+++ b/lib.nim
@@ -35,7 +35,7 @@ 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)]
+      map(a => (a.attrs["title"], "https://www.youtube.com" & a.attrs["href"]))
 
 proc presentVideoOptions*(searchResults: seq[SearchResult]) =
   echo ""
@@ -45,7 +45,6 @@ proc presentVideoOptions*(searchResults: seq[SearchResult]) =
 proc play*(player: string, args: openArray[string]) =
   # poEchoCmd can be added to options for debugging
   discard execProcess(player, args=args, options={poStdErrToStdOut, poUsePath})
-  quit(0)
 
 func urlLongen(url: string): string =
   url.replace("youtu.be/", "www.youtube.com/watch?v=")