Procházet zdrojové kódy

Put broadcast guest check in try clause in case there is none

Cammy před 7 roky
rodič
revize
c4be9859d0
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4 1
      pyinstalive/downloader.py

+ 4 - 1
pyinstalive/downloader.py

@@ -110,7 +110,10 @@ def download_livestream(broadcast):
 	try:
 		log('[I] Livestream found, beginning download...', "GREEN")
 		broadcast_owner = broadcast.get('broadcast_owner', {}).get('username')
-		broadcast_guest = broadcast.get('cobroadcasters', {})[0].get('username')
+		try:
+			broadcast_guest = broadcast.get('cobroadcasters', {})[0].get('username')
+		except:
+			broadcast_guest = None
 		if (broadcast_owner != user_to_record):
 			log('[I] This livestream is a dual-live, the owner is "{}".'.format(broadcast_owner), "BLUE")
 			broadcast_guest = None