Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change URL get IP #6668

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 9 additions & 16 deletions instapy/login_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand All @@ -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(
Expand Down