e4782eb49844266175f4e90dea8f4fba5d493beb
[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
17 - [x] Download music
18 - [x] Download video
19 - [ ] Configuration options
20
21 ## Installation
22
23 Nim Coon depends on the following:
24 - youtube-dl
25 - mpv (recommended) or vlc
26 - peerflix (for magnet links)
27
28 ### Installing using Nimble
29
30 NimCoon can be installed from Nimble repositories:
31
32 ``` sh
33 nimble install nimcoon
34 ```
35
36 You can also install from source by running the following command:
37
38 ```sh
39 nimble install
40 ```
41
42 ### Installing binary
43
44 Download the latest build from GitlabCI (amd64 GNU/Linux only).
45
46 ```sh
47 wget https://gitlab.com/njoseph/nimcoon/-/jobs/artifacts/master/download?job=compile -O artifacts.zip
48 unzip artifacts.zip
49 ```
50
51 Copy the binary to somewhere on your path like /usr/local/bin
52
53 ## Usage
54
55 ```sh
56 nimcoon "emacs"
57
58 # If your search query has multiple words, use quotes
59 nimcoon "nim lang"
60
61 # Play audio of the first search result
62 nimcoon -m -l "counting stars"
63
64 # Download audio of the first search result
65 nimcoon -mld "counting stars"
66
67 # Play direct video link
68 nimcoon https://www.youtube.com/watch?v=QOEMv0S8AcA
69
70 # Add -d to download or -m to select only audio or both
71 nimcoon -md https://www.youtube.com/watch?v=hT_nvWreIhg
72 ```
73
74 After the search results are displayed, you can enter a number to play one
75 result, "all" to play all the results or "q" to quit the program.
76
77 If a number is entered, after the selected search result is played, the results
78 are redisplayed, so that you can play the other results without having to search
79 again.
80
81 ### Command line arguments
82
83 | **Arguments** | **Explanation** |
84 |-------------------|--------------------------------------------|
85 | -m, --music | Play Music only, no video |
86 | -l, --lucky | Try your luck with the first search result |
87 | -f, --full-screen | Play video in full screen |
88 | -d, --download | Download video or music |
89
90 Feel free to use these options in any combination. NimCoon will show a helpful
91 error message if you pick incompatible options.
92
93 ## Development
94
95 One-liner for compiling and running
96
97 ```sh
98 nim c -d:ssl -r src/nimcoon.nim 'nim lang'
99 ```