]> njoseph.me Git - nimcoon.git/blame - README.md
Use aria2c download manager if available
[nimcoon.git] / README.md
CommitLineData
f7735b43 1# NimCoon
726cf1a7 2
3e3ba843 3Play videos from YouTube and PeerTube from the
44978125
JN
4command line using your preferred desktop media player.
5
a6c167a7
JN
6This application is implemented in [Nim language](https://nim-lang.org) using
7only the standard library.
8
3c20e75c 9![nimcoon screenshot with search term 'baby yoda'](screenshot.png)
44978125
JN
10
11## Features
12
13- [x] Search for videos using keywords
763f653f 14- [x] Stream videos and music from YouTube
52ecc638 15- [x] Play direct links from YouTube and PeerTube
d7688e97 16- [x] Stream video and music from magnet links and hyperlinks to torrent files
e9f0c7d0 17- [x] Download music
d2ebe4d2 18- [x] Download video
d36e2201
JN
19- [x] Play playlists (MPV only)
20- [ ] Download playlists
c12cc641
JN
21- [x] Stream video from torrent file URLs
22- [x] BitTorrent is preferred for PeerTube video links
23- [ ] Search PeerTube (3.0 or later)
d36e2201 24- [ ] Autoplay next video/audio
44978125
JN
25- [ ] Configuration options
26
3f6de5cb 27## Installation
44978125 28
3c20e75c 29Nim Coon depends on the following:
7d08d1af
JN
30- youtube-dl
31- mpv (recommended) or vlc
8d06ad69 32- peerflix and webtorrent (for magnet links)
7d08d1af 33
8d06ad69 34Install MPV or VLC using your distribution's package manager.
88a5646a
JN
35
36Install YouTube-dl
37``` sh
38pip3 install --user youtube-dl
39```
40
8d06ad69 41Install PeerFlix and WebTorrent
88a5646a 42```sh
0c2f0385 43npm install --global peerflix webtorrent-cli
88a5646a
JN
44```
45
0c2f0385
JN
46(Optional) If you want your YouTube downloads to be faster, install `aria2` download manager.
47
af9a966f
JN
48### Installing using Nimble
49
50NimCoon can be installed from Nimble repositories:
51
52``` sh
53nimble install nimcoon
54```
55
56You can also install from source by running the following command:
44978125 57
c4aeb618 58```sh
af9a966f 59nimble install
c4aeb618
JN
60```
61
af9a966f 62### Installing binary
44978125 63
af9a966f 64Download the latest build from GitlabCI (amd64 GNU/Linux only).
44978125 65
3f6de5cb 66```sh
af9a966f
JN
67wget https://gitlab.com/njoseph/nimcoon/-/jobs/artifacts/master/download?job=compile -O artifacts.zip
68unzip artifacts.zip
44978125
JN
69```
70
af9a966f
JN
71Copy the binary to somewhere on your path like /usr/local/bin
72
3f6de5cb 73## Usage
44978125
JN
74
75```sh
763f653f 76nimcoon "emacs"
44978125 77
c4aeb618 78# If your search query has multiple words, use quotes
763f653f 79nimcoon "nim lang"
f135dfc7 80
763f653f 81# Play audio of the first search result
3c20e75c 82nimcoon -m -l "counting stars"
763f653f
JN
83
84# Download audio of the first search result
85nimcoon -mld "counting stars"
86
87# Play direct video link
88nimcoon https://www.youtube.com/watch?v=QOEMv0S8AcA
89
90# Add -d to download or -m to select only audio or both
91nimcoon -md https://www.youtube.com/watch?v=hT_nvWreIhg
44978125 92```
c4aeb618 93
763f653f
JN
94After the search results are displayed, you can enter a number to play one
95result, "all" to play all the results or "q" to quit the program.
96
97If a number is entered, after the selected search result is played, the results
98are redisplayed, so that you can play the other results without having to search
99again.
100
101### Command line arguments
4827df7a 102
3c20e75c
JN
103| **Arguments** | **Explanation** |
104|-------------------|--------------------------------------------|
105| -m, --music | Play Music only, no video |
106| -l, --lucky | Try your luck with the first search result |
107| -f, --full-screen | Play video in full screen |
e9f0c7d0 108| -d, --download | Download video or music |
4827df7a 109
763f653f
JN
110Feel free to use these options in any combination. NimCoon will show a helpful
111error message if you pick incompatible options.
112
3f6de5cb
JN
113## Development
114
115One-liner for compiling and running
c4aeb618
JN
116
117```sh
763f653f 118nim c -d:ssl -r src/nimcoon.nim 'nim lang'
68fd8100 119```
e26cfd93
JN
120
121## Privacy
122
123To avoid storing your nimcoon searches in `zsh` history, run this command
124
125```sh
126setopt histignorespace
127```
128
129Then, add a space before typing nimcoon in the shell, like " nimcoon"
130
131```sh
132 nimcoon "this is private"
133```
134
135The same can be achieved in `bash` by setting an environment variable
136```sh
137export HISTCONTROL=ignoreboth
138```