-
Notifications
You must be signed in to change notification settings - Fork 17
/
youtube-subscribe-bot.py
45 lines (37 loc) · 1.34 KB
/
youtube-subscribe-bot.py
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
import time
from webbot import Browser
import pyautogui # its use for keyboard inputs.
import win32console,win32gui
class SubBot():
email = []
password = []
def __init__(self,filename):
self.filename = filename
def readFile(self):
with open(self.filename) as fp:
for line in fp:
file_email,file_passwords = line.split()
self.email.append(file_email)
self.password.append(file_passwords)
def hide(self):
window = win32console.GetConsoleWindow()
win32gui.ShowWindow(window,0)
def main(self):
for i in range(0,len(self.email)):
web = Browser('switch_to_alert')
self.hide()
web.go_to('mail.google.com')
web.type(self.email[i] , into='Email')
web.click('NEXT' , tag='span')
time.sleep(1)
web.type(self.password[i], into='Password' , id='passwordFieldId')
web.click('NEXT' , tag='span') # you are logged in . woohoooo
time.sleep(2)
web.go_to('youtube.com/channel/UCSu-YBmsmjSlPTKtlKx_img/')
time.sleep(1)
web.click('Subscribe',tag='yt-formatted-string')
time.sleep(2)
pyautogui.hotkey('alt','f4')
sb = SubBot("file.txt")
sb.readFile()
sb.main()