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