Giter Site home page Giter Site logo

plal99 / google-meet-bot Goto Github PK

View Code? Open in Web Editor NEW
33.0 2.0 7.0 10.27 MB

The ultimate google meet attender bot, which works on the basis of number of people inside the meeting, rather than a predefined timing, which is how almost everyone makes these bots these days. This google meet attender works automatically and you can implement it in Heroku for daily automatic deployment.

Home Page: https://github.com/plal99/Google-Meet-Bot

License: MIT License

Python 100.00%
selenium-python selenium python google-meet-bot google-meet google google-meet-automation bot meeting twilio

google-meet-bot's Introduction

Google Meet Bot : Online class attender

This is a Google Meet bot I made for attending your classes. This will

  • Join your class when a number of people are already in it (or wait)
  • Leave the class when it reaches a threshold amount of people
  • Notify you when classes are about to end (notifies you each and every step)

You can change the timetable real-time using telegram from your phone. Almost everything can be controlled from telegram.

How it works

Two codes are needed to run to make this code perfect.

  • GoogleMeet.py : This code is made in such a way that, if you run the code before the first class start time, it would wait for the start time and attend all the classes in the temporary timetable.
  • telegramBot.py : This is actually a telegram bot. It can change your time table; do all kinds of stuff by just using some telegram messages. Mainly we are using it to change timetable in the real-time.

Steps to follow:

  1. Run telegramBot.py. Change timetable if needed (before any current class starts obviously).
  2. Run GoogleMeet.py.
  3. Relax !!!

In details

Database

I used sqlite for making a database. There are mainly 3 sets of tables.

  • sub : This contains all the subjects and their corresponding permanent links
  • monday, tuesday, wednesday, thursday, friday: These are permanent timetables each having their corresponding days classes
  • mondayTemp, tuesdayTemp, wednesdayTemp, thursdayTemp, fridayTemp: These are temporary timetables each having their corresponding days classes. If timetable is modified, it is being written here. We overite this temp timetable each time we run the code.

Joining

I used selenium library for automating the joining and leaving part. It logs in to google and then redirects to your google meet link stored in the database. It waits till someone is in the meeting and joins only when a threshold number of people are present.

Leaving

It takes into account how much people are in the meeting per 5 seconds, and the maximum number of people present in the class. It will leave the class when number of people inside it goes below a threshold. It even notifies you when classes are about to end automatically

Telegram bot

By asking /help in the bot you can see all the functionalities it can implement.

/start  :  Start automatic session
/tt day s1 s2 s3 s4 s5 s6  :  Change timetable for anyday
/dtt  :  Drop temp tables
/ctt  :  Create temp tables
/timetable  :  View current day timetable

Notification

This app has many notification architectures present

  • Whatsapp (twilio sandbox) : It will notify everything by whatsapp. You need to have account in twilio and register. It costs about 0.0085$ for 1 message and you'll get 15$ when signing up. If you are a college student then you will have a college mail and then you can register github pro for free and get 50$ in twilio.
  • Discord : I created a channel for me and took the discord webhook. It is free and i'll get all notifications in it
  • Telegram : I created a bot in telegram and notifications come in the form of messages from that bot. You can also make changes to timetable using this telegram API.
  • Notify-run : It send you push notifications to browser

What you have to do:

You have some work to do of course (After doing all those work, you will freeeeee-est person in your class, I guarantee !!!)

  • You have to create a telegram bot and get the TELEGRAM_TOKEN and TELEGRAM_CHAT_ID. How to make a telegram bot
  • If you want discord functionality too, you have to make an account in discord, make a channel, and get the DISCORD_WEBHOOK for that channel.(This is only for notification purposes, telegram is more than enough, but if you want to explore all features, please look around) Start exploring from here
  • For whatsapp custom notifications visit Twilio. I am not much interested in this because, whatsapp do not have any api features till now and they are current provided by twilio sandbox for experimentation. So they have some issues and I am more than content with telegram. (Please check it out if you are interested in learning stuff)
  • Create / Make changes to a .env file (I haven't created it in this repository obviously due to privacy reasons.)
  • Change class timings, subject names, and links to suit your classes.
  • Make change to match the your chrome profile of college mail id, so as to remove the need to login using the selenium (I have commented the solution in join() of classes.py) (You have to make changes in __init__ of classes.py in the user-data-dir). I came up with this because, google now has a way to know whether a bot is loggin in or not. So it blocks before you log in. SO if the profile is loaded, google cannot know whether it is a bot or not.
  • Run telegramBot.py prior to the other code. This is not necessary but is essential if first hour is changed.
  • Run GoogleMeet.py some time before your class time (Whenever you want ๐Ÿ˜‰)

I recommend to run it in your PC because, if you need to study (like me ๐Ÿ˜…) you can view it. Deploying to Heroku will take some time. Heroku has some issues. I am using sqlite3 for database purposes. The problem is that Heroku supports sqlite3, but the database will get overwritten with garbage values every 24 hours or so. Heroku's native database support is postgreSQL. So after perfecting my code, I will migrate from sqlite3 to postgreSQL and then it will be heaven my friends.

Install

  • Clone the repository git clone https://github.com/plal99/Google-Meet-Bot.git
  • Install requirements.txt pip install -r requirements.txt

Make necessary changes

  • .env : Make necessary changes to the env files so as to fit your personal details requirements(username, password, tokens, chatid, class links).
  • Change the dbStuff.py so as to fit your class requirements requirements. This means changing
    • Links to all the classes (links should be in the .env file)
    • Class timings (in createTimeTable() and createTempTimeTable() functions)
    • Class subjects (Make sure you name all subjects consistently)
  • This currently joins a class when there are atleast 5 people and leaves the class when less than 15 people, warns you of class getting over when more than 10 people leave the class. So you are covered from all sides. So make changes in class.py (JOIN_PEOPLE and LEAVE_PEOPLE)

Disclaimer

Don't use this project to automate your classes. See this project only as a way of understanding how automation works and how it can even be implemented in your day to day life. I will never promote anyone to use this for attending online classes nor use it myself.

Classes are important and respect your teachers ๐Ÿ™‚.

google-meet-bot's People

Contributors

plal99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

google-meet-bot's Issues

Adding feature of joining class from the link the teachers comments?

Hello dev!

It is definitely a very nice thing you have put up here!

Though I want to know if you are able to add the feature in the script of clicking on the link below the class stream page title when the teacher comments it.

Since mine doesn't post them until the last minute, so maybe the script can reload the page until the link pops up under the title?

Please let me know if that is possible, since I don't know python myself.
And if it is, would you mind adding it to the script?

Thank you so much for putting this amazing automation script up!

please make deploy to heroku button

hi plal,
please make this claimer to deployable to heroku with all env value must be set & heroku buildpacks needed
waiting for your response
finest regards

Helping each other

Hey, i think your script is very good. I have myself been working on a similar script for zoom that's working great but i want to fine tune it adding somethings and maybe you know help each other a bit. Do you think you could maybe lend me a hand by contacting on telegram?
here's my handle of telegram @remand57
Hope to hear from you , Soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.