]>
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 |
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 | 26 | Nim Coon depends on the following: |
7d08d1af JN |
27 | - youtube-dl |
28 | - mpv (recommended) or vlc | |
52ecc638 | 29 | - peerflix (for magnet links) |
7d08d1af | 30 | |
88a5646a JN |
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 | ||
af9a966f JN |
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: | |
44978125 | 52 | |
c4aeb618 | 53 | ```sh |
af9a966f | 54 | nimble install |
c4aeb618 JN |
55 | ``` |
56 | ||
af9a966f | 57 | ### Installing binary |
44978125 | 58 | |
af9a966f | 59 | Download the latest build from GitlabCI (amd64 GNU/Linux only). |
44978125 | 60 | |
3f6de5cb | 61 | ```sh |
af9a966f JN |
62 | wget https://gitlab.com/njoseph/nimcoon/-/jobs/artifacts/master/download?job=compile -O artifacts.zip |
63 | unzip artifacts.zip | |
44978125 JN |
64 | ``` |
65 | ||
af9a966f JN |
66 | Copy the binary to somewhere on your path like /usr/local/bin |
67 | ||
3f6de5cb | 68 | ## Usage |
44978125 JN |
69 | |
70 | ```sh | |
763f653f | 71 | nimcoon "emacs" |
44978125 | 72 | |
c4aeb618 | 73 | # If your search query has multiple words, use quotes |
763f653f | 74 | nimcoon "nim lang" |
f135dfc7 | 75 | |
763f653f | 76 | # Play audio of the first search result |
3c20e75c | 77 | nimcoon -m -l "counting stars" |
763f653f JN |
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 | |
44978125 | 87 | ``` |
c4aeb618 | 88 | |
763f653f JN |
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 | |
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 |
105 | Feel free to use these options in any combination. NimCoon will show a helpful |
106 | error message if you pick incompatible options. | |
107 | ||
3f6de5cb JN |
108 | ## Development |
109 | ||
110 | One-liner for compiling and running | |
c4aeb618 JN |
111 | |
112 | ```sh | |
763f653f | 113 | nim c -d:ssl -r src/nimcoon.nim 'nim lang' |
68fd8100 | 114 | ``` |
e26cfd93 JN |
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 | ``` |