@@ -128,6 +128,10 @@ def login(self, force=False):
128
128
'login_attempt_count' : '0' }
129
129
130
130
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
+
131
135
if "two_factor_required" not in self .LastJson :
132
136
self .isLoggedIn = True
133
137
self .username_id = self .LastJson ["logged_in_user" ]["pk" ]
@@ -234,7 +238,10 @@ def generate_signature(self, data, skip_quote=False):
234
238
235
239
def start (self ):
236
240
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 :
238
245
print ("You'r logged in" )
239
246
240
247
if self .create_broadcast ():
@@ -473,13 +480,6 @@ def add_post_live_to_igtv(self, description, title):
473
480
return True
474
481
return False
475
482
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
-
483
483
def stop (self ):
484
484
self .end_broadcast ()
485
485
print ('Save Live replay to IGTV ? <y/n>' )
@@ -489,8 +489,7 @@ def stop(self):
489
489
description = input ("Description: " )
490
490
print ("Please wait..." )
491
491
self .add_post_live_to_igtv (description , title )
492
- else :
493
- self .delete_post_live ()
492
+
494
493
print ('Exiting...' )
495
494
self .is_running = False
496
495
print ('Bye bye' )
0 commit comments