Skip to content
This repository was archived by the owner on Aug 15, 2022. It is now read-only.

Commit 9d708ef

Browse files
committed
Displays message in case of incorrect password.
Removing delete_post_live endpoint Except when ending stream closes #34, closes #36, closes #37
1 parent f9d3b0c commit 9d708ef

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

ItsAGramLive/ItsAGramLive.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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')

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setuptools.setup(
1212
name='ItsAGramLive',
13-
version='1.4.1',
13+
version='1.4.3',
1414
packages=setuptools.find_packages(),
1515
url='https://github.com/harrypython/itsagramlive',
1616
license='GPL-3.0',

0 commit comments

Comments
 (0)