From: Joseph Nuthalapati Date: Mon, 23 Dec 2019 13:47:22 +0000 (+0530) Subject: Stream magnet links using peerflix X-Git-Tag: 0.1.0~36 X-Git-Url: https://njoseph.me/gitweb/nimcoon.git/commitdiff_plain/52ecc638d90fa3f2ee52a538f3950b4253de7a28 Stream magnet links using peerflix Signed-off-by: Joseph Nuthalapati --- diff --git a/README.md b/README.md index 3930178..e2174f3 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ only the standard library. - [x] Search for videos using keywords - [x] Stream videos - [x] Stream music +- [x] Play direct links from YouTube and PeerTube +- [x] Stream video from magnet links - [ ] Download video - [ ] Download music - [ ] Configuration options @@ -23,6 +25,7 @@ only the standard library. CLI Tube depends on the following: - youtube-dl - mpv (recommended) or vlc +- peerflix (for magnet links) Download the latest build from GitlabCI (amd64 GNU/Linux only). diff --git a/clitube.nim b/clitube.nim index cc35448..1c30b92 100644 --- a/clitube.nim +++ b/clitube.nim @@ -61,6 +61,11 @@ if "?watch" in searchQuery or "videos/watch" in searchQuery : quit(0) +if searchQuery.startswith("magnet:"): + discard execProcess(&"peerflix \"{searchQuery}\" --{player}") + quit(0) + + let searchResults = extractTitlesAndUrls(getYoutubePage(searchQuery)) let number =