MCPcopy
hub / github.com/InstaPy/InstaPy / emergency_exit

Function emergency_exit

instapy/util.py:1567–1581  ·  view source on GitHub ↗

Raise emergency if the is no connection to server OR if user is not logged in

(browser, username, logger)

Source from the content-addressed store, hash-verified

1565
1566
1567def emergency_exit(browser, username, logger):
1568 """Raise emergency if the is no connection to server OR if user is not
1569 logged in"""
1570 server_address = "instagram.com"
1571 connection_state = ping_server(server_address, logger)
1572 if connection_state is False:
1573 return True, "not connected"
1574
1575 # check if the user is logged in
1576 auth_method = "activity counts"
1577 login_state = check_authorization(browser, username, auth_method, logger)
1578 if login_state is False:
1579 return True, "not logged in"
1580
1581 return False, "no emergency"
1582
1583
1584def load_user_id(username, person, logger, logfolder):

Callers 3

follow_userFunction · 0.85
unfollow_userFunction · 0.85

Calls 2

ping_serverFunction · 0.85
check_authorizationFunction · 0.85

Tested by

no test coverage detected