浏览代码

Fix wrong error message if livestream download fails

Cammy 7 年之前
父节点
当前提交
a09e61accc
共有 1 个文件被更改,包括 17 次插入16 次删除
  1. 17 16
      pyinstalive/downloader.py

+ 17 - 16
pyinstalive/downloader.py

@@ -153,7 +153,8 @@ def download_livestream(broadcast):
 		if not broadcast_downloader.is_aborted:
 			broadcast_downloader.stop()
 			stitch_video(broadcast_downloader, broadcast, comment_thread_worker)
-
+	except Exception as e:
+		log("[E] Could not download livestream: {:s}".format(str(e)), "RED")
 
 
 def stitch_video(broadcast_downloader, broadcast, comment_thread_worker):
@@ -243,27 +244,27 @@ def get_broadcasts_info(user_id):
 
 		livestream = broadcasts.get('broadcast')
 		replays = broadcasts.get('post_live_item', {}).get('broadcasts', [])
-
-		if livestream:
-			seperator("GREEN")
-			download_livestream(livestream)
-		else:
-			log('[I] There are no available livestreams.', "YELLOW")
-		if settings.save_replays.title() == "True":
-			if replays:
-				seperator("GREEN")
-				download_replays(replays)
-			else:
-				log('[I] There are no available replays.', "YELLOW")
-		else:
-			log("[I] Replay saving is disabled either with a flag or in the config file.", "BLUE")
-		seperator("GREEN")
 	except Exception as e:
 		log('[E] Could not finish checking: {:s}'.format(str(e)), "RED")
 	except ClientThrottledError as cte:
 		log('[E] Could not check because you are making too many requests at this time.', "RED")
 		log('[E] Error response: {:s}'.format(str(cte)), "RED")
 
+	if livestream:
+		seperator("GREEN")
+		download_livestream(livestream)
+	else:
+		log('[I] There are no available livestreams.', "YELLOW")
+	if settings.save_replays.title() == "True":
+		if replays:
+			seperator("GREEN")
+			download_replays(replays)
+		else:
+			log('[I] There are no available replays.', "YELLOW")
+	else:
+		log("[I] Replay saving is disabled either with a flag or in the config file.", "BLUE")
+	seperator("GREEN")
+
 def download_replays(broadcasts):
 	try:
 		log("[I] Downloading replays... press [CTRL+C] to abort.", "GREEN")