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