在python命令行中使用密码登录



我开始学习python,面对这样的问题,我有main.py。我希望它的所有功能都能使用从网站上的文本文档中获取的密码。

看到这里是代码

from selenium import webdriver
from os import system, name
from time import time, strftime, gmtime, sleep
import pyfiglet, os, threading
import webbrowser
def clear():
if name == 'nt':
_ = system('cls')
else:
_ = system('clear')
clear()
system('title TUT.GURU')
print(pyfiglet.figlet_format("TUT.GURU", font="slant"))
print("1. Viewbot.n2. Heartbot.n3. Followerbot.n3. Sharebot.n4. Credits.n5. ИнфоnnЗакажите сайт или программу у меня в ТГ: @whitehaknЗаходи к нам на форум: TUT.GURUnn")
auto = int(input("Режим: "))
if auto == 1 or auto == 2 or auto == 3 or auto == 4:
vidUrl = input("Вставьте ссылку на видео: ")
start = time()
time_elapsed = strftime('%H:%M:%S', gmtime(time() - start))
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--mute-audio")
chrome_options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(r"chromedriver.exe", options=chrome_options)
driver.set_window_size(425, 948)

Views = 0
Hearts = 0
Followers = 0
def beautify(arg):
return format(arg, ',d').replace(',', '.')
def title1(): # Update the title IF option 1 was picked.
global Views

while True:
time_elapsed = strftime('%H:%M:%S', gmtime(time() - start))
system(f'title TUT.GURU ^| Views Sent: {beautify(Views)} ^| Программа работает: {time_elapsed}')
def title2(): # Update the title IF option 2 was picked.
global Hearts

while True:
time_elapsed = strftime('%H:%M:%S', gmtime(time() - start))
system(f'title TUT.GURU ^| Hearts Sent: {beautify(Hearts)} ^| Программа работает: {time_elapsed}')
def title3(): # Update the title IF option 3 was picked.
global Followers

while True:
time_elapsed = strftime('%H:%M:%S', gmtime(time() - start))
system(f'title TUT.GURU ^| Followers Sent: {beautify(Followers)} ^| Программа работает: {time_elapsed}')

def title4(): # Update the title IF option 1 was picked.
global Shares

while True:
time_elapsed = strftime('%H:%M:%S', gmtime(time() - start))
system(f'title TUT.GURU ^| Shares Sent: {beautify(Shares)} ^| Программа работает: {time_elapsed}')

def loop1():
global Views
sleep(10)

try:
driver.find_element_by_xpath("/html/body/div[4]/div[1]/div[3]/div/div[4]/div/button").click()

except:
print("[-] Капча не разгадана!")
driver.refresh()
loop1()

try:
sleep(2)
driver.find_element_by_xpath("//*[@id="sid4"]/div/form/div/input").send_keys(vidUrl)

sleep(1)
driver.find_element_by_xpath("//*[@id="sid4"]/div/form/div/div/button").click()

sleep(5)
driver.find_element_by_xpath("//*[@id="c2VuZC9mb2xsb3dlcnNfdGlrdG9V"]/div[1]/div/form/button").click()

driver.refresh()
Views += 1000
print("[+] Views sended!")

sleep(300)
loop1()

except:
print("[-] Пробуем еще раз") 
driver.refresh()
loop1()
def loop2():
global Hearts
sleep(10)

try:
driver.find_element_by_xpath("/html/body/div[4]/div[1]/div[3]/div/div[2]/div/button").click()

except:
print("[-] Капча не разгадана!")
driver.refresh()
loop2()

try:
sleep(2)
driver.find_element_by_xpath('//*[@id="sid2"]/div/form/div/input').send_keys(vidUrl)

sleep(1)
driver.find_element_by_xpath('//*[@id="sid2"]/div/form/div/div/button').click()

sleep(5)
driver.find_element_by_xpath('//*[@id="c2VuZE9nb2xsb3dlcnNfdGlrdG9r"]/div[1]/div/form/button').click()

sleep(6)
hearts = driver.find_element_by_xpath('//*[@id="c2VuZE9nb2xsb3dlcnNfdGlrdG9r"]/span').text.split()

Hearts += int(hearts[0])
print("[+] Hearts sended!")

sleep(5)
driver.refresh()

sleep(1800)
loop2()

except:
print("[-] Пробуем еще раз") 
driver.refresh()
loop2()
def loop3():
global Followers
sleep(10)

try:
driver.find_element_by_xpath("/html/body/div[4]/div[1]/div[3]/div/div[1]/div/button").click()

except:
print("[-] Капча не разгадана!")
driver.refresh()
loop3()

try:
sleep(2)
driver.find_element_by_xpath("//*[@id="sid"]/div/form/div/input").send_keys(vidUrl)

sleep(1)
driver.find_element_by_xpath("//*[@id="sid"]/div/form/div/div/button").click()

sleep(5)
driver.find_element_by_xpath("//*[@id="c2VuZF9mb2xsb3dlcnNfdGlrdG9r"]/div[1]/div/form/button").click()
sleep(6)
folls = driver.find_element_by_xpath('//*[@id="c2VuZF9mb2xsb3dlcnNfdGlrdG9r"]/span').text.split()

Followers += int(folls[0])
print("[+] Followers sended!")
driver.refresh()

sleep(1800)
loop3()

except:
print("[-] Пробуем еще раз")
driver.refresh()
loop3()
def loop4():
global Shares
sleep(10)

try:
driver.find_element_by_xpath("/html/body/div[4]/div[1]/div[3]/div/div[5]/div/button").click()

except:
print("[-] Капча не разгадана!")
driver.refresh()
loop4()

try:
sleep(2)
driver.find_element_by_xpath("//*[@id="sid7"]/div/form/div/input").send_keys(vidUrl)

sleep(1)
driver.find_element_by_xpath("//*[@id="sid7"]/div/form/div/div/button").click()

sleep(5)
driver.find_element_by_xpath("//*[@id="c2VuZC9mb2xsb3dlcnNfdGlrdG9s"]/div[1]/div/form/button").click()

driver.refresh()
Shares += 100
print("[+] Shares sended!")

sleep(300)
loop4()

except:
print("[-] Пробуем еще раз")
driver.refresh()
loop4()
clear()

当你打开程序时,你需要询问一个密码,如果密码正确,然后运行程序,如果不正确,然后写下密码不正确。密码将存储在网站上示例:domen.com/pass.txt

我不知道怎么做这个

我不会那样做。为什么希望将您的明文密码泄露给世界上每一个可以访问domain.com的男人、女人和孩子?

也就是说,如果您想通过URL获取文件,请查看requests库。

requests.get('https://example.com/file.png')

相关内容

  • 没有找到相关文章