]> njoseph.me Git - nimcoon.git/commitdiff
Start replacing PeerFlix with WebTorrent
authorJoseph Nuthalapati <njoseph@riseup.net>
Tue, 2 Jun 2020 19:28:10 +0000 (00:58 +0530)
committerJoseph Nuthalapati <njoseph@riseup.net>
Tue, 2 Jun 2020 19:28:10 +0000 (00:58 +0530)
README.md
src/lib.nim

index 7af359104bc45468aaf77ed6a7a0dedb928bce8b..75adeaa3a7d9a85706a76175093e17a5d7e846c0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -26,18 +26,18 @@ only the standard library.
 Nim Coon depends on the following:
 - youtube-dl
 - mpv (recommended) or vlc
 Nim Coon depends on the following:
 - youtube-dl
 - mpv (recommended) or vlc
-- peerflix (for magnet links)
+- peerflix and webtorrent (for magnet links)
 
 
-Install VLC or MPV using your distribution's package manager.
+Install MPV or VLC using your distribution's package manager.
 
 Install YouTube-dl
 ``` sh
 pip3 install --user youtube-dl
 ```
 
 
 Install YouTube-dl
 ``` sh
 pip3 install --user youtube-dl
 ```
 
-Install PeerFlix
+Install PeerFlix and WebTorrent
 ```sh
 ```sh
-npm install --global peerflix
+npm install --global peerflix webtorrent
 ```
 
 ### Installing using Nimble
 ```
 
 ### Installing using Nimble
index 4305b2cbb1c0387cee28ce38887608d744009608..0a008b832ef556390f2d4f91dde86a6038d56aeb 100644 (file)
@@ -108,9 +108,11 @@ func sanitizeURL*(url: string): string =
 proc directPlay*(url: string, player: string, options: Table[string, bool]) =
   if url.startswith("magnet:"):
     if options["musicOnly"]:
 proc directPlay*(url: string, player: string, options: Table[string, bool]) =
   if url.startswith("magnet:"):
     if options["musicOnly"]:
+      # TODO Replace with WebTorrent once it supports media player options
       discard execShellCmd(&"peerflix '{url}' -a --{player} -- --no-video")
     else:
       discard execShellCmd(&"peerflix '{url}' -a --{player} -- --no-video")
     else:
-      discard execProcess("peerflix", args=[url, &"--{player}"], options=processOptions)
+      # WebTorrent is so much faster!
+      discard execProcess("webtorrent", args=[url, &"--{player}"], options=processOptions)
   else:
     play(player, options, url)
 
   else:
     play(player, options, url)