![]() In this way, you can centrally handle errors and not repeat handlers throughout your code. ![]() freeze ( str ( e ), hours = 1 ) raise e cl = Client () cl. ![]() freeze ( message ) elif isinstance ( e, PleaseWaitFewMinutes ): self. freeze ( message, hours = 12 ) elif "Your account has been temporarily blocked" in message : """īased on previous use of this feature, your account has been temporarily # return self.update_client_settings(client.get_settings())Įlif "We restrict certain activity to protect our community" in message : # 6 hours is not enough freeze ( message, hours = 12 ) # ttings = self.rebuild_client_settings() Please try again later" in message : self. get_settings ()) return True elif isinstance ( e, FeedbackRequired ): message = client. freeze ( str ( e ), days = 4 ) raise e self. freeze ( 'Manual Challenge Required', days = 2 ) raise e except ( ChallengeRequired, SelectContactPointRecoveryForm, RecaptchaChallengeForm ) as e : self. last_json ) except ChallengeRequired as e : self. rebuild_client_settings () else : try : client. last_json, "challenge", "api_path" ) if api_path = "/challenge/" : client. get_settings ()) elif isinstance ( e, ChallengeRequired ): api_path = json_value ( client. ![]() get_settings ()) elif isinstance ( e, LoginRequired ): client. freeze ( str ( e ), days = 7 ) raise ReloginAttemptExceeded ( e ) client. From instagrapi import Client from instagrapi.exceptions import ( BadPassword, ReloginAttemptExceeded, ChallengeRequired, SelectContactPointRecoveryForm, RecaptchaChallengeForm, FeedbackRequired, PleaseWaitFewMinutes, LoginRequired ) def handle_exception ( client, e ): if isinstance ( e, BadPassword ): client. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |