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").
{.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 ""
proc presentVideoOptions*(searchResults: seq[SearchResult]) =
echo ""
import lib
proc parseOptions(): CommandLineOptions =
import lib
proc parseOptions(): CommandLineOptions =
proc getUserInput(): string =
if feelingLucky: "0"
else:
proc getUserInput(): string =
if feelingLucky: "0"
else:
- presentVideoOptions(searchResults)
+ presentVideoOptions(searchResults[..(limit-1)])
stdout.styledWrite(fgYellow, "Choose video number: ")
readLine(stdin)
stdout.styledWrite(fgYellow, "Choose video number: ")
readLine(stdin)
while(true):
let userInput = getUserInput()
while(true):
let userInput = getUserInput()
+
+ if userInput == "all":
+ for number in 0..(len(searchResults)):
+ play(player, buildArgs(number))
+
if userInput == "q":
break
if userInput == "q":
break