X-Git-Url: http://njoseph.me/gitweb/nimcoon.git/blobdiff_plain/d09270c390b7c8d2c6cc25f3f1a416b43c8c3387..6697cfd20fbad109b18302ab0bb2c094bfdc4b5c:/src/nimcoon.nim diff --git a/src/nimcoon.nim b/src/nimcoon.nim index 9df18a8..1fd3ba6 100644 --- a/src/nimcoon.nim +++ b/src/nimcoon.nim @@ -55,13 +55,19 @@ proc main() = if searchQuery.startswith("http") or searchQuery.startswith("magnet"): if options["download"]: - directDownload(sanitizeURL(searchQuery), options["musicOnly"]) + directDownload(sanitizeURL(searchQuery), options) else: directPlay(sanitizeURL(searchQuery), player, options) quit(0) + # Take a shortcut and search directly with youtube-dl + if options["feelingLucky"]: + if options["download"]: luckyDownload(searchQuery, options) + else: luckyPlay(searchQuery, player, options) + quit(0) + let searchResults = getSearchResults(searchQuery) - if options["nonInteractive"]: + if options["nonInteractive"]: # Present in machine-readable format for index, (title, url) in searchResults: echo title echo url