From 2f326861cd7ce572f1d7d6e1e717f3d1448906dc Mon Sep 17 00:00:00 2001 From: Nycollas Eufrasio da Silva Date: Sat, 24 Dec 2022 00:23:52 -0300 Subject: [PATCH] URL IP CHANGE --- instapy/login_util.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/instapy/login_util.py b/instapy/login_util.py index 4088dcc69..78d8da2be 100644 --- a/instapy/login_util.py +++ b/instapy/login_util.py @@ -7,25 +7,17 @@ import socket # import exceptions -from selenium.common.exceptions import ( - MoveTargetOutOfBoundsException, - NoSuchElementException, - WebDriverException, -) +from selenium.common.exceptions import (MoveTargetOutOfBoundsException, + NoSuchElementException, + WebDriverException) from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys # import InstaPy modules from .time_util import sleep -from .util import ( - check_authorization, - click_element, - explicit_wait, - reload_webpage, - update_activity, - web_address_navigator, -) +from .util import (check_authorization, click_element, explicit_wait, + reload_webpage, update_activity, web_address_navigator) from .xpath import read_xpath @@ -172,8 +164,9 @@ def check_browser(browser, logfolder, logger, proxy_address): # check connection status try: logger.info("-- Connection Checklist [1/2] (Internet Connection Status)") - browser.get("view-source:https://freegeoip.app/json") + browser.get("view-source:http://ip-api.com/json") pre = browser.find_element(By.TAG_NAME, "pre").text + pre = pre.replace("query", "ip") current_ip_info = json.loads(pre) if ( proxy_address is not None @@ -193,8 +186,8 @@ def check_browser(browser, logfolder, logger, proxy_address): logger.info( '- Current IP is "{}" and it\'s from "{}/{}"'.format( current_ip_info["ip"], - current_ip_info["country_name"], - current_ip_info["country_code"], + current_ip_info["country"], + current_ip_info["countryCode"], ) ) update_activity(