Parcourir la source

Added --organize command.

The --organize command will create a folder for each user whose livestream(s) you have downloaded. The names of the folders will be their usernames. It will then move the video(s) of each user into their associated folder.
BassThatHertz il y a 6 ans
Parent
commit
24910a6257
1 fichiers modifiés avec 9 ajouts et 2 suppressions
  1. 9 2
      pyinstalive/startup.py

+ 9 - 2
pyinstalive/startup.py

@@ -26,12 +26,15 @@ except ImportError:
     from . import dlfuncs
     from .constants import Constants
 
-
 def validate_inputs(config, args, unknown_args):
     error_arr = []
     try:
         config.read(pil.config_path)
 
+        if args.organize:
+            assembler.organize_videos()
+            return False
+
         if args.download:
             pil.dl_user = args.download
             if args.downloadfollowing or args.batchfile:
@@ -272,6 +275,9 @@ def run():
     parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', help="PyInstaLive will output JSON "
                                                                                      "responses and some misc "
                                                                                      "variables.")
+
+    parser.add_argument('-o', '--organize', action='store_true', help="Create a folder for each user whose livestream(s) you have downloaded. The names of the folders will be their usernames. Then move the video(s) of each user into their associated folder.")
+
     # Workaround to 'disable' argument abbreviations
     parser.add_argument('--usernamx', help=argparse.SUPPRESS, metavar='IGNORE')
     parser.add_argument('--passworx', help=argparse.SUPPRESS, metavar='IGNORE')
@@ -281,6 +287,7 @@ def run():
     parser.add_argument('--downloadfollowinx', help=argparse.SUPPRESS, metavar='IGNORE')
     parser.add_argument('--configpatx', help=argparse.SUPPRESS, metavar='IGNORE')
     parser.add_argument('--confix', help=argparse.SUPPRESS, metavar='IGNORE')
+    parser.add_argument('--organizx', help=argparse.SUPPRESS, metavar='IGNORE')
 
     parser.add_argument('-cx', help=argparse.SUPPRESS, metavar='IGNORE')
     parser.add_argument('-nx', help=argparse.SUPPRESS, metavar='IGNORE')
@@ -311,4 +318,4 @@ def run():
                     logger.error("PyInstaLive must be properly installed when using the -b argument.")
                     logger.separator()
                 else:
-                    dlfuncs.iterate_users(pil.dl_batchusers)
+                    dlfuncs.iterate_users(pil.dl_batchusers)