@@ -128,6 +128,10 @@ def login(self, force=False):
128128 'login_attempt_count' : '0' }
129129
130130 if self .send_request ('accounts/login/' , post = self .generate_signature (json .dumps (data )), login = True ):
131+ if self .LastJson ['error_type' ] == 'bad_password' :
132+ print (self .LastJson ['message' ])
133+ return False
134+
131135 if "two_factor_required" not in self .LastJson :
132136 self .isLoggedIn = True
133137 self .username_id = self .LastJson ["logged_in_user" ]["pk" ]
@@ -234,7 +238,10 @@ def generate_signature(self, data, skip_quote=False):
234238
235239 def start (self ):
236240 print ("Let's do it!" )
237- if self .login ():
241+ if not self .login ():
242+ print ("Error {}" .format (self .LastResponse .status_code ))
243+ print (json .loads (self .LastResponse .text ).get ("message" ))
244+ else :
238245 print ("You'r logged in" )
239246
240247 if self .create_broadcast ():
@@ -473,13 +480,6 @@ def add_post_live_to_igtv(self, description, title):
473480 return True
474481 return False
475482
476- def delete_post_live (self ):
477- data = json .dumps ({'_uuid' : self .uuid , '_uid' : self .username_id , '_csrftoken' : self .token })
478- if self .send_request (endpoint = 'live/{}/delete_post_live/' .format (self .broadcast_id ),
479- post = self .generate_signature (data )):
480- return True
481- return False
482-
483483 def stop (self ):
484484 self .end_broadcast ()
485485 print ('Save Live replay to IGTV ? <y/n>' )
@@ -489,8 +489,7 @@ def stop(self):
489489 description = input ("Description: " )
490490 print ("Please wait..." )
491491 self .add_post_live_to_igtv (description , title )
492- else :
493- self .delete_post_live ()
492+
494493 print ('Exiting...' )
495494 self .is_running = False
496495 print ('Bye bye' )
0 commit comments