-
Notifications
You must be signed in to change notification settings - Fork 3
/
sub.py
54 lines (49 loc) · 1.96 KB
/
sub.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
46
47
48
49
50
51
52
53
54
#!/bin/bash/python3
# by shiky
from time import sleep
import csv as cs
from selenium import webdriver
#browser=webdriver.Chrome()
browser=webdriver.Firefox(executable_path="./geckodriver")
def gloin(em,passed):
#browser.get("https://accounts.google.com/signin/v2/identifier?passive=1209600&continue=https%3A%2F%2Faccounts.google.com%2F&followup=https%3A%2F%2Faccounts.google.com%2F&flowName=GlifWebSignIn&flowEntry=ServiceLogin")
browser.get("https://gmail.com")
browser.find_element_by_id("identifierId").send_keys(em)
browser.find_element_by_id("identifierNext").click()
sleep(5)
browser.find_element_by_name("password").send_keys(passed)
browser.find_element_by_id("passwordNext").click()
sleep(5)
def glogout():
browser.get("https://accounts.google.com/SignOutOptions?hl=en&continue=https://mail.google.com/mail&service=mail")
browser.find_element_by_xpath('//button[normalize-space()="Sign out"]').click()
def add_lis(f):
dlist=[]
em = cs.reader(f)
for r in em:
dlist.append(r)
return dlist
looges=open("email.txt",'r')
#passer=open("pass.txt",'r')
email_list=add_lis(looges)
#pass_list=add_lis(passer)
#password=str(input("Enter the password for all emails :"))
password=str(input("Enter the one password for all emails : ")) # Enter the password for all emails make it one pass
c=len(email_list)
s=0
#channel=str(input("Enter the youtube channel link here : "))
channel="https://www.youtube.com/channel/UCCr0OdiJv77QhBFwPE88J7Q"
for i in range(len(email_list)):
try:
gloin(email_list[i],password)
#browser.get("https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw")
browser.get(channel)
Sub = browser.find_element_by_id("subscribe-button")
Sub.click()
glogout()
browser.close()
browser = webdriver.Firefox(executable_path="./geckodriver")
except:
print("try again")
print("done")
browser.close()