Esempio n. 1
0
def enable_schedule(update, context):
    context.bot.send_chat_action(chat_id=update.message.chat_id, action=ChatAction.TYPING)
    if Config.SCHEDULE == 'True':
        context.bot.send_message(chat_id=update.message.chat_id, text="Scheduler is already Enabled")
    if Config.SCHEDULE == 'False':
        try:
            browser.get('https://id.heroku.com/login')
            browser.find_element_by_id('email').send_keys(usernameStr)
            browser.find_element_by_id('password').send_keys(passwordStr)
            browser.find_element_by_xpath('//*[@id="login"]/form/button').click()
            time.sleep(7)
            browser.get('https://dashboard.heroku.com/apps/' + appnameStr + '/settings')
            time.sleep(5)
            browser.find_element_by_xpath('/html/body/div[5]/main/div[2]/div[2]/ul/li[2]/div/div[2]/div/button').click()
            time.sleep(3)
            browser.find_element_by_xpath('//body').send_keys(Keys.PAGE_DOWN)
            time.sleep(3)
            browser.find_element_by_xpath('/html/body/div[5]/main/div[2]/div[2]/ul/li[2]/div/div[2]/div/div/form/table/tbody/tr[5]/td[3]/button[1]').click()
            time.sleep(3)
            schedule = browser.find_element_by_id('config-var-value')
            schedule.clear()
            schedule.send_keys('True')
            browser.find_element_by_xpath('/html/body/div[2]/div/div/div[3]/button[2]').click()
            context.bot.send_message(chat_id=update.message.chat_id, text="Enabled Schedule!")
            browser.quit()
            execl(executable, executable, "chromium.py")
        except Exception as e:
            print(str(e))
            context.bot.send_message(chat_id=update.message.chat_id, text="Server Down. Check with Admin")
Esempio n. 2
0
	def students(context):
		number = browser.find_element_by_xpath('//*[@id="ow3"]/div[1]/div/div[7]/div[3]/div[6]/div[3]/div/div[2]/div[1]/span/span/div/div/span[2]').text
		if(int(number) <10):
			context.bot.send_message(chat_id=451311925, text="Your Class has ended!")
			browser.find_element_by_xpath('//*[@id="ow3"]/div[1]/div/div[7]/div[3]/div[9]/div[2]/div[2]/div').click()
			browser.quit()
			execl(executable, executable, "chromium.py")
Esempio n. 3
0
def zoomexit(update, context):
    context.bot.send_message(chat_id=451311925, text="Exiting Zoom Meeting")
    browser.find_element_by_xpath(
        '//*[@id="wc-container-left"]/div[4]/div/div/div/div[1]').click()
    browser.find_element_by_xpath(
        '//*[@id="wc-footer"]/div/div[3]/div/button').click()
    browser.quit()
    execl(executable, executable, "chromium.py")
Esempio n. 4
0
def meetexit(update, context):
    context.bot.send_message(chat_id=update.message.chat_id,
                             text="Exiting meeting")
    browser.find_element_by_xpath(
        '//*[@id="ow3"]/div[1]/div/div[7]/div[3]/div[9]/div[2]/div[2]/div'
    ).click()
    browser.quit()
    execl(executable, executable, "chromium.py")
Esempio n. 5
0
 def students(context):
     try:
         number = WebDriverWait(browser, 2400).until(
             EC.presence_of_element_located((
                 By.XPATH,
                 '//*[@id="ow3"]/div[1]/div/div[8]/div[3]/div[6]/div[3]/div/div[2]/div[1]/span/span/div/div/span[2]'
             ))).text
     except:
         return
     print(number)
     if (int(number) < 10):
         context.bot.send_message(chat_id=userId,
                                  text="Your Class has ended!")
         browser.quit()
         execl(executable, executable, "chromium.py")
Esempio n. 6
0
    def students(context):
        print("Running Student Check")

        browser.find_element_by_xpath(
            '//*[@id="wc-container-left"]/div[4]/div/div/div/div[1]').click()
        number = WebDriverWait(browser, 2400).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="wc-footer"]/div/div[2]/button[1]/div/div/span'
                 ))).text
        print(number)
        if (int(number) < 10):
            context.bot.send_message(chat_id=userId,
                                     text="Your Class has ended!")
            browser.quit()
            execl(executable, executable, "chromium.py")
Esempio n. 7
0
 def students(context):
     browser.find_element_by_xpath(
         '//*[@id="wc-container-left"]/div[4]/div/div/div/div[1]').click()
     number = browser.find_element_by_xpath(
         '//*[@id="wc-footer"]/div/div[2]/button[1]/div/div/span').text
     print(number)
     if (int(number) < 10):
         context.bot.send_message(chat_id=451311925,
                                  text="Your Class has ended!")
         browser.find_element_by_xpath(
             '//*[@id="wc-container-left"]/div[4]/div/div/div/div[1]'
         ).click()
         browser.find_element_by_xpath(
             '//*[@id="wc-footer"]/div/div[3]/div/button').click()
         browser.quit()
         execl(executable, executable, "chromium.py")
Esempio n. 8
0
 def audioexit(context):
     global k
     global audio
     k+=1
     if(audio != "Unmute"):
         try:
             browser.find_element_by_xpath('//*[@id="root"]/div/div[2]/div/div/div/div[1]/span').text
         except:
             browser.refresh()
             time.sleep(10)
             try:
                 browser.find_element_by_xpath('//*[@id="voip-tab"]/div/button').click()
                 time.sleep(2)
                 browser.find_element_by_xpath('//*[@id="wc-footer"]/div/div[2]/button[1]').click()
                 time.sleep(3)
                 while(audio != "Unmute"):
                     audio = str(browser.find_element_by_xpath('//*[@id="wc-container-right"]/div/div[2]/div/button[2]').text)
                     if(audio == "Mute"):
                         browser.find_element_by_xpath('//*[@id="wc-container-right"]/div/div[2]/div/button[2]').click()
                         time.sleep(5)
                 browser.save_screenshot("ss.png")
                 context.bot.send_chat_action(chat_id=userId, action=ChatAction.UPLOAD_PHOTO)
                 context.bot.send_photo(chat_id=userId, photo=open('ss.png', 'rb'), caption="Joinied with Audio", timeout = 120).message_id
                 os.remove('ss.png')
             except:
                 logging.info("Waiting For Meeting..!")
         finally:
             if(k>=20):
                 try:
                     browser.save_screenshot("ss.png")
                     context.bot.send_photo(chat_id=userId, photo=open('ss.png', 'rb'), caption="Meeting after " + str(k) + " minutes" , timeout = 120).message_id
                     os.remove('ss.png')
                 finally:
                     context.bot.send_message(chat_id=userId, text="Seems Like This Meeting is Not now. \nExiting..!!")
                     browser.quit()
                     execl(executable, executable, "chromium.py")
                     browser.refresh()
                     time.sleep(10)
     elif(k>=40):
         try:
             browser.save_screenshot("ss.png")
             context.bot.send_photo(chat_id=userId, photo=open('ss.png', 'rb'),caption="Meeting after " + str(k) + " minutes" , timeout = 120).message_id
             os.remove('ss.png')
         finally:
             context.bot.send_message(chat_id=userId, text="Exiting..!!")
             browser.quit()
             execl(executable, executable, "chromium.py")
Esempio n. 9
0
def exit(update, context):
    context.bot.send_chat_action(chat_id=update.message.chat_id, action=ChatAction.TYPING)
    try:
        browser.find_element_by_xpath('//html').click()
        time.sleep(3)
        browser.find_element_by_xpath('//*[@id="wc-footer"]/div/div[3]/div/button').click()
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="wc-footer"]/div[2]/div[2]/div[3]/div/div/button').click()
        time.sleep(2)
    except:
        pass
    browser.save_screenshot("ss.png")
    context.bot.send_chat_action(chat_id=update.message.chat_id, action=ChatAction.UPLOAD_PHOTO)
    context.bot.send_photo(chat_id=update.message.chat_id, photo=open('ss.png', 'rb'),caption="Exiting..!!", timeout = 120)
    os.remove('ss.png')
    browser.quit()
    execl(executable, executable, "chromium.py")
Esempio n. 10
0
def joinZoom(context, url_meet, passStr, userId):
    def audioexit(context):
        global k
        global audio
        k+=1
        if(audio != "Unmute"):
            try:
                browser.find_element_by_xpath('//*[@id="root"]/div/div[2]/div/div/div/div[1]/span').text
            except:
                browser.refresh()
                time.sleep(10)
                try:
                    browser.find_element_by_xpath('//*[@id="voip-tab"]/div/button').click()
                    time.sleep(2)
                    browser.find_element_by_xpath('//*[@id="wc-footer"]/div/div[2]/button[1]').click()
                    time.sleep(3)
                    while(audio != "Unmute"):
                        audio = str(browser.find_element_by_xpath('//*[@id="wc-container-right"]/div/div[2]/div/button[2]').text)
                        if(audio == "Mute"):
                            browser.find_element_by_xpath('//*[@id="wc-container-right"]/div/div[2]/div/button[2]').click()
                            time.sleep(5)
                    browser.save_screenshot("ss.png")
                    context.bot.send_chat_action(chat_id=userId, action=ChatAction.UPLOAD_PHOTO)
                    context.bot.send_photo(chat_id=userId, photo=open('ss.png', 'rb'), caption="Joinied with Audio", timeout = 120).message_id
                    os.remove('ss.png')
                except:
                    logging.info("Waiting For Meeting..!")
            finally:
                if(k>=20):
                    try:
                        browser.save_screenshot("ss.png")
                        context.bot.send_photo(chat_id=userId, photo=open('ss.png', 'rb'), caption="Meeting after " + str(k) + " minutes" , timeout = 120).message_id
                        os.remove('ss.png')
                    finally:
                        context.bot.send_message(chat_id=userId, text="Seems Like This Meeting is Not now. \nExiting..!!")
                        browser.quit()
                        execl(executable, executable, "chromium.py")
                        browser.refresh()
                        time.sleep(10)
        elif(k>=40):
            try:
                browser.save_screenshot("ss.png")
                context.bot.send_photo(chat_id=userId, photo=open('ss.png', 'rb'),caption="Meeting after " + str(k) + " minutes" , timeout = 120).message_id
                os.remove('ss.png')
            finally:
                context.bot.send_message(chat_id=userId, text="Exiting..!!")
                browser.quit()
                execl(executable, executable, "chromium.py")
    try:
        context.bot.send_chat_action(chat_id=userId, action=ChatAction.TYPING)
        browser.get('https://zoom.us/facebook_oauth_signin')
        browser.find_element_by_id('email').send_keys(usernameStr)
        browser.find_element_by_id('pass').send_keys(passwordStr)
        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=userId, action=ChatAction.UPLOAD_PHOTO)
        context.bot.send_photo(chat_id=userId, photo=open('ss.png', 'rb'), timeout = 120).message_id
        os.remove('ss.png')
        browser.find_element_by_id('loginbutton').click()
        time.sleep(4)
        try:
            browser.find_element_by_xpath('//*[@id="platformDialogForm"]/div[2]/table/tbody/tr/td[1]/table/tbody/tr/td[2]/button[2]').click()
        except:
            pass
        time.sleep(4)
        context.bot.send_message(chat_id=userId, text="Logged In!")
        browser.get('https://zoom.us/wc/join/'+ url_meet+ '?action=join&pwd='+ passStr)
        time.sleep(5)
        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=userId, action=ChatAction.UPLOAD_PHOTO)
        context.bot.send_photo(chat_id=userId, photo=open('ss.png', 'rb'), timeout = 120).message_id
        os.remove('ss.png')
        browser.find_element_by_xpath('//*[@id="joinBtn"]').click()
        time.sleep(5)
        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=userId, action=ChatAction.UPLOAD_PHOTO)
        context.bot.send_photo(chat_id=userId, photo=open('ss.png', 'rb'), caption="Attending Your Meeting", timeout = 120).message_id
        os.remove('ss.png')
    except Exception as e:
        context.bot.send_message(chat_id=userId, text="Error Occurred Please Check")
        print(str(e))
        browser.quit()
        execl(executable, executable, "chromium.py")
    logging.info("Success")
    j = updater.job_queue
    j.run_repeating(audioexit, 60, 0)
Esempio n. 11
0
def restart(update, context):
    restart_message = context.bot.send_message(chat_id=update.message.chat_id,
                                               text="Restarting, Please wait!")
    # Save restart message object in order to reply to it after restarting
    browser.quit()
    execl(executable, executable, "chromium.py")
Esempio n. 12
0
def zoom(update, context):
    logging.info("DOING")

    def students(context):
        browser.find_element_by_xpath(
            '//*[@id="wc-container-left"]/div[4]/div/div/div/div[1]').click()
        number = browser.find_element_by_xpath(
            '//*[@id="wc-footer"]/div/div[2]/button[1]/div/div/span').text
        print(number)
        if (int(number) < 10):
            context.bot.send_message(chat_id=451311925,
                                     text="Your Class has ended!")
            browser.find_element_by_xpath(
                '//*[@id="wc-container-left"]/div[4]/div/div/div/div[1]'
            ).click()
            browser.find_element_by_xpath(
                '//*[@id="wc-footer"]/div/div[3]/div/button').click()
            browser.quit()
            execl(executable, executable, "chromium.py")

    try:
        context.bot.send_chat_action(chat_id=update.message.chat_id,
                                     action=ChatAction.TYPING)

        usernameStr = Config.GUSERNAME
        passwordStr = Config.GPASSWORD

        url_meet = update.message.text.split()[1]
        passStr = update.message.text.split()[2]

        if os.path.exists("zoom.pkl"):
            cookies = pickle.load(open("zoom.pkl", "rb"))
            browser.get(
                'https://accounts.google.com/o/oauth2/auth/identifier?client_id=717762328687-iludtf96g1hinl76e4lc1b9a82g457nn.apps.googleusercontent.com&scope=profile%20email&redirect_uri=https%3A%2F%2Fstackauth.com%2Fauth%2Foauth2%2Fgoogle&state=%7B%22sid%22%3A1%2C%22st%22%3A%2259%3A3%3Abbc%2C16%3Afad07e7074c3d678%2C10%3A1601127482%2C16%3A9619c3b16b4c5287%2Ca234368b2cab7ca310430ff80f5dd20b5a6a99a5b85681ce91ca34820cea05c6%22%2C%22cdl%22%3Anull%2C%22cid%22%3A%22717762328687-iludtf96g1hinl76e4lc1b9a82g457nn.apps.googleusercontent.com%22%2C%22k%22%3A%22Google%22%2C%22ses%22%3A%22d18871cbc2a3450c8c4114690c129bde%22%7D&response_type=code&flowName=GeneralOAuthFlow'
            )
            for cookie in cookies:
                browser.add_cookie(cookie)
        else:
            browser.get(
                'https://accounts.google.com/o/oauth2/auth/identifier?client_id=717762328687-iludtf96g1hinl76e4lc1b9a82g457nn.apps.googleusercontent.com&scope=profile%20email&redirect_uri=https%3A%2F%2Fstackauth.com%2Fauth%2Foauth2%2Fgoogle&state=%7B%22sid%22%3A1%2C%22st%22%3A%2259%3A3%3Abbc%2C16%3Afad07e7074c3d678%2C10%3A1601127482%2C16%3A9619c3b16b4c5287%2Ca234368b2cab7ca310430ff80f5dd20b5a6a99a5b85681ce91ca34820cea05c6%22%2C%22cdl%22%3Anull%2C%22cid%22%3A%22717762328687-iludtf96g1hinl76e4lc1b9a82g457nn.apps.googleusercontent.com%22%2C%22k%22%3A%22Google%22%2C%22ses%22%3A%22d18871cbc2a3450c8c4114690c129bde%22%7D&response_type=code&flowName=GeneralOAuthFlow'
            )
            username = browser.find_element_by_id('identifierId')
            username.send_keys(usernameStr)
            nextButton = browser.find_element_by_id('identifierNext')
            nextButton.click()
            time.sleep(7)

            browser.save_screenshot("ss.png")
            context.bot.send_chat_action(chat_id=update.message.chat_id,
                                         action=ChatAction.UPLOAD_PHOTO)
            mid = context.bot.send_photo(chat_id=update.message.chat_id,
                                         photo=open('ss.png', 'rb'),
                                         timeout=120).message_id
            os.remove('ss.png')

            password = browser.find_element_by_xpath(
                "//input[@class='whsOnd zHQkBf']")
            password.send_keys(passwordStr)
            signInButton = browser.find_element_by_id('passwordNext')
            signInButton.click()
            time.sleep(7)

            if (browser.find_elements_by_xpath(
                    '//*[@id="authzenNext"]/div/button/div[2]')):
                context.bot.send_chat_action(chat_id=update.message.chat_id,
                                             action=ChatAction.TYPING)
                context.bot.send_message(
                    chat_id=update.message.chat_id,
                    text="Need Verification. Please Verify")
                browser.find_element_by_xpath(
                    '//*[@id="authzenNext"]/div/button/div[2]').click()
                time.sleep(5)

                browser.save_screenshot("ss.png")
                context.bot.send_chat_action(chat_id=update.message.chat_id,
                                             action=ChatAction.UPLOAD_PHOTO)
                mid = context.bot.send_photo(chat_id=update.message.chat_id,
                                             photo=open('ss.png', 'rb'),
                                             timeout=120).message_id
                os.remove('ss.png')
                time.sleep(20)

            browser.get('https://zoom.us/google_oauth_signin')
            time.sleep(7)

            pickle.dump(browser.get_cookies(), open("zoom.pkl", "wb"))

            context.bot.send_message(chat_id=update.message.chat_id,
                                     text="Logged In!")

        browser.get('https://zoom.us/wc/join/' + url_meet)

        time.sleep(5)
        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=update.message.chat_id,
                                     action=ChatAction.UPLOAD_PHOTO)
        mid = context.bot.send_photo(chat_id=update.message.chat_id,
                                     photo=open('ss.png', 'rb'),
                                     caption="Test",
                                     timeout=120).message_id
        os.remove('ss.png')

        browser.find_element_by_xpath('//*[@id="joinBtn"]').click()
        time.sleep(5)
        browser.find_element_by_xpath('//*[@id="inputpasscode"]').send_keys(
            passStr)
        browser.find_element_by_xpath('//*[@id="joinBtn"]').click()

        time.sleep(10)

        context.bot.delete_message(chat_id=update.message.chat_id,
                                   message_id=mid)

        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=update.message.chat_id,
                                     action=ChatAction.UPLOAD_PHOTO)
        mid = context.bot.send_photo(chat_id=update.message.chat_id,
                                     photo=open('ss.png', 'rb'),
                                     timeout=120).message_id
        os.remove('ss.png')

        time.sleep(5)
        browser.find_element_by_xpath('//*[@id="voip-tab"]/div/button').click()

        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="wc-footer"]/div/div[2]/button[1]').click()

        time.sleep(2)
        # browser.find_element_by_xpath('//*[@id="participant-window"]/div[2]/div/div/div[2]/div/button[2]').click()
        browser.find_element_by_xpath(
            '//*[@id="wc-container-right"]/div/div[2]/div/button[2]').click()

        context.bot.send_chat_action(chat_id=update.message.chat_id,
                                     action=ChatAction.TYPING)
        context.bot.send_message(
            chat_id=update.message.chat_id,
            text="Attending you lecture. You can chill :v")
        logging.info("STAAAAPH!!")

    except Exception as e:
        browser.quit()
        context.bot.send_message(chat_id=update.message.chat_id,
                                 text="Error occurred! Fix error and retry!")
        context.bot.send_message(chat_id=update.message.chat_id, text=str(e))
        execl(executable, executable, "chromium.py")

    j = updater.job_queue
    j.run_repeating(students, 1000, 20)
Esempio n. 13
0
def joinMeet(context, url_meet):
    def students(context):
        try:
            number = WebDriverWait(browser, 2400).until(
                EC.presence_of_element_located((
                    By.XPATH,
                    '//*[@id="ow3"]/div[1]/div/div[8]/div[3]/div[6]/div[3]/div/div[2]/div[1]/span/span/div/div/span[2]'
                ))).text
        except:
            return
        print(number)
        if (int(number) < 10):
            context.bot.send_message(chat_id=userId,
                                     text="Your Class has ended!")
            browser.quit()
            execl(executable, executable, "chromium.py")

    try:
        if os.path.exists("meet.pkl"):
            cookies = pickle.load(open("meet.pkl", "rb"))
            browser.get('https://apps.google.com/meet/')
            for cookie in cookies:
                browser.add_cookie(cookie)

        else:
            context.bot.send_message(
                chat_id=userId,
                text=
                "You're not logged in please run /mlogin command to login. Then try again!"
            )
            return

        browser.get(url_meet)
        time.sleep(3)

        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=userId,
                                     action=ChatAction.UPLOAD_PHOTO)
        mid = context.bot.send_photo(chat_id=userId,
                                     photo=open('ss.png', 'rb'),
                                     timeout=120).message_id
        os.remove('ss.png')

        if (browser.find_elements_by_xpath(
                '//*[@id="yDmH0d"]/div[3]/div/div[2]/div[3]/div')):
            browser.find_element_by_xpath(
                '//*[@id="yDmH0d"]/div[3]/div/div[2]/div[3]/div').click()
            time.sleep(3)

            context.bot.delete_message(chat_id=userId, message_id=mid)

            browser.save_screenshot("ss.png")
            context.bot.send_chat_action(chat_id=userId,
                                         action=ChatAction.UPLOAD_PHOTO)
            mid = context.bot.send_photo(chat_id=userId,
                                         photo=open('ss.png', 'rb'),
                                         timeout=120).message_id
            os.remove('ss.png')
        try:
            browser.find_element_by_xpath(
                "//span[@class='NPEfkd RveJvd snByac' and contains(text(), 'Ask to join')]"
            ).click()
            time.sleep(10)
        except:
            browser.find_element_by_xpath(
                "//span[@class='NPEfkd RveJvd snByac' and contains(text(), 'Join now')]"
            ).click()
            time.sleep(10)

        context.bot.delete_message(chat_id=userId, message_id=mid)

        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=userId,
                                     action=ChatAction.UPLOAD_PHOTO)
        mid = context.bot.send_photo(chat_id=userId,
                                     photo=open('ss.png', 'rb'),
                                     timeout=120).message_id
        os.remove('ss.png')
        time.sleep(5)

        context.bot.delete_message(chat_id=userId, message_id=mid)
        time.sleep(10)

        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=userId,
                                     action=ChatAction.UPLOAD_PHOTO)
        mid = context.bot.send_photo(chat_id=userId,
                                     photo=open('ss.png', 'rb'),
                                     timeout=120).message_id
        os.remove('ss.png')

        context.bot.send_chat_action(chat_id=userId, action=ChatAction.TYPING)
        context.bot.send_message(
            chat_id=userId, text="Attending your lecture. You can chill :v")
        logging.info("STAAAAPH!!")
    except Exception as e:
        browser.quit()
        context.bot.send_message(chat_id=userId,
                                 text="Error occurred! Fix error and retry!")
        context.bot.send_message(chat_id=userId, text=str(e))
        execl(executable, executable, "chromium.py")

    j = updater.job_queue
    j.run_repeating(students, 20, 1000)
Esempio n. 14
0
def joinZoom(context, url_meet, passStr):
    def students(context):
        print("Running Student Check")

        browser.find_element_by_xpath(
            '//*[@id="wc-container-left"]/div[4]/div/div/div/div[1]').click()
        number = WebDriverWait(browser, 2400).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="wc-footer"]/div/div[2]/button[1]/div/div/span'
                 ))).text

        print(number)
        if (int(number) < 10):
            context.bot.send_message(chat_id=userId,
                                     text="Your Class has ended!")
            browser.quit()
            execl(executable, executable, "chromium.py")

    try:
        if os.path.exists("zoom.pkl"):
            cookies = pickle.load(open("zoom.pkl", "rb"))
            browser.get(
                'https://accounts.google.com/o/oauth2/auth/identifier?client_id=717762328687-iludtf96g1hinl76e4lc1b9a82g457nn.apps.googleusercontent.com&scope=profile%20email&redirect_uri=https%3A%2F%2Fstackauth.com%2Fauth%2Foauth2%2Fgoogle&state=%7B%22sid%22%3A1%2C%22st%22%3A%2259%3A3%3Abbc%2C16%3Afad07e7074c3d678%2C10%3A1601127482%2C16%3A9619c3b16b4c5287%2Ca234368b2cab7ca310430ff80f5dd20b5a6a99a5b85681ce91ca34820cea05c6%22%2C%22cdl%22%3Anull%2C%22cid%22%3A%22717762328687-iludtf96g1hinl76e4lc1b9a82g457nn.apps.googleusercontent.com%22%2C%22k%22%3A%22Google%22%2C%22ses%22%3A%22d18871cbc2a3450c8c4114690c129bde%22%7D&response_type=code&flowName=GeneralOAuthFlow'
            )
            for cookie in cookies:
                browser.add_cookie(cookie)
        else:
            context.bot.send_message(
                chat_id=userId,
                text="You're not logged in! Send /zlogin to login to zoom")
            return

        browser.get('https://zoom.us/wc/join/' + url_meet)
        time.sleep(5)
        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=userId,
                                     action=ChatAction.UPLOAD_PHOTO)
        mid = context.bot.send_photo(chat_id=userId,
                                     photo=open('ss.png', 'rb'),
                                     timeout=120).message_id
        os.remove('ss.png')

        browser.find_element_by_xpath('//*[@id="joinBtn"]').click()
        time.sleep(5)
        try:
            WebDriverWait(browser, 2400).until(
                EC.element_to_be_clickable(
                    (By.XPATH, '//*[@id="inputpasscode"]'))).send_keys(passStr)
        except:
            context.bot.send_message(
                "Meeting didn't start. Probably Cancelled")

        browser.find_element_by_xpath('//*[@id="joinBtn"]').click()

        time.sleep(10)

        context.bot.delete_message(chat_id=userId, message_id=mid)

        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=userId,
                                     action=ChatAction.UPLOAD_PHOTO)
        mid = context.bot.send_photo(chat_id=userId,
                                     photo=open('ss.png', 'rb'),
                                     timeout=120).message_id
        os.remove('ss.png')

        WebDriverWait(browser, 1000).until(
            EC.element_to_be_clickable(
                (By.XPATH, '//*[@id="voip-tab"]/div/button'))).click()

        WebDriverWait(browser, 1000).until(
            EC.element_to_be_clickable(
                (By.XPATH,
                 '//*[@id="wc-footer"]/div/div[2]/button[1]'))).click()

        WebDriverWait(browser, 1000).until(
            EC.element_to_be_clickable(
                (By.XPATH,
                 '//*[@id="wc-container-right"]/div/div[2]/div/button[2]'
                 ))).click()

        context.bot.send_chat_action(chat_id=userId, action=ChatAction.TYPING)
        context.bot.send_message(
            chat_id=userId, text="Attending you lecture. You can chill :v")
        logging.info("STAAAAPH!!")

    except Exception as e:
        browser.quit()
        context.bot.send_message(chat_id=userId,
                                 text="Error occurred! Fix error and retry!")
        context.bot.send_message(chat_id=userId, text=str(e))
        execl(executable, executable, "chromium.py")

    j = updater.job_queue
    j.run_repeating(students, 20, 1000)
Esempio n. 15
0
def exit(update, context):
    context.bot.send_message(chat_id=userId, text="Restarting bot, Please wait!")
    browser.quit()
    execl(executable, executable, "chromium.py")
Esempio n. 16
0
def joinMeet(context, url_meet):
    def students(context):
        try:
            number = WebDriverWait(browser, 2400).until(
                EC.presence_of_element_located((
                    By.XPATH,
                    '//*[@id="ow3"]/div[1]/div/div[8]/div[3]/div[6]/div[3]/div/div[2]/div[1]/span/span/div/div/span[2]'
                ))).text
        except:
            return
        print(number)
        if (int(number) < 10):
            context.bot.send_message(chat_id=userId,
                                     text="Your Class has ended!")
            browser.quit()
            execl(executable, executable, "chromium.py")

    try:
        if os.path.exists("meet.pkl"):
            cookies = pickle.load(open("meet.pkl", "rb"))
            browser.get(
                'https://accounts.google.com/o/oauth2/auth/identifier?client_id=717762328687-iludtf96g1hinl76e4lc1b9a82g457nn.apps.googleusercontent.com&scope=profile%20email&redirect_uri=https%3A%2F%2Fstackauth.com%2Fauth%2Foauth2%2Fgoogle&state=%7B%22sid%22%3A1%2C%22st%22%3A%2259%3A3%3Abbc%2C16%3Afad07e7074c3d678%2C10%3A1601127482%2C16%3A9619c3b16b4c5287%2Ca234368b2cab7ca310430ff80f5dd20b5a6a99a5b85681ce91ca34820cea05c6%22%2C%22cdl%22%3Anull%2C%22cid%22%3A%22717762328687-iludtf96g1hinl76e4lc1b9a82g457nn.apps.googleusercontent.com%22%2C%22k%22%3A%22Google%22%2C%22ses%22%3A%22d18871cbc2a3450c8c4114690c129bde%22%7D&response_type=code&flowName=GeneralOAuthFlow'
            )
            for cookie in cookies:
                browser.add_cookie(cookie)

        else:
            context.bot.send_message(
                chat_id=userId,
                text=
                "You're not logged in please run /mlogin command to login. Then try again!"
            )
            return

        browser.get(url_meet)
        time.sleep(3)

        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=userId,
                                     action=ChatAction.UPLOAD_PHOTO)
        mid = context.bot.send_photo(chat_id=userId,
                                     photo=open('ss.png', 'rb'),
                                     timeout=120).message_id
        os.remove('ss.png')

        if (browser.find_elements_by_xpath(
                '//*[@id="yDmH0d"]/div[3]/div/div[2]/div[3]/div')):
            browser.find_element_by_xpath(
                '//*[@id="yDmH0d"]/div[3]/div/div[2]/div[3]/div').click()
            time.sleep(3)

            context.bot.delete_message(chat_id=userId, message_id=mid)

            browser.save_screenshot("ss.png")
            context.bot.send_chat_action(chat_id=userId,
                                         action=ChatAction.UPLOAD_PHOTO)
            mid = context.bot.send_photo(chat_id=userId,
                                         photo=open('ss.png', 'rb'),
                                         timeout=120).message_id
            os.remove('ss.png')
        try:
            browser.find_element_by_xpath(
                "//span[@class='NPEfkd RveJvd snByac' and contains(text(), 'Ask to join')]"
            ).click()
            time.sleep(10)
        except:
            browser.find_element_by_xpath(
                "//span[@class='NPEfkd RveJvd snByac' and contains(text(), 'Join now')]"
            ).click()
            time.sleep(10)

        context.bot.delete_message(chat_id=userId, message_id=mid)

        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=userId,
                                     action=ChatAction.UPLOAD_PHOTO)
        mid = context.bot.send_photo(chat_id=userId,
                                     photo=open('ss.png', 'rb'),
                                     timeout=120).message_id
        os.remove('ss.png')
        time.sleep(5)

        context.bot.delete_message(chat_id=userId, message_id=mid)
        time.sleep(10)

        browser.save_screenshot("ss.png")
        context.bot.send_chat_action(chat_id=userId,
                                     action=ChatAction.UPLOAD_PHOTO)
        mid = context.bot.send_photo(chat_id=userId,
                                     photo=open('ss.png', 'rb'),
                                     timeout=120).message_id
        os.remove('ss.png')

        context.bot.send_chat_action(chat_id=userId, action=ChatAction.TYPING)
        context.bot.send_message(
            chat_id=userId, text="Attending your lecture. You can chill :v")
        logging.info("STAAAAPH!!")
    except Exception as e:
        browser.quit()
        context.bot.send_message(chat_id=userId,
                                 text="Error occurred! Fix error and retry!")
        context.bot.send_message(chat_id=userId, text=str(e))
        execl(executable, executable, "chromium.py")

    j = updater.job_queue
    j.run_repeating(students, 20, 1000)