]> njoseph.me Git - nimcoon.git/commitdiff
Allow http urls to .torrent files to be streamed
authorJoseph Nuthalapati <njoseph@riseup.net>
Thu, 4 Jun 2020 18:04:21 +0000 (23:34 +0530)
committerJoseph Nuthalapati <njoseph@riseup.net>
Thu, 4 Jun 2020 18:07:15 +0000 (23:37 +0530)
README.md
src/lib.nim

index 75adeaa3a7d9a85706a76175093e17a5d7e846c0..296850299b870029c5a9a36de4e935dfe3517e0d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ only the standard library.
 - [x] Search for videos using keywords
 - [x] Stream videos and music from YouTube
 - [x] Play direct links from YouTube and PeerTube
-- [x] Stream video and music from magnet links
+- [x] Stream video and music from magnet links and hyperlinks to torrent files
 - [x] Download music
 - [x] Download video
 - [x] Play playlists (MPV only)
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")