X-Git-Url: https://njoseph.me/gitweb/nimcoon.git/blobdiff_plain/62e4d409fe321dff3ef519f88df839c458fcfa49..f114ff9a9ec2477cf9b8fe62283b28794d49fcab:/src/lib.nim diff --git a/src/lib.nim b/src/lib.nim index c88c4ed..4064ae4 100644 --- a/src/lib.nim +++ b/src/lib.nim @@ -82,14 +82,12 @@ proc play*(player: string, options: Table[string, bool], url: string, title: str proc directPlay*(url: string, player: string, options: Table[string, bool]) = let url = if find(url, PEERTUBE_REGEX) != -1 and "webtorrent".isInstalled: - getPeerTubeMagnetLink(url) + getPeerTubeMagnetLink(url, options["musicOnly"]) else: url 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") + discard execShellCmd(&"webtorrent '{url}' --{player} --player-args='--no-video'") else: - # WebTorrent is so much faster! discard execProcess("webtorrent", args=[url, &"--{player}"], options=processOptions) else: play(player, options, url)