├── .github
└── workflows
│ └── log.yml
├── Chrome
├── README.md
├── YouTubeBot.py
├── chromedriver.exe
└── images
│ ├── image.jpg
│ └── youtubebot.png
├── Firefox
├── README.md
├── YouTubeBot.py
├── geckodriver.exe
└── images
│ ├── image.jpg
│ └── youtubebot.png
├── LICENSE.md
├── README.md
├── log.md
└── requirements.txt
/.github/workflows/log.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions
2 |
3 | name: CI
4 |
5 | # Controls when the workflow will run
6 | on:
7 | # Triggers the workflow on push or pull request events but only for the main branch
8 | push:
9 | branches: [ main ]
10 | workflow_dispatch:
11 | schedule:
12 | - cron: '0 */1 * * *'
13 |
14 | pull_request:
15 | branches: [ main ]
16 |
17 | # Allows you to run this workflow manually from the Actions tab
18 |
19 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel
20 | jobs:
21 | # This workflow contains a single job called "build"
22 | build:
23 | # The type of runner that the job will run on
24 | runs-on: ubuntu-latest
25 |
26 | # Steps represent a sequence of tasks that will be executed as part of the job
27 | steps:
28 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
29 | - uses: actions/checkout@v3
30 |
31 | # Runs a single command using the runners shell
32 | - name: first commit
33 | run: date >> log.md
34 |
35 | # Runs a set of commands using the runners shell
36 | - name: second commit
37 | run: |
38 | git add .
39 | git config user.name 'Setiawan007'
40 | git config user.email 'febriantobagussetiawan@gmail.com'
41 | git commit -m "Jangan Lupa Follow @Setiawan007"
42 | git push
43 |
44 | - name: third commit
45 | run: sed -i '$ d' log.md
46 |
47 | - name: finishing
48 | run: |
49 | git add .
50 | git config user.name 'Setiawan007'
51 | git config user.email 'febriantobagussetiawan@gmail.com'
52 | git commit -m "Jangan Lupa Follow @Setiawan007"
53 | git push
54 |
--------------------------------------------------------------------------------
/Chrome/README.md:
--------------------------------------------------------------------------------
1 |
2 | # :warning: Driver must be in PATH
3 | Make sure that your driver must be included in **PATH** or else the script will fail to run.
4 | ## Must have chrome version 94
5 | If not, then delete the file named chromedriver.exe and download the apt chrome driver from https://sites.google.com/chromium.org/driver/downloads?authuser=0. Then add the driver to **PATH**
6 |
--------------------------------------------------------------------------------
/Chrome/YouTubeBot.py:
--------------------------------------------------------------------------------
1 | import tkinter as tk
2 | import tkinter.ttk as ttk
3 | from PIL import Image, ImageTk
4 | from selenium import webdriver
5 | import time
6 | import pyautogui
7 |
8 | height = pyautogui.size()[1]
9 | width = pyautogui.size()[0]
10 | print("resolution = " + str(width) + ", " + str(height))
11 | window = tk.Tk()
12 | window.title("YouTube Bot")
13 | window.resizable(0,0)
14 | window.configure(background="white")
15 | window.rowconfigure([0], minsize=round(width/96), weight=0)
16 | window.columnconfigure([0,2], minsize=round(width/24), weight=0)
17 | window.columnconfigure(1, minsize=round(width/2.13), weight=0)
18 |
19 | def fetch(x):
20 | import requests as r
21 | res = r.get(f"https://img.youtube.com/vi/{x}/maxresdefault.jpg")
22 | with open("./images/image1.jpg", "wb") as f:
23 | f.write(res.content)
24 |
25 | def filter():
26 | x = url_input.get().strip().split("=")[1].strip().split("&")[0]
27 | if x == "":
28 | print("Can't find image")
29 | return
30 | else:
31 | try:
32 | fetch(x)
33 | global img0
34 | img0 = Image.open("./images/image1.jpg")
35 | img0 = img0.resize((round(img0.size[0]*0.7*width/1920), round(img0.size[1]*0.7*width/1920)))
36 | print("thumbnail size -> " + str(img0.size[0]) + ", " + str(img0.size[1]))
37 | img0 = ImageTk.PhotoImage(img0)
38 | thumbnail_frm.configure(image=img0)
39 | except:
40 | print("Permission error: writing to a file")
41 | return
42 |
43 | def duration_split(duration):
44 | hour = 0
45 | min = 0
46 | sec = 0
47 | list = duration.split(":")
48 | hour = int(list[0])
49 | min = int(list[1])
50 | sec = int(list[2])
51 | return hour*3600 + min*60 + sec
52 |
53 |
54 | def start():
55 | dur = dur_entry.get()
56 | loop = loop_entry.get()
57 |
58 | if len(dur.split(":")) == 3:
59 | dur = duration_split(dur)
60 | else:
61 | return
62 | if loop == "":
63 | return
64 | else:
65 | if loop.lower() == "inf":
66 | loop = 999999999
67 | else:
68 | try:
69 | loop = int(loop)
70 | except:
71 | return
72 |
73 | while loop:
74 | driver = webdriver.Chrome()
75 | driver.get(url_input.get().strip())
76 | plybtn = driver.find_element_by_class_name("ytp-play-button")
77 | time.sleep(3)
78 | # ---> If the video doesnt start playing within three seconds of opening, then disable this <--- #
79 | plybtn.click()
80 | time.sleep(dur)
81 | driver.close()
82 | loop -= 1
83 |
84 | # ---> IMAGES <--- #
85 | img0 = Image.open("./images/image.jpg")
86 | img0 = img0.resize((round(img0.size[0]*0.7*width/1920), round(img0.size[1]*0.7*width/1920)))
87 | print("img0 size -> " + str(img0.size[0]) + ", " + str(img0.size[1]))
88 | img0 = ImageTk.PhotoImage(img0)
89 | img1 = Image.open("./images/youtubebot.png")
90 | img1 = img1.resize((round(img1.size[0]*0.5*width/1920), round(img1.size[1]*0.5*width/1920)))
91 | print("img1 size -> " + str(img1.size[0]) + ", " + str(img1.size[1]))
92 | img1 = ImageTk.PhotoImage(img1)
93 |
94 | # ---> TITLE OF THE GUI <--- #
95 | title = tk.Label(master=window, image=img1, font=("", 40), bg="white")
96 | title.grid(row=0, column=0, sticky="nsew", pady=5, columnspan=3)
97 |
98 | # ---> DESCRIPTION <--- #
99 | desc = tk.Label(master=window, text = "Increase the number of views on any YouTube video.", font=("aNYTHING", 25), bg="white")
100 | desc.grid(row=1, column=0, pady=(5,30), columnspan=3)
101 |
102 | # ---> URL INPUT <--- #
103 | url_label = tk.Label(master=window, text="URL of the Youtube Video ", font=("", 15), bg="white")
104 | url_label.grid(row=2, column=0, padx=(15, 5), pady=(0, 5))
105 | url_input = ttk.Entry(master=window, font=("", 15))
106 | url_input.grid(row=2, column=1, sticky="ew", pady=(0, 5))
107 | # ---> SUBMIT BUTTON <--- #
108 | style = ttk.Style()
109 | style.configure("TButton", font=("", 15))
110 | url_btn = ttk.Button(style='TButton', master=window, text="Submit", command = filter)
111 | url_btn.grid(row=2, column=2, padx=(3, 15), pady=(0, 5))
112 |
113 | # ---> YOUTUBE THUMBNAIL FRAME <--- #
114 | thumbnail_frm = tk.Label(master=window, image=img0, bg="red")
115 | thumbnail_frm.grid(row=3, column=0, columnspan=3)
116 |
117 | # ---> BOTTOM FRAME <--- #
118 | dur_loop_frm = tk.Frame(master=window, bg="white")
119 | dur_loop_frm.grid(row=4, column=0, columnspan=3, sticky="nsew")
120 | # dur_loop_frm.columnconfigure([0], minsize=430, weight=1)
121 | # dur_loop_frm.columnconfigure([1], minsize=425, weight=1)
122 | # dur_loop_frm.columnconfigure(2, minsize=40, weight=1)
123 | # ---> DURATION <--- #
124 | dur_lbl = tk.Label(master=dur_loop_frm, text="Duration (hour:min:sec) ", font=("", 15), bg="white")
125 | dur_lbl.pack(side="left", pady=10, padx=(15,3))
126 | dur_entry = ttk.Entry(master=dur_loop_frm, font=("", 15))
127 | dur_entry.pack(side="left")
128 | # ---> LOOP <--- #
129 | loop_lbl = tk.Label(master=dur_loop_frm, text="Loops (inf for infinity) ", font=("", 15), bg="white")
130 | loop_lbl.pack(side="left", pady=10, padx=(15,3))
131 | loop_entry = ttk.Entry(master=dur_loop_frm, font=("", 15))
132 | loop_entry.pack(side="left")
133 | # ---> START BUTTON <--- #
134 | dur_loop_btn = ttk.Button(style = "TButton", master=dur_loop_frm, text="Start", command=start)
135 | dur_loop_btn.pack(side="right", padx=15)
136 |
137 | window.mainloop()
--------------------------------------------------------------------------------
/Chrome/chromedriver.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Setiawan007/YouTubeBot/091d5e36f453c2dc47058fe670137cb7ed15f70c/Chrome/chromedriver.exe
--------------------------------------------------------------------------------
/Chrome/images/image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Setiawan007/YouTubeBot/091d5e36f453c2dc47058fe670137cb7ed15f70c/Chrome/images/image.jpg
--------------------------------------------------------------------------------
/Chrome/images/youtubebot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Setiawan007/YouTubeBot/091d5e36f453c2dc47058fe670137cb7ed15f70c/Chrome/images/youtubebot.png
--------------------------------------------------------------------------------
/Firefox/README.md:
--------------------------------------------------------------------------------
1 | # :warning: Driver must be in PATH
2 | Make sure that your driver must be included in **PATH** or else the script will fail to run. I have provided the Web Driver for FireFox (geckodriver.exe). Just add it to the **PATH** and Bob's your uncle.
3 |
--------------------------------------------------------------------------------
/Firefox/YouTubeBot.py:
--------------------------------------------------------------------------------
1 | import tkinter as tk
2 | import tkinter.ttk as ttk
3 | from PIL import Image, ImageTk
4 | from selenium import webdriver
5 | import time
6 | import pyautogui
7 |
8 | height = pyautogui.size()[1]
9 | width = pyautogui.size()[0]
10 | print("resolution = " + str(width) + ", " + str(height))
11 | window = tk.Tk()
12 | window.title("YouTube Bot")
13 |
14 | window.resizable(0, 0)
15 | window.configure(background="white")
16 | window.rowconfigure([0], minsize=round(width / 96), weight=0)
17 | window.columnconfigure([0, 2], minsize=round(width / 24), weight=0)
18 | window.columnconfigure(1, minsize=round(width / 2.13), weight=0)
19 |
20 |
21 | def fetch(x):
22 | import requests as r
23 |
24 | res = r.get(f"https://img.youtube.com/vi/{x}/maxresdefault.jpg")
25 | with open("./images/image1.jpg", "wb") as f:
26 | f.write(res.content)
27 |
28 |
29 | def filter():
30 | x = url_input.get().strip().split("=")[1].strip().split("&")[0]
31 | if x == "":
32 | print("Can't find image")
33 | return
34 | else:
35 | try:
36 | fetch(x)
37 | global img0
38 | img0 = Image.open("./images/image1.jpg")
39 | img0 = img0.resize(
40 | (
41 | round(img0.size[0] * 0.7 * width / 1920),
42 | round(img0.size[1] * 0.7 * width / 1920),
43 | )
44 | )
45 | print("thumbnail size -> " + str(img0.size[0]) + ", " + str(img0.size[1]))
46 | img0 = ImageTk.PhotoImage(img0)
47 | thumbnail_frm.configure(image=img0)
48 | except:
49 | print("Permission error: writing to a file")
50 | return
51 |
52 |
53 | def duration_split(duration):
54 | hour = 0
55 | min = 0
56 | sec = 0
57 | list = duration.split(":")
58 | hour = int(list[0])
59 | min = int(list[1])
60 | sec = int(list[2])
61 | return hour * 3600 + min * 60 + sec
62 |
63 |
64 | def start():
65 | dur = dur_entry.get()
66 | loop = loop_entry.get()
67 |
68 | if len(dur.split(":")) == 3:
69 | dur = duration_split(dur)
70 | else:
71 | return
72 | if loop == "":
73 | return
74 | else:
75 | if loop.lower() == "inf":
76 | loop = 999999999
77 | else:
78 | try:
79 | loop = int(loop)
80 | except:
81 | return
82 |
83 | while loop:
84 | driver = webdriver.Firefox()
85 | driver.get(url_input.get().strip())
86 | plybtn = driver.find_element_by_class_name("ytp-play-button")
87 | time.sleep(3)
88 | # ---> If the video doesnt start playing within three seconds of opening, then disable this <--- #
89 | plybtn.click()
90 | time.sleep(dur)
91 | driver.close()
92 | loop -= 1
93 |
94 |
95 | # ---> IMAGES <--- #
96 | img0 = Image.open("./images/image.jpg")
97 | img0 = img0.resize(
98 | (round(img0.size[0] * 0.7 * width / 1920), round(img0.size[1] * 0.7 * width / 1920))
99 | )
100 | print("img0 size -> " + str(img0.size[0]) + ", " + str(img0.size[1]))
101 | img0 = ImageTk.PhotoImage(img0)
102 | img1 = Image.open("./images/youtubebot.png")
103 | img1 = img1.resize(
104 | (round(img1.size[0] * 0.5 * width / 1920), round(img1.size[1] * 0.5 * width / 1920))
105 | )
106 | print("img1 size -> " + str(img1.size[0]) + ", " + str(img1.size[1]))
107 | img1 = ImageTk.PhotoImage(img1)
108 |
109 | # ---> TITLE OF THE GUI <--- #
110 | title = tk.Label(master=window, image=img1, font=("", 40), bg="white")
111 | title.grid(row=0, column=0, sticky="nsew", pady=5, columnspan=3)
112 |
113 | # ---> DESCRIPTION <--- #
114 | desc = tk.Label(
115 | master=window,
116 | text="Increase the number of views on any YouTube video.",
117 | font=("aNYTHING", 25),
118 | bg="white",
119 | )
120 | desc.grid(row=1, column=0, pady=(5, 30), columnspan=3)
121 |
122 | # ---> URL INPUT <--- #
123 | url_label = tk.Label(
124 | master=window, text="URL of the Youtube Video ", font=("", 15), bg="white"
125 | )
126 | url_label.grid(row=2, column=0, padx=(15, 5), pady=(0, 5))
127 | url_input = ttk.Entry(master=window, font=("", 15))
128 | url_input.grid(row=2, column=1, sticky="ew", pady=(0, 5))
129 | # ---> SUBMIT BUTTON <--- #
130 | style = ttk.Style()
131 | style.configure("TButton", font=("", 15))
132 | url_btn = ttk.Button(style="TButton", master=window, text="Submit", command=filter)
133 | url_btn.grid(row=2, column=2, padx=(3, 15), pady=(0, 5))
134 |
135 | # ---> YOUTUBE THUMBNAIL FRAME <--- #
136 | thumbnail_frm = tk.Label(master=window, image=img0, bg="red")
137 | thumbnail_frm.grid(row=3, column=0, columnspan=3)
138 |
139 | # ---> BOTTOM FRAME <--- #
140 | dur_loop_frm = tk.Frame(master=window, bg="white")
141 | dur_loop_frm.grid(row=4, column=0, columnspan=3, sticky="nsew")
142 | # ---> DURATION <--- #
143 | dur_lbl = tk.Label(
144 | master=dur_loop_frm, text="Duration (hour:min:sec) ", font=("", 15), bg="white"
145 | )
146 | dur_lbl.pack(side="left", pady=10, padx=(15, 3))
147 | dur_entry = ttk.Entry(master=dur_loop_frm, font=("", 15))
148 | dur_entry.pack(side="left")
149 | # ---> LOOP <--- #
150 | loop_lbl = tk.Label(
151 | master=dur_loop_frm, text="Loops (inf for infinity) ", font=("", 15), bg="white"
152 | )
153 | loop_lbl.pack(side="left", pady=10, padx=(15, 3))
154 | loop_entry = ttk.Entry(master=dur_loop_frm, font=("", 15))
155 | loop_entry.pack(side="left")
156 | # ---> START BUTTON <--- #
157 | dur_loop_btn = ttk.Button(
158 | style="TButton", master=dur_loop_frm, text="Start", command=start
159 | )
160 | dur_loop_btn.pack(side="right", padx=15)
161 |
162 | window.mainloop()
163 |
--------------------------------------------------------------------------------
/Firefox/geckodriver.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Setiawan007/YouTubeBot/091d5e36f453c2dc47058fe670137cb7ed15f70c/Firefox/geckodriver.exe
--------------------------------------------------------------------------------
/Firefox/images/image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Setiawan007/YouTubeBot/091d5e36f453c2dc47058fe670137cb7ed15f70c/Firefox/images/image.jpg
--------------------------------------------------------------------------------
/Firefox/images/youtubebot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Setiawan007/YouTubeBot/091d5e36f453c2dc47058fe670137cb7ed15f70c/Firefox/images/youtubebot.png
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 CYBERDEVILZ - YoutubeBot
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # YouTubeBot
2 |
3 | ## Increase views on your videos
4 |
5 | 
6 |
7 | YouTubeBot is an easy to use simple python script that makes use of selenium to automate the process of increasing views on your Youtube Videos.
8 |
9 | ## Requirements
10 |
11 | * Any of the python3 versions may work for you, but we highly recommend using python 3.7+
12 | * Web Browser (Chrome or Firefox)
13 | * Drivers for their respective broswsers.
14 |
15 | We have included the drivers for the browsers in their respective folders. To get further info about drivers, or have any issues , kindly refer to the README.md files in those folders.
16 |
17 | ## Installation and Setup
18 |
19 | - Make sure you have Python3 installed in your system.
20 | - Then install the necessary libraries and modules by typing `pip install -r requirements.txt`
21 | - Download the apt Web Drivers (I have already included the drivers, so no need to worry).
22 | - Add the drivers to the path and you are done!!
23 |
24 | ## Usage
25 | - Add the URL of your YouTube video and hit Submit.
26 | - Add the duration (specify how much time the script should "watch" your video. Format is HH:MM:SS)
27 | - Add the number of times you want to execute the script (mention inf for infinite).
28 | - Finally click on the start button to execute it.
29 |
30 |
31 |
32 |
33 | Thanks for using our YouTubeBot!
34 |
35 |
--------------------------------------------------------------------------------
/log.md:
--------------------------------------------------------------------------------
1 |
2 | Wed Feb 28 19:12:20 UTC 2024
3 | Sun Jun 30 20:15:10 UTC 2024
4 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | requests==2.26.0
2 | selenium==3.141.0
3 | PyAutoGUI==0.9.53
4 | Pillow==9.0.1
5 | black==21.7b0
6 | pre-commit==2.15.0
--------------------------------------------------------------------------------