|
@@ -64,8 +64,6 @@ def get_user_id():
|
|
except ValueError:
|
|
except ValueError:
|
|
try:
|
|
try:
|
|
user_res = pil.ig_api.username_info(pil.dl_user)
|
|
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')
|
|
user_id = user_res.get('user', {}).get('pk')
|
|
except ClientConnectionError as cce:
|
|
except ClientConnectionError as cce:
|
|
logger.error(
|
|
logger.error(
|
|
@@ -103,8 +101,6 @@ def get_broadcasts_info():
|
|
user_id = get_user_id()
|
|
user_id = get_user_id()
|
|
if user_id:
|
|
if user_id:
|
|
broadcasts = pil.ig_api.user_story_feed(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.livestream_obj = broadcasts.get('broadcast')
|
|
pil.replays_obj = broadcasts.get('post_live_item', {}).get('broadcasts', [])
|
|
pil.replays_obj = broadcasts.get('post_live_item', {}).get('broadcasts', [])
|
|
return True
|
|
return True
|
|
@@ -187,8 +183,6 @@ def download_livestream():
|
|
def print_status(sep=True):
|
|
def print_status(sep=True):
|
|
if pil.do_heartbeat:
|
|
if pil.do_heartbeat:
|
|
heartbeat_info = pil.ig_api.broadcast_heartbeat_and_viewercount(pil.livestream_obj.get('id'))
|
|
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
|
|
viewers = pil.livestream_obj.get('viewer_count', 0) + 1
|
|
if sep:
|
|
if sep:
|
|
logger.separator()
|
|
logger.separator()
|
|
@@ -303,14 +297,6 @@ def download_replays():
|
|
pil.livestream_obj = replay_obj
|
|
pil.livestream_obj = replay_obj
|
|
dl_path_files = os.listdir(pil.dl_path)
|
|
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:
|
|
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")):
|
|
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'))))
|
|
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'
|
|
is_checking = 'replays'
|
|
logger.info("Checking following users for any {:s}.".format(is_checking))
|
|
logger.info("Checking following users for any {:s}.".format(is_checking))
|
|
broadcast_f_list = pil.ig_api.reels_tray()
|
|
broadcast_f_list = pil.ig_api.reels_tray()
|
|
- if pil.verbose:
|
|
|
|
- logger.plain(json.dumps(broadcast_f_list))
|
|
|
|
|
|
+
|
|
usernames_available_livestreams = []
|
|
usernames_available_livestreams = []
|
|
usernames_available_replays = []
|
|
usernames_available_replays = []
|
|
if broadcast_f_list['broadcasts'] and pil.dl_lives:
|
|
if broadcast_f_list['broadcasts'] and pil.dl_lives:
|