bypass google login protection by using firefox profiles

main
EmaMaker 2021-02-09 09:53:59 +01:00
parent bf27ee95bb
commit eb34efc24a
5 changed files with 26 additions and 93 deletions

View File

@ -3,11 +3,29 @@ A bot to automatically join Google Meet meetings at the correct time
## How it works ## How it works
The bot automates a FireFox session using Python and Selenium.<br> The bot automates a FireFox session using Python, Selenium and the Geckdriver.<br>
It joins the programmed google meetings automatically, with microphone and webcam disabled.<br> It joins the programmed google meetings automatically, with microphone and webcam disabled.<br>
It uses the **schedule** python module to automatically access and close meetings at the given time, it can only join one meeting at the time<br> It uses the **schedule** python module to automatically access and close meetings at the given time, it can only join one meeting at the time<br>
Normally Google Accounts are not allowed to be logged in when using an automated browser, but logging in via stackoverflow.com worksaround this problem<br> Normally Google Accounts are not allowed to be logged in when using an automated browser, and this bot is no exception.
In case this is not working, you can disable such security feature in your google account settings. Some business and enterprise account may not have this problem by default The procedure described in **Using your account** is used to bypass this protection mechanism <br>
## Using your account
This login procedure is needed in order to bypass Google not allowing automated browsers to log in into accounts.<br><br>
**Preparation:**<br>
1. First of all install Mozilla FireFox from <https://www.mozilla.org/en-US/firefox/download/thanks/>.<br>
2. Download and install the Geckdriver for your OS from Mozilla's GitHub repo <https://github.com/mozilla/geckodriver/releases>.<br>
3. If you're using Linux, your package manager may have a package for that, so check that.<br>
4. Replace **FIREFOX_DVD_DIR** in **utils.py** with the path to the GeckoDriver executable you just installed.<br>
**Log in into your Google Account:**<br>
1. Open FireFox and go to *about:profiles*<br>
2. Click *Create a New Profile>Next* name it whatever you want then click *Finish*<br>
3. Search for the profile you just created in the list below, copy the *Root Directory* and paste it into **FIREFOX_PROFILE** into **utils.py**<br>
4. Now FireFox will have made the profile you just created the default one, so set the default profile back to what it was before<br>
5. Go the the profile you just created and click *Launch profile in new browser*. This will open a new FireFox window using your profile.<br>
6. In the new FireFox window just appeared, head over to gmail.com and log in into your Google account.<br>
7. Once logged in, the profile is ready to be used in this bot<br>
## Dependencies ## Dependencies
All python deps are listed in **requirements.txt**, just run<br> All python deps are listed in **requirements.txt**, just run<br>

View File

@ -1,6 +1,5 @@
'''Automatically join Google Meet meetings, with muted camera and mic '''Automatically join Google Meet meetings, with muted camera and mic
Just give link and it joins. Features chat too Can write in chat'''
Planning on adding a schedule system'''
import meetings import meetings
import browser_manager import browser_manager
@ -8,10 +7,6 @@ import schedule
import time import time
browser_manager.initFirefox() browser_manager.initFirefox()
browser_manager.loginIntoGoogleWithStackOverflow()
#while checkStarted() is False:
#browser.sendChatMsg("hello world")
meetings.setup_schedule() meetings.setup_schedule()
while True: while True:

View File

@ -1,83 +0,0 @@
import time as t
import schedule
import browser_manager
''' STORE MEET LINKS HERE'''
MATHS = 'https://meet.google.com/lookup/fn2tkngzid?authuser=0&hs=179'
LITERATURE = 'https://meet.google.com/lookup/bhoqky4qee?authuser=0&hs=179'
ENGLISH = 'https://meet.google.com/lookup/hlj4rhyj4p?authuser=0&hs=179'
ELECTRONICS = 'https://meet.google.com/lookup/ehuwfglxvr?authuser=0&hs=179'
SYSTEMS = ''
TPSEE = 'https://meet.google.com/lookup/bc4r2d32ua?authuser=0&hs=179'
TPSEE_ELT = 'https://meet.google.com/lookup/gdaq3kmguh?authuser=0&hs=179'
TPSEE_SYS = 'https://meet.google.com/lookup/gdaq3kmguh?authuser=0&hs=179'
ELT_SYSTEMS = ''
'''TIME SCHEDULE - START AND FINISH'''
FIRST_HOUR = "8:00"
SECOND_HOUR = "8:50"
THIRD_HOUR = "9:50"
FOURTH_HOUR = "10:50"
FIFTH_HOUR = "11:50"
SIXTH_HOUR = "12:40"
SEVENTH_HOUR = "13:40"
def setup_schedule():
#scheduleMeeting("friday", "20:56", "20:57", "https://meet.google.com/jqn-fgav-aad")
# Monday schedule
scheduleMeeting("monday", FIRST_HOUR, SECOND_HOUR, TPSEE)
scheduleMeeting("monday", SECOND_HOUR, THIRD_HOUR, ENGLISH)
scheduleMeeting("monday", THIRD_HOUR, FOURTH_HOUR, SYSTEMS)
scheduleMeeting("monday", FOURTH_HOUR, FIFTH_HOUR, MATHS)
scheduleMeeting("monday", FIFTH_HOUR, SEVENTH_HOUR, LITERATURE)
# Tuesday schedule
scheduleMeeting("tuesday", FIRST_HOUR, THIRD_HOUR, SYSTEMS)
scheduleMeeting("tuesday", THIRD_HOUR, FIFTH_HOUR, ELECTRONICS)
scheduleMeeting("tuesday", FIFTH_HOUR, SIXTH_HOUR, TPSEE_ELT)
scheduleMeeting("tuesday", SIXTH_HOUR, SEVENTH_HOUR, TPSEE)
# Wednesday schedule
scheduleMeeting("wednesday", FIRST_HOUR, SECOND_HOUR, ELT_SYSTEMS)
scheduleMeeting("wednesday", SECOND_HOUR, THIRD_HOUR, MATHS)
scheduleMeeting("wednesday", THIRD_HOUR, FOURTH_HOUR, LITERATURE)
scheduleMeeting("wednesday", SIXTH_HOUR, SEVENTH_HOUR, LITERATURE)
# Thursday schedule
scheduleMeeting("thursday", FIRST_HOUR, SECOND_HOUR, ELECTRONICS)
scheduleMeeting("thursday", SECOND_HOUR, THIRD_HOUR, ENGLISH)
scheduleMeeting("thursday", FOURTH_HOUR, FIFTH_HOUR, TPSEE)
scheduleMeeting("thursday", FIFTH_HOUR, SIXTH_HOUR, TPSEE_SYS)
scheduleMeeting("thursday", SIXTH_HOUR, SEVENTH_HOUR, SYSTEMS)
# Friday schedule
scheduleMeeting("friday", FIRST_HOUR, SECOND_HOUR, MATHS)
scheduleMeeting("friday", SECOND_HOUR, THIRD_HOUR, ENGLISH)
scheduleMeeting("friday", FOURTH_HOUR, FIFTH_HOUR, LITERATURE)
scheduleMeeting("friday", FIFTH_HOUR, SIXTH_HOUR, LITERATURE)
scheduleMeeting("friday", SIXTH_HOUR, SEVENTH_HOUR, TPSEE)
def scheduleMeeting(day, startHour, endHour, link):
if str(day).lower() == "monday":
schedule.every().monday.at(startHour).do(browser_manager.joinMeeting, link)
schedule.every().monday.at(endHour).do(browser_manager.hangUpMeeting)
elif str(day).lower() == "tuesday":
schedule.every().tuesday.at(startHour).do(browser_manager.joinMeeting, link)
schedule.every().tuesday.at(endHour).do(browser_manager.hangUpMeeting)
elif str(day).lower() == "wednesday":
schedule.every().wednesday.at(startHour).do(browser_manager.joinMeeting, link)
schedule.every().wednesday.at(endHour).do(browser_manager.hangUpMeeting)
elif str(day).lower() == "thursday":
schedule.every().thursday.at(startHour).do(browser_manager.joinMeeting, link)
schedule.every().thursday.at(endHour).do(browser_manager.hangUpMeeting)
elif str(day).lower() == "friday":
schedule.every().friday.at(startHour).do(browser_manager.joinMeeting, link)
schedule.every().friday.at(endHour).do(browser_manager.hangUpMeeting)
elif str(day).lower() == "saturday":
schedule.every().saturday.at(startHour).do(browser_manager.joinMeeting, link)
schedule.every().saturday.at(endHour).do(browser_manager.hangUpMeeting)
elif str(day).lower() == "sunday":
schedule.every().sunday.at(startHour).do(browser_manager.joinMeeting, link)
schedule.every().sunday.at(endHour).do(browser_manager.hangUpMeeting)

View File

@ -1,2 +1,3 @@
selenium selenium==3.141.0
webdriver-manager==3.2.2
schedule schedule

2
utils.py Normal file
View File

@ -0,0 +1,2 @@
FIREFOX_DVD_DIR = '/usr/bin/geckodriver'
FIREFOX_PROFILE = '/home/emamaker/.mozilla/firefox/iuwsro4q.automation'