]> njoseph.me Git - nimcoon.git/blobdiff - src/nimcoon.nim
Support http in addition to https
[nimcoon.git] / src / nimcoon.nim
index 20b9280c54d990af5889176440d7ca1417842949..3844d4095de6f043349f9527d586948f89420221 100644 (file)
@@ -31,11 +31,11 @@ proc parseArguments(): CommandLineOptions =
 proc isValidOptions*(options: Options): bool =
   # Check for invalid combinations of options
   var invalidCombinations = [("musicOnly", "fullScreen"), ("download", "fullScreen")]
+  result = true
   for combination in invalidCombinations:
     if options[combination[0]] and options[combination[1]]:
      stderr.writeLine fmt"Incompatible options provided: {combination[0]} and {combination[1]}"
-     return false
-  true
+     result = false
 
 proc main() =
   let
@@ -45,7 +45,7 @@ proc main() =
   if(not isValidOptions(options)):
     quit(1)
 
-  if searchQuery.startswith("https:") or searchQuery.startswith("magnet:"):
+  if searchQuery.startswith("http") or searchQuery.startswith("magnet"):
     if options["download"]:
       directDownload(sanitizeURL(searchQuery), options["musicOnly"])
     else: