Skip to content

Commit ac13199

Browse files
Add Google Meet Bot (HarshCasper#896)
* Added Gmeet py bot * Addded pep8 style formating * Commenting out Situational case * Add docstring as suggested * fix bot issues/suggestions * Readme update * Add .env file * Add file * Rename Directory to Gmeet_Bot
1 parent 2d57d11 commit ac13199

File tree

3 files changed

+127
-0
lines changed

3 files changed

+127
-0
lines changed

Python/Gmeet_Bot/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Username = "Replace this text with your Username"
2+
Your_password = "Enter Your password here"

Python/Gmeet_Bot/Gmeet_buddy.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Importing Required modules and Libraries
2+
3+
from selenium import webdriver
4+
import schedule,time
5+
import keyboard
6+
from decouple import config
7+
#from selenium.webdriver.common.keys import Keys
8+
from selenium.webdriver.common.action_chains import ActionChains, Options
9+
10+
11+
# joining Credentials
12+
13+
username = config('Username') # Fetching mail id from .env
14+
password = config('Your_password') # Fetching psd from .env
15+
16+
# Saving the path of chrome driver
17+
Driver_path = str(input('Enter your path where the chrome drive is installed:'))
18+
19+
# Providing camera and microphone access to the meeting
20+
21+
opt = Options()
22+
opt.add_argument("--disable-infobars")
23+
opt.add_argument("start-maximized")
24+
opt.add_argument("--disable-extensions")
25+
26+
# Passing the argument "1" to allow and "2" to block
27+
28+
opt.add_experimental_option("prefs", {
29+
"profile.default_content_setting_values.media_stream_mic": 1,
30+
"profile.default_content_setting_values.media_stream_camera": 1,
31+
"profile.default_content_setting_values.notifications": 1
32+
})
33+
# Entering the path of chrome driver
34+
browser = webdriver.Chrome(chrome_options=opt, executable_path=Driver_path)
35+
browser.maximize_window()
36+
action = ActionChains(browser)
37+
38+
39+
def get_into():
40+
'''
41+
Function for entering into meeting as per the google meet interface
42+
'''
43+
44+
keyboard.press_and_release('Tab')
45+
time.sleep(1)
46+
keyboard.press_and_release('Tab')
47+
time.sleep(1)
48+
keyboard.press_and_release('Tab')
49+
time.sleep(1)
50+
keyboard.press_and_release('Tab')
51+
time.sleep(1)
52+
keyboard.press_and_release('Tab')
53+
time.sleep(1)
54+
keyboard.press_and_release('Enter')
55+
56+
57+
def join_classes():
58+
'''
59+
This function will be used to join the google meet
60+
'''
61+
browser.get("https://calendar.google.com/")
62+
browser.find_element_by_name("identifier").send_keys(username)
63+
browser.find_element_by_class_name("VfPpkd-RLmnJb").click()
64+
65+
browser.implicitly_wait(20)
66+
browser.find_element_by_name("password").send_keys(password)
67+
time.sleep(1)
68+
browser.implicitly_wait(40)
69+
browser.find_element_by_class_name("VfPpkd-RLmnJb").click()
70+
71+
browser.implicitly_wait(15)
72+
cursor_location = browser.find_element_by_class_name('h11RHc').location
73+
x = cursor_location['x']
74+
y = cursor_location['y']
75+
action.move_by_offset(x + 20, y).click().perform()
76+
browser.find_element_by_class_name("w1OTme").click()
77+
# Entering Google meet
78+
79+
time.sleep(30)
80+
81+
keyboard.press_and_release('ctrl+e')
82+
keyboard.press_and_release('ctrl+d')
83+
print("Camera And microphone turned off")
84+
browser.implicitly_wait(10)
85+
print("About to join the class")
86+
get_into()
87+
keyboard.press_and_release('Enter')
88+
print("Slid into the meeting successfully")
89+
time.sleep(5)
90+
keyboard.press_and_release('Win+alt+r')
91+
print("meeting Recording Started")
92+
93+
94+
join_classes()
95+
96+
'''
97+
schedule according to your time table and quit the browser according to the time of completion of your class
98+
schedule.every().day.at("09:00").do(join_classes)
99+
100+
while True:
101+
schedule.run_pending()
102+
time.sleep(1)
103+
'''
104+
print("Ready to join the meeting...")

Python/Gmeet_Bot/Readme.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
# Your Meeting Buddy
3+
This buddy will help you to attain any online meetings scheduled on google meet in your absence and will record the meet for you. So as to review/revise whenever required.
4+
5+
## Required Setup
6+
Inorder to automate the meeting process you are required to install the following drivers
7+
8+
## Quick links to the driver:
9+
10+
* [Chrome Driver](https://chromedriver.chromium.org/downloads)
11+
* [Firefox Driver](https://github.com/mozilla/geckodriver/releases)
12+
13+
## How to wake my buddy?
14+
15+
* Download the chrome driver from the above link.
16+
* Create `.env` file containg "Username" and "Your_password"
17+
* Enter the chrome driver path when asked.
18+
* Enter your mail id and password
19+
* & you are all set to go :)
20+
21+
> Made with ❤ , [Yuvraj kadale](https://github.com/Yuvraj-kadale)

0 commit comments

Comments
 (0)