From c689c964196616755d7a562b25bd56817fe8bac2 Mon Sep 17 00:00:00 2001 From: gabrielkheisa Date: Fri, 25 Nov 2022 10:17:37 +0700 Subject: [PATCH] first --- README.md | 5 ++++ script.py | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 README.md create mode 100644 script.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..a33003b --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +

No-ip auto confirm

+ +

Auto-confirm your domain that is about to expire (30 days) every hour

+ + \ No newline at end of file diff --git a/script.py b/script.py new file mode 100644 index 0000000..f1b41ed --- /dev/null +++ b/script.py @@ -0,0 +1,78 @@ +import requests +from selenium import webdriver +from selenium.webdriver.chrome.options import Options +import time +from datetime import datetime +import base64 +import json +import urllib.parse + +from selenium.webdriver.chrome.options import Options + +def has_numbers(inputString): + return any(char.isdigit() for char in inputString) + +# Login credentials +username = "" # Your noip username +password = "" # Your noip passowrd + +while(1): + try: + now = datetime.now() + dt_string = now.strftime("%d-%m-%Y %H:%M:%S") + + # To bypass CloudFlare's detection + user_agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.50 Safari/537.36' + + + options = Options() + options.add_argument('--headless') + options.add_argument('--disable-gpu') + options.add_argument('--no-sandbox') # Required if you run your script as Administrators / sudoers + options.add_argument('--window-size=1920,1080') + + # To bypass CloudFlare's detection + # options.add_argument('--disable-blink-features=AutomationControlled') + options.add_argument(f'user-agent={user_agent}') + + browser = webdriver.Chrome(executable_path="/usr/bin/chromedriver", chrome_options=options) + + browser.delete_all_cookies() + browser.get("https://www.noip.com/login") + + browser.implicitly_wait(3) + + browser.save_screenshot('ss_noip.png') + + browser.find_element_by_xpath("/html/body/section[3]/section/div/div/div/div/div/div[2]/form/section[1]/input").send_keys(username) + browser.find_element_by_xpath("/html/body/section[3]/section/div/div/div/div/div/div[2]/form/section[2]/input").send_keys(password) + browser.find_element_by_xpath("/html/body/section[3]/section/div/div/div/div/div/div[2]/form/button").click() + + browser.get("https://my.noip.com/dynamic-dns") + + try: + browser.find_element_by_xpath("/html/body/div[1]/div/div/div[3]/div[1]/div[2]/div/div/div[1]/div[1]/table/tbody/tr[1]/td[5]/button[1]").click() + except: + print("Skip") + try: + browser.find_element_by_xpath("/html/body/div[1]/div/div/div[3]/div[1]/div[2]/div/div/div[1]/div[1]/table/tbody/tr[2]/td[5]/button[1]").click() + except: + print("Skip") + try: + browser.find_element_by_xpath("/html/body/div[1]/div/div/div[3]/div[1]/div[2]/div/div/div[1]/div[1]/table/tbody/tr[3]/td[5]/button[1]").click() + except: + print("Skip") + + # Optional, to see the result in the form of screenshot image + browser.save_screenshot('ss_noip.png') + + browser.quit() + print("Sleep for 1 hour") + time.sleep(60*60) + + except Exception as e: + print(e) + browser.quit() + print("Sleep for 1 hour") + time.sleep(60*60) +