浏览代码

Small bugfixes

Cammy 6 年之前
父节点
当前提交
759ce3b605
共有 2 个文件被更改,包括 11 次插入12 次删除
  1. 1 3
      pyinstalive/dlfuncs.py
  2. 10 9
      pyinstalive/startup.py

+ 1 - 3
pyinstalive/dlfuncs.py

@@ -310,7 +310,7 @@ def download_replays():
                 replay_mp4_file = '{}{}_{}_{}_replay.mp4'.format(pil.dl_path, pil.datetime_compat,
                                                                  pil.dl_user, pil.livestream_obj.get('id'))
 
-                comments_json_file = '{}{}_{}_{}_live_comments.json'.format(pil.dl_path, pil.datetime_compat,
+                comments_json_file = '{}{}_{}_{}_replay_comments.json'.format(pil.dl_path, pil.datetime_compat,
                                                                             pil.dl_user, pil.livestream_obj.get('id'))
 
                 pil.comment_thread_worker = threading.Thread(target=get_replay_comments, args=(comments_json_file,))
@@ -335,11 +335,9 @@ def download_replays():
 
         logger.separator()
         logger.info("Finished downloading all available replays.")
-        logger.separator()
         helpers.remove_lock()
     except Exception as e:
         logger.error('Could not save replay: {:s}'.format(str(e)))
-        logger.separator()
         helpers.remove_lock()
     except KeyboardInterrupt:
         logger.separator()

+ 10 - 9
pyinstalive/startup.py

@@ -28,9 +28,17 @@ def validate_inputs(config, args, unknown_args):
     try:
         config.read(pil.config_path)
 
+        if args.download:
+            pil.dl_user = args.download
+        elif not args.clean and not args.info and not args.assemble and not args.downloadfollowing:
+            logger.banner()
+            logger.error("Missing --download argument. This argument is required.")
+            logger.separator()
+            return False
+
         if helpers.bool_str_parse(config.get('pyinstalive', 'log_to_file')) == "Invalid":
-            pil.log_to_file = False
-            error_arr.append(['log_to_file', 'False'])
+            pil.log_to_file = True
+            error_arr.append(['log_to_file', 'True'])
         elif helpers.bool_str_parse(config.get('pyinstalive', 'log_to_file')):
             pil.log_to_file = True
         else:
@@ -147,13 +155,6 @@ def validate_inputs(config, args, unknown_args):
                 logger.warn("Invalid value for '{:s}'. Using default value: {:s}".format(error[0], error[1]))
                 logger.separator()
 
-        if args.download:
-            pil.dl_user = args.download
-        elif not args.clean and not args.info and not args.assemble and not args.downloadfollowing:
-            logger.error("Missing --download argument. This argument is required.")
-            logger.separator()
-            return False
-
         if args.info:
             helpers.show_info()
             return False