Add option to download video

Signed-off-by: Joseph Nuthalapati's avatarJoseph Nuthalapati <[email protected]>
parent e71f26f3
......@@ -16,7 +16,7 @@ only the standard library.
- [x] Play direct links from YouTube and PeerTube
- [x] Stream video from magnet links
- [x] Download music
- [ ] Download video
- [x] Download video
- [ ] Configuration options
## Installation
......
* Task list [6/11]
* Task list [7/11]
- [X] Pretty colors in terminal
- [X] Get rid of temp file or make one temp file per user
- [X] Preferences should go into a config file
- [X] Create a proper CLI
- [X] PeerTube support (only direct download, because webtorrent seeds are too slow)
- [X] Find a better name. clitube is an SEO disaster
- [X] Option to download audio/video
- [ ] Spawn video player and quit immediately
- [ ] SoundCloud support? Search and play music
- [ ] LRU cache of content so that frequently-played content doesn't use BW
- [ ] Option to download audio/video
- [ ] Better CLI using curses - select with arrows and press enter
- illwill library can be used
- see nim-mod project as an example
- illwill library can be used
- see nim-mod project as an example
......@@ -76,10 +76,20 @@ proc main() =
args.add(searchResults[number].url)
return args
func buildVideoDownloadArgs(number: int): seq[string] =
{.noSideEffect.}:
var args = @["-f", "best", "-o"]
let downloadLocation = &"'{expandTilde(videoDownloadDirectory)}/%(title)s.%(ext)s'"
args.add(downloadLocation)
args.add(searchResults[number].url)
return args
proc handleUserInput(number: int) =
if options["download"]:
if options["musicOnly"]:
download(buildMusicDownloadArgs(number), searchResults[number].title)
else:
download(buildVideoDownloadArgs(number), searchResults[number].title)
else:
play(player, buildPlayerArgs(number), searchResults[number].title)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment