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