Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
{.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 ""
std/[terminal],
strutils
+import config
import lib
proc parseOptions(): CommandLineOptions =
proc getUserInput(): string =
if feelingLucky: "0"
else:
- presentVideoOptions(searchResults)
+ presentVideoOptions(searchResults[..(limit-1)])
stdout.styledWrite(fgYellow, "Choose video number: ")
readLine(stdin)
while(true):
let userInput = getUserInput()
+
+ if userInput == "all":
+ for number in 0..(len(searchResults)):
+ play(player, buildArgs(number))
+
if userInput == "q":
break