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