From 52ecc638d90fa3f2ee52a538f3950b4253de7a28 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Mon, 23 Dec 2019 19:17:22 +0530 Subject: [PATCH] Stream magnet links using peerflix Signed-off-by: Joseph Nuthalapati --- README.md | 3 +++ clitube.nim | 5 +++++ 2 files changed, 8 insertions(+) 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 = -- 2.43.0