]>
Commit | Line | Data |
---|---|---|
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 | |
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 | ||
26 | Nim Coon depends on the following: | |
27 | - youtube-dl | |
28 | - mpv (recommended) or vlc | |
29 | - peerflix (for magnet links) | |
30 | ||
31 | Install VLC or MPV using your distribution's package manager. | |
32 | ||
33 | Install YouTube-dl | |
34 | ``` sh | |
35 | pip3 install --user youtube-dl | |
36 | ``` | |
37 | ||
38 | Install PeerFlix | |
39 | ```sh | |
40 | npm install --global peerflix | |
41 | ``` | |
42 | ||
43 | ### Installing using Nimble | |
44 | ||
45 | NimCoon can be installed from Nimble repositories: | |
46 | ||
47 | ``` sh | |
48 | nimble install nimcoon | |
49 | ``` | |
50 | ||
51 | You can also install from source by running the following command: | |
52 | ||
53 | ```sh | |
54 | nimble install | |
55 | ``` | |
56 | ||
57 | ### Installing binary | |
58 | ||
59 | Download the latest build from GitlabCI (amd64 GNU/Linux only). | |
60 | ||
61 | ```sh | |
62 | wget https://gitlab.com/njoseph/nimcoon/-/jobs/artifacts/master/download?job=compile -O artifacts.zip | |
63 | unzip artifacts.zip | |
64 | ``` | |
65 | ||
66 | Copy the binary to somewhere on your path like /usr/local/bin | |
67 | ||
68 | ## Usage | |
69 | ||
70 | ```sh | |
71 | nimcoon "emacs" | |
72 | ||
73 | # If your search query has multiple words, use quotes | |
74 | nimcoon "nim lang" | |
75 | ||
76 | # Play audio of the first search result | |
77 | nimcoon -m -l "counting stars" | |
78 | ||
79 | # Download audio of the first search result | |
80 | nimcoon -mld "counting stars" | |
81 | ||
82 | # Play direct video link | |
83 | nimcoon https://www.youtube.com/watch?v=QOEMv0S8AcA | |
84 | ||
85 | # Add -d to download or -m to select only audio or both | |
86 | nimcoon -md https://www.youtube.com/watch?v=hT_nvWreIhg | |
87 | ``` | |
88 | ||
89 | After the search results are displayed, you can enter a number to play one | |
90 | result, "all" to play all the results or "q" to quit the program. | |
91 | ||
92 | If a number is entered, after the selected search result is played, the results | |
93 | are redisplayed, so that you can play the other results without having to search | |
94 | again. | |
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 | ||
105 | Feel free to use these options in any combination. NimCoon will show a helpful | |
106 | error message if you pick incompatible options. | |
107 | ||
108 | ## Development | |
109 | ||
110 | One-liner for compiling and running | |
111 | ||
112 | ```sh | |
113 | nim c -d:ssl -r src/nimcoon.nim 'nim lang' | |
114 | ``` | |
115 | ||
116 | ## Privacy | |
117 | ||
118 | To avoid storing your nimcoon searches in `zsh` history, run this command | |
119 | ||
120 | ```sh | |
121 | setopt histignorespace | |
122 | ``` | |
123 | ||
124 | Then, add a space before typing nimcoon in the shell, like " nimcoon" | |
125 | ||
126 | ```sh | |
127 | nimcoon "this is private" | |
128 | ``` | |
129 | ||
130 | The same can be achieved in `bash` by setting an environment variable | |
131 | ```sh | |
132 | export HISTCONTROL=ignoreboth | |
133 | ``` |