Browse Source

Remove verbose argument (never used)

notcammy 5 years ago
parent
commit
55f04a7e6f

+ 0 - 1
.github/issue_template.md

@@ -68,7 +68,6 @@ $ pyinstalive --info
 
 ###### Command used
 Paste the command here that you are running. Don't forget to omit your **username** and **password**.  
-If you can reproduce the problem then, if possible, run the same command again with `--verbose` prior to uploading the log files.
 
 **Example:** ```pyinstalive -u "johndoe" -p "grapefruits" -d "justinbieber"```
 

+ 0 - 1
MOREHELP.md

@@ -52,7 +52,6 @@ use_locks = True
 clear_temp_files = False
 do_heartbeat = True
 proxy = 
-verbose = False
 skip_merge = False
 ```
 

+ 0 - 1
README.md

@@ -106,7 +106,6 @@ use_locks = True
 clear_temp_files = False
 do_heartbeat = True
 proxy = 
-verbose = False
 skip_merge = False
 ```
 

+ 1 - 4
pyinstalive/assembler.py

@@ -35,10 +35,7 @@ def assemble(user_called=True, retry_with_zero_m4v=False):
         ass_json_file = pil.assemble_arg if pil.assemble_arg.endswith(".json") else pil.assemble_arg + ".json"
         ass_mp4_file = os.path.join(pil.dl_path, os.path.basename(ass_json_file).replace("_downloads", "").replace(".json", ".mp4"))
         ass_segment_dir = pil.assemble_arg if not pil.assemble_arg.endswith(".json") else pil.assemble_arg.replace(".json", "")
-
-        if pil.verbose:
-            logger.plain("{}\n{}\n{}".format(ass_json_file, ass_mp4_file, ass_segment_dir))
-
+        
         broadcast_info = {}
         if not os.path.isdir(ass_segment_dir) or not os.listdir(ass_segment_dir):
             logger.error('The segment directory does not exist or does not contain any files: %s' % ass_segment_dir)

+ 0 - 4
pyinstalive/auth.py

@@ -87,15 +87,11 @@ def authenticate(username, password, force_use_login_args=False):
 
     except (ClientLoginError, ClientError) as e:
         logger.separator()
-        if pil.verbose:
-            logger.plain(json.dumps(e.error_response))
         logger.error('Could not login: {:s}'.format(e.error_response))
         # logger.error('{:s}'.format(json.loads(e.error_response).get("message", e.error_response)))
         # logger.error('{:s}'.format(e.error_response))
         logger.separator()
     except Exception as e:
-        if pil.verbose:
-            logger.plain(json.dumps(e.error_response))
         if str(e).startswith("unsupported pickle protocol"):
             logger.warn("This cookie file is not compatible with Python {}.".format(sys.version.split(' ')[0][0]))
             logger.warn("Please delete your cookie file '{}.json' and try again.".format(username))

+ 0 - 4
pyinstalive/comments.py

@@ -54,8 +54,6 @@ class CommentsDownloader(object):
         try:
             comments_res = self.api.broadcast_comments(
                 self.broadcast.get('id'), last_comment_ts=first_comment_created_at)
-            if pil.verbose:
-                logger.plain(json.dumps(comments_res))
             comments = comments_res.get('comments', [])
             first_comment_created_at = (
                 comments[0]['created_at_utc'] if comments else int(time.time() - 5))
@@ -93,8 +91,6 @@ class CommentsDownloader(object):
             try:
                 comments_res = self.api.replay_broadcast_comments(
                     self.broadcast.get('id'), starting_offset=starting_offset, encoding_tag=encoding_tag)
-                if pil.verbose:
-                    logger.plain(json.dumps(comments_res))
                 starting_offset = comments_res.get('ending_offset', 0)
                 comments = comments_res.get('comments', [])
                 comments_collected.extend(comments)

+ 0 - 1
pyinstalive/constants.py

@@ -21,6 +21,5 @@ use_locks = True
 clear_temp_files = False
 do_heartbeat = True
 proxy =
-verbose = False
 skip_merge = False
     """

+ 1 - 16
pyinstalive/dlfuncs.py

@@ -64,8 +64,6 @@ def get_user_id():
     except ValueError:
         try:
             user_res = pil.ig_api.username_info(pil.dl_user)
-            if pil.verbose:
-                logger.plain(json.dumps(user_res))
             user_id = user_res.get('user', {}).get('pk')
         except ClientConnectionError as cce:
             logger.error(
@@ -103,8 +101,6 @@ def get_broadcasts_info():
         user_id = get_user_id()
         if user_id:
             broadcasts = pil.ig_api.user_story_feed(user_id)
-            if pil.verbose:
-                logger.plain(json.dumps(broadcasts))
             pil.livestream_obj = broadcasts.get('broadcast')
             pil.replays_obj = broadcasts.get('post_live_item', {}).get('broadcasts', [])
             return True
@@ -187,8 +183,6 @@ def download_livestream():
         def print_status(sep=True):
             if pil.do_heartbeat:
                 heartbeat_info = pil.ig_api.broadcast_heartbeat_and_viewercount(pil.livestream_obj.get('id'))
-                if pil.verbose:
-                    logger.plain(json.dumps(heartbeat_info))
             viewers = pil.livestream_obj.get('viewer_count', 0) + 1
             if sep:
                 logger.separator()
@@ -303,14 +297,6 @@ def download_replays():
             pil.livestream_obj = replay_obj
             dl_path_files = os.listdir(pil.dl_path)
 
-            if pil.verbose:
-                logger.separator()
-                logger.plain("Listing contents of the folder '{}':".format(pil.dl_path))
-                for dl_path_file in dl_path_files:
-                    logger.plain(dl_path_file)
-                logger.separator()
-                logger.separator()
-
             for dl_path_file in dl_path_files:
                 if (str(replay_obj.get('id')) in dl_path_file) and ("_replay" in dl_path_file) and (dl_path_file.endswith(".mp4")):
                     logger.binfo("Already downloaded replay {:d} with ID '{:s}'.".format(replay_index + 1, str(replay_obj.get('id'))))
@@ -377,8 +363,7 @@ def download_following():
             is_checking = 'replays'
         logger.info("Checking following users for any {:s}.".format(is_checking))
         broadcast_f_list = pil.ig_api.reels_tray()
-        if pil.verbose:
-            logger.plain(json.dumps(broadcast_f_list))
+
         usernames_available_livestreams = []
         usernames_available_replays = []
         if broadcast_f_list['broadcasts'] and pil.dl_lives:

+ 2 - 2
pyinstalive/helpers.py

@@ -265,7 +265,7 @@ def create_lock_user():
                 return True
         else:
             return False
-    except Exception as e:
+    except Exception:
         logger.warn("Lock file could not be created. Be careful when running multiple downloads concurrently!")
         return True
 
@@ -278,7 +278,7 @@ def create_lock_folder():
                 return True
         else:
             return False
-    except Exception as e:
+    except Exception:
         logger.warn("Lock file could not be created. Be careful when running multiple downloads concurrently!")
         return True
 

+ 0 - 2
pyinstalive/pil.py

@@ -44,7 +44,6 @@ def initialize():
     global has_guest
     global do_heartbeat
     global proxy
-    global verbose
     global skip_merge
     global config_login_overridden
     global kill_segment_thread
@@ -81,7 +80,6 @@ def initialize():
     has_guest = None
     do_heartbeat = False
     proxy = None
-    verbose = False
     skip_merge = False
     config_login_overridden = False
     kill_segment_thread = False

+ 0 - 14
pyinstalive/startup.py

@@ -102,7 +102,6 @@ def validate_inputs(config, args, unknown_args):
         pil.run_at_start = config.get('pyinstalive', 'run_at_start')
         pil.run_at_finish = config.get('pyinstalive', 'run_at_finish')
         pil.ffmpeg_path = config.get('pyinstalive', 'ffmpeg_path')
-        pil.verbose = config.get('pyinstalive', 'verbose')
         pil.skip_merge = config.get('pyinstalive', 'skip_merge')
         pil.args = args
         pil.config = config
@@ -119,14 +118,6 @@ def validate_inputs(config, args, unknown_args):
         else:
             pil.show_cookie_expiry = False
 
-        if helpers.bool_str_parse(config.get('pyinstalive', 'verbose')) == "Invalid":
-            pil.verbose = False
-            error_arr.append(['verbose', 'False'])
-        elif helpers.bool_str_parse(config.get('pyinstalive', 'verbose')):
-            pil.verbose = True
-        else:
-            pil.verbose = False
-
         if helpers.bool_str_parse(config.get('pyinstalive', 'skip_merge')) == "Invalid":
             pil.skip_merge = False
             error_arr.append(['skip_merge', 'False'])
@@ -191,8 +182,6 @@ def validate_inputs(config, args, unknown_args):
         if args.noreplays:
             pil.dl_replays = False
 
-        if args.verbose:
-            pil.verbose = True
         if args.skip_merge:
             pil.skip_merge = True
 
@@ -299,9 +288,6 @@ def run():
     parser.add_argument('-nhb', '--no-heartbeat', dest='noheartbeat', action='store_true', help="Disable heartbeat "
                                                                                                 "check for "
                                                                                                 "livestreams.")
-    parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', help="PyInstaLive will output JSON "
-                                                                                     "responses and some misc "
-                                                                                     "variables.")
     parser.add_argument('-sm', '--skip-merge', dest='skip_merge', action='store_true', help="PyInstaLive will not merge the downloaded livestream files.")
     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.")