]> njoseph.me Git - nimcoon.git/blobdiff - src/lib.nim
Allow http urls to .torrent files to be streamed
[nimcoon.git] / src / lib.nim
index 0a008b832ef556390f2d4f91dde86a6038d56aeb..24aa9305218c02a599af07e93eeb223589b0e071 100644 (file)
@@ -106,7 +106,7 @@ func sanitizeURL*(url: string): string =
   urlLongen(stripZshEscaping(url))
 
 proc directPlay*(url: string, player: string, options: Table[string, bool]) =
-  if url.startswith("magnet:"):
+  if url.startswith("magnet:") or url.endswith(".torrent"):
     if options["musicOnly"]:
       # TODO Replace with WebTorrent once it supports media player options
       discard execShellCmd(&"peerflix '{url}' -a --{player} -- --no-video")