├── README.md
└── Subscribe_bot.py
/README.md:
--------------------------------------------------------------------------------
1 | # Youtube-subscriber-bot
2 | This bot is for subscriber your channel
3 |
This is only module you need to install in your environment to execute this bot in your system
4 | pip install pyautogui
5 |
6 |
--------------------------------------------------------------------------------
/Subscribe_bot.py:
--------------------------------------------------------------------------------
1 |
2 | import socket
3 | import pyautogui
4 | import time
5 | import subprocess
6 | from _thread import *
7 |
8 | class SubBot:
9 | print(". ███▄ ▄███▓ ▄▄▄ ▄████ ██▓ ▄████▄ ██▓ ▄▄▄ ███▄ █ ")
10 | print(", ▓██▒▀█▀ ██▒▒████▄ ██▒ ▀█▒▓██▒▒██▀ ▀█ ▓██▒▒████▄ ██ ▀█ █ ")
11 | print(". ▓██ ▓██░▒██ ▀█▄ ▒██░▄▄▄░▒██▒▒▓█ ▄ ▒██▒▒██ ▀█▄ ▓██ ▀█ ██▒")
12 | print(". ▒██ ▒██ ░██▄▄▄▄██ ░▓█ ██▓░██░▒▓▓▄ ▄██▒░██░░██▄▄▄▄██ ▓██▒ ▐▌██▒")
13 | print(". ▒██▒ ░██▒ ▓█ ▓██▒░▒▓███▀▒░██░▒ ▓███▀ ░░██░ ▓█ ▓██▒▒██░ ▓██░")
14 | print(". ░ ▒░ ░ ░ ▒▒ ▓▒█░ ░▒ ▒ ░▓ ░ ░▒ ▒ ░░▓ ▒▒ ▓▒█░░ ▒░ ▒ ▒ ")
15 | print(". Program written by Magician")
16 | print(". You can use it for subscribe your youtube channel or modified it for other web apps\n")
17 |
18 | # javascript code for click on subscribe and bell button
19 | subButton = 'var SubForLogin = document.getElementsByClassName("style-scope ytd-subscribe-button-renderer");'
20 | subButtonClick = "SubForLogin[1].click();"
21 | bellButton = 'var Bell = document.getElementsByClassName("style-scope ytd-toggle-button-renderer");'
22 | bellButtonClick = "Bell[1].click();"
23 |
24 | # Type here your channel url:
25 | url = input("Enter your channel link = ")
26 |
27 | listOfBrowser = ['start chrome '+url,'start firefox '+url]
28 |
29 | listOfCommand = ['j','i']
30 |
31 | waitTime = 1
32 | flag = True
33 | count = 0
34 |
35 | def is_connected(self):
36 | try:
37 | socket.create_connection(("www.google.com", 80))
38 | return True
39 | except OSError:
40 | pass
41 | return False
42 |
43 | def enter(self,val):
44 | time.sleep(self.waitTime)
45 | pyautogui.press('enter')
46 |
47 | def main(self):
48 |
49 | while self.flag:
50 |
51 | time.sleep(self.waitTime+4)
52 |
53 | if self.is_connected() == True:
54 | for i in self.listOfBrowser:
55 | start_new_thread(self.enter,(1,))
56 | process = subprocess.Popen(i, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
57 | process.communicate()
58 |
59 | if process.returncode == 1:
60 | self.count = self.count + 1
61 | if self.count == len(self.listOfBrowser):
62 | self.flag = False;
63 | continue
64 |
65 | time.sleep(self.waitTime+4)
66 | pyautogui.hotkey('ctrl','shift',self.listOfCommand[self.listOfBrowser.index(i)])
67 |
68 | time.sleep(self.waitTime+2)
69 | pyautogui.typewrite(self.subButton)
70 | pyautogui.press('enter')
71 | time.sleep(self.waitTime)
72 | pyautogui.typewrite(self.subButtonClick)
73 | pyautogui.press('enter')
74 | time.sleep(self.waitTime)
75 | pyautogui.typewrite(self.bellButton)
76 | pyautogui.press('enter')
77 | time.sleep(self.waitTime)
78 | pyautogui.typewrite(self.bellButtonClick)
79 | pyautogui.press('enter')
80 | time.sleep(self.waitTime)
81 |
82 | pyautogui.hotkey('alt','f4')
83 |
84 | pyautogui.press('enter')
85 |
86 | self.flag = False;
87 | break
88 | else:
89 | print("Please Connect to Internet")
90 |
91 | subBot = SubBot()
92 | subBot.main()
93 |
94 | #Enjoy the program!
95 |
96 |
--------------------------------------------------------------------------------