forked from kokonior/Python-Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Youtube clickbot
48 lines (47 loc) · 1.43 KB
/
Youtube clickbot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from selenium import webdriver
import time
import os
from selenium.common.exceptions import NoSuchElementException
from tkinter import *
from tkinter import font as font
from threading import Thread
def maininmain():
print("Generating")
url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
while:
time.sleep(1)
os.popen(r'C:\Coding\TorBrowser\Browser\firefox.exe')
time.sleep(6)
PROXY = "socks5://localhost:9150"
options = webdriver.ChromeOptions()
options.add_argument('--proxy-server=%s' % PROXY)
driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\Coding\Bots\chromedriver.exe')
driver.get(url)
time.sleep(3)
try:
elem = driver.find_element_by_id("captcha-page")
print(elem)
time.sleep(1)
pass
except NoSuchElementException:
pass
time.sleep(1)
try:
elem = driver.find_element_by_id("captcha-form")
print(elem)
time.sleep(1)
pass
except NoSuchElementException:
pass
time.sleep(1)
try:
elem = driver.find_element_by_xpath("//form/div/div/button")
print(elem)
elem.click()
except NoSuchElementException:
pass
time.sleep(1)
time.sleep(18)
os.system(r'TASKKILL /F /IM firefox.exe')
os.system(r'TASKKILL /F /IM chrome.exe')
time.sleep(3)