Browse Source

Few fixes

Cammy 7 years ago
parent
commit
2cc834bc42
2 changed files with 7 additions and 2 deletions
  1. 7 1
      pyinstalive/auth.py
  2. 0 1
      pyinstalive/downloader.py

+ 7 - 1
pyinstalive/auth.py

@@ -39,6 +39,7 @@ def onlogin_callback(api, cookie_file):
 	with open(cookie_file, 'w') as outfile:
 	with open(cookie_file, 'w') as outfile:
 		json.dump(cache_settings, outfile, default=to_json)
 		json.dump(cache_settings, outfile, default=to_json)
 		log('[I] New cookie file was made: {0!s}'.format(cookie_file), "GREEN")
 		log('[I] New cookie file was made: {0!s}'.format(cookie_file), "GREEN")
+		seperator("GREEN")
 
 
 
 
 def login(username, password, show_cookie_expiry, force_use_login_args):
 def login(username, password, show_cookie_expiry, force_use_login_args):
@@ -85,8 +86,13 @@ def login(username, password, show_cookie_expiry, force_use_login_args):
 			log('[E] An error occurred while trying to create a new cookie file: {:s}'.format(str(ee)), "RED")
 			log('[E] An error occurred while trying to create a new cookie file: {:s}'.format(str(ee)), "RED")
 			if "getaddrinfo failed" in str(ee):
 			if "getaddrinfo failed" in str(ee):
 				log('[E] Could not resolve host, check your internet connection.', "RED")
 				log('[E] Could not resolve host, check your internet connection.', "RED")
-			if "timed out" in str(ee):
+			elif "timed out" in str(ee):
 				log('[E] The connection timed out, check your internet connection.', "RED")
 				log('[E] The connection timed out, check your internet connection.', "RED")
+			elif "bad_password" in str(ee):
+				log('[E] The password you entered is incorrect. Please try again.', "RED")
+			else:
+				log('[E] {:s}'.format(ee.message), "RED")
+			seperator("GREEN")
 			exit(1)
 			exit(1)
 
 
 	except ClientLoginError as e:
 	except ClientLoginError as e:

+ 0 - 1
pyinstalive/downloader.py

@@ -275,7 +275,6 @@ def get_broadcasts_info(user_id):
 			else:
 			else:
 				log('[I] There are no available livestreams.', "YELLOW")
 				log('[I] There are no available livestreams.', "YELLOW")
 		else:
 		else:
-			seperator("GREEN")
 			log("[I] Livestream saving is disabled either with an argument or in the config file.", "BLUE")
 			log("[I] Livestream saving is disabled either with an argument or in the config file.", "BLUE")