-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtwitch-viewer.py
72 lines (47 loc) · 1.65 KB
/
twitch-viewer.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from selenium import webdriver
import threading
import time
from multiprocessing import Pool
chrome_options = webdriver.ChromeOptions()
##chrome_options.add_argument("start-maximized")
##chrome_options.add_argument("disable-infobars")
##chrome_options.add_argument("--disable-extensions")
##chrome_options.add_argument('--no-sandbox')
##chrome_options.add_argument('--disable-application-cache')
##chrome_options.add_argument('--disable-gpu')
##chrome_options.add_argument("--disable-dev-shm-usage")
##chrome_options.add_argument("--headless")
##username=str(input('pls enter correct user name '))
##np=int(input('pls eneter number of bots,considering your ram '))
##
PROXY=''
proxyListFromFile=[]
f=open('proxy.txt','r')
line=f.readlines()
for i in line:
proxyListFromFile.append(i.replace('\n',''))
def proxySurfing(url,PROXY):
global chrome_options
chrome_options.add_argument('--proxy-server=%s' % PROXY)
chrome = webdriver.Chrome(options=chrome_options)
chrome.get(url)
while True:
time.sleep(10)
chrome.refresh()
def multip():
global np
global proxyListFromFile,url
pool = Pool(processes=np)
for i in range(np):
pool.apply_async(proxySurfing, args={url,proxyListFromFile[i]})
print(proxyListFromFile[i])
pool.close()
pool.join()
##
if __name__ == "__main__":
username=str(input('pls enter correct user name '))
url = 'https://www.twitch.tv/'+str(username)
np=int(input('pls eneter number of bots,considering your ram '))
multip()
print ('Test completed!')
##time.sleep(50)