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