Add additional guard for directPlay
authorJoseph Nuthalapati <njoseph@riseup.net>
Wed, 25 Dec 2019 15:27:28 +0000 (20:57 +0530)
committerJoseph Nuthalapati <njoseph@riseup.net>
Wed, 25 Dec 2019 15:27:28 +0000 (20:57 +0530)
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
clitube.nim

index e2ddffa0ec5f646db81ecb6576c8caea5e992155..9e73275dcb32806f34105c3331c30857bfd74eb6 100644 (file)
@@ -81,7 +81,8 @@ proc main() =
     player = selectMediaPlayer()
     (searchQuery, musicOnly, feelingLucky) = parseOptions()
 
-  directPlay(searchQuery, player)
+  if searchQuery.startswith("https:") or searchQuery.startswith("magnet:"):
+    directPlay(searchQuery, player)
 
   let searchResults = extractTitlesAndUrls(getYoutubePage(searchQuery))