]> njoseph.me Git - nimcoon.git/blame - README.md
Start replacing PeerFlix with WebTorrent
[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
763f653f 16- [x] Stream video and music from magnet links
e9f0c7d0 17- [x] Download music
d2ebe4d2 18- [x] Download video
d36e2201
JN
19- [x] Play playlists (MPV only)
20- [ ] Download playlists
21- [ ] Autoplay next video/audio
44978125
JN
22- [ ] Configuration options
23
3f6de5cb 24## Installation
44978125 25
3c20e75c 26Nim Coon depends on the following:
7d08d1af
JN
27- youtube-dl
28- mpv (recommended) or vlc
8d06ad69 29- peerflix and webtorrent (for magnet links)
7d08d1af 30
8d06ad69 31Install MPV or VLC using your distribution's package manager.
88a5646a
JN
32
33Install YouTube-dl
34``` sh
35pip3 install --user youtube-dl
36```
37
8d06ad69 38Install PeerFlix and WebTorrent
88a5646a 39```sh
8d06ad69 40npm install --global peerflix webtorrent
88a5646a
JN
41```
42
af9a966f
JN
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:
44978125 52
c4aeb618 53```sh
af9a966f 54nimble install
c4aeb618
JN
55```
56
af9a966f 57### Installing binary
44978125 58
af9a966f 59Download the latest build from GitlabCI (amd64 GNU/Linux only).
44978125 60
3f6de5cb 61```sh
af9a966f
JN
62wget https://gitlab.com/njoseph/nimcoon/-/jobs/artifacts/master/download?job=compile -O artifacts.zip
63unzip artifacts.zip
44978125
JN
64```
65
af9a966f
JN
66Copy the binary to somewhere on your path like /usr/local/bin
67
3f6de5cb 68## Usage
44978125
JN
69
70```sh
763f653f 71nimcoon "emacs"
44978125 72
c4aeb618 73# If your search query has multiple words, use quotes
763f653f 74nimcoon "nim lang"
f135dfc7 75
763f653f 76# Play audio of the first search result
3c20e75c 77nimcoon -m -l "counting stars"
763f653f
JN
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
44978125 87```
c4aeb618 88
763f653f
JN
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
4827df7a 97
3c20e75c
JN
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 |
e9f0c7d0 103| -d, --download | Download video or music |
4827df7a 104
763f653f
JN
105Feel free to use these options in any combination. NimCoon will show a helpful
106error message if you pick incompatible options.
107
3f6de5cb
JN
108## Development
109
110One-liner for compiling and running
c4aeb618
JN
111
112```sh
763f653f 113nim c -d:ssl -r src/nimcoon.nim 'nim lang'
68fd8100 114```
e26cfd93
JN
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```