Browse Source

No longer requiring a config.json

Owen Diffey 3 years ago
parent
commit
c4a372bd5a
1 changed files with 4 additions and 4 deletions
  1. 4 4
      musare-dl.py

+ 4 - 4
musare-dl.py

@@ -101,9 +101,9 @@ try:
     for opt, arg in opts:
         if opt in ("-c", "--config"):
             configFile = arg
-    if configFile:
-        if not os.path.exists(configFile):
-            sys.exit(f"{bcolors.FAIL}Error: Config file does not exist{bcolors.ENDC}")
+            if not os.path.exists(configFile):
+                sys.exit(f"{bcolors.FAIL}Error: Config file does not exist{bcolors.ENDC}")
+    if os.path.exists(configFile):
         if os.path.isdir(configFile):
             sys.exit(f"{bcolors.FAIL}Error: Config file is a directory{bcolors.ENDC}")
         with open(configFile, "r") as configJson:
@@ -164,7 +164,7 @@ if not playlistId and not playlistFile:
 if playlistId and playlistFile:
     print(f"{bcolors.FAIL}Error: Playlist ID and Playlist File can not be used at the same time{bcolors.ENDC}")
     usage(True)
-if len(playlistId) != 24:
+if playlistId and len(playlistId) != 24:
     sys.exit(f"{bcolors.FAIL}Error: Invalid Musare Playlist ID{bcolors.ENDC}")
 if playlistFile:
     if not os.path.exists(playlistFile):