def status(update, context): 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')
def zlogin(update, context): context.bot.send_chat_action(chat_id=userId, action=ChatAction.TYPING) usernameStr = Config.GUSERNAME passwordStr = Config.GPASSWORD if os.path.exists("zoom.pkl"): context.bot.send_message(chat_id=userId, text="Already logged in! Send /zoom meetind_Id meeting_pass to join zoom meeting") return 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=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') 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=userId, action=ChatAction.TYPING) context.bot.send_message(chat_id=userId, 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=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(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=userId, text="Logged In!")
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")
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")
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)
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: name = "Vansh Santoshi" browser.get('https://zoom.us') browser.get('https://zoom.us/wc/join/' + url_meet) WebDriverWait(browser, 10).until( EC.visibility_of_element_located( (By.CSS_SELECTOR, "#inputname"))).click() for i in range(0, 20): browser.find_element(By.CSS_SELECTOR, "#inputname").send_keys(Keys.BACK_SPACE) browser.find_element(By.CSS_SELECTOR, "#inputname").send_keys(name) WebDriverWait(browser, 20).until( EC.presence_of_element_located( (By.CSS_SELECTOR, "#joinBtn"))).click() print("Clicked on join button") try: logout = WebDriverWait(browser, 10).until( EC.visibility_of_element_located((By.LINK_TEXT, "SIGN IN"))) print("User is logged out. Logging in them again") browser.get("https://zoom.us/google_oauth_signin") WebDriverWait(browser, 20).until( EC.presence_of_element_located( (By.CSS_SELECTOR, ".wLBAL"))).click() time.sleep(10) browser.get('https://zoom.us') browser.get('https://zoom.us/wc/join/' + url_meet) WebDriverWait(browser, 10).until( EC.visibility_of_element_located( (By.CSS_SELECTOR, "#inputname"))).click() for i in range(0, 20): browser.find_element(By.CSS_SELECTOR, "#inputname").send_keys(Keys.BACK_SPACE) browser.find_element(By.CSS_SELECTOR, "#inputname").send_keys(name) WebDriverWait(browser, 20).until( EC.presence_of_element_located( (By.CSS_SELECTOR, "#joinBtn"))).click() print("Clicked on join button after logging in") except NoSuchElementException: print("User is already logged in. Continuing") except Exception as e: print(e) print("Probably, Terms and policies agreement isnt asked for.") try: for button in WebDriverWait(browser, 20).until( EC.visibility_of_all_elements_located( (By.XPATH, "//button[contains(., 'Continue')]"))): button.click() print("Trying to click the continue button") except Exception as e: print(e) print( "Is it a good error, or a bad error ? Sore wa.... yami no nakae" ) try: WebDriverWait(browser, 2400).until( EC.element_to_be_clickable( (By.XPATH, '//*[@id="inputpasscode"]'))).send_keys(passStr) print("Entered the code") except: context.bot.send_message( "Meeting didn't start. Probably Cancelled") WebDriverWait(browser, 20).until( EC.presence_of_element_located( (By.CSS_SELECTOR, "#joinBtn"))).click() print("Clicked join after entering passcode") time.sleep(15) 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 you lecture. You can chill :v") logging.info("STAAAAPH!!") #Join Audio Part try: action = webdriver.ActionChains(browser) action.move_by_offset(100, 100).perform() WebDriverWait(browser, 5).until( EC.element_to_be_clickable( (By.CSS_SELECTOR, ".join-audio-container__btn"))).click() WebDriverWait(browser, 5).until( EC.element_to_be_clickable( (By.CSS_SELECTOR, ".join-audio-by-voip"))).click() WebDriverWait(browser, 5).until( EC.element_to_be_clickable( (By.CSS_SELECTOR, ".join-dialog__close"))).click() except Exception as e: print(e) print( "Maybe the dialog got closed by itself, or the website layout has changed ?" ) ######### # 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() except Exception as e: 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_message( chat_id=userId, text="Got some error, forward this to telegram group along with pic" ) context.bot.send_message(chat_id=userId, text=str(e)) j = updater.job_queue j.run_repeating(students, 20, 1000)
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)
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)
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: browser.get(url_meet) 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: WebDriverWait(browser, 30).until( EC.visibility_of_element_located(( By.XPATH, "//span[@class='NPEfkd RveJvd snByac' and contains(text(), 'Ask to join')]" ))).click() except: WebDriverWait(browser, 30).until( EC.visibility_of_element_located(( By.XPATH, "//span[@class='NPEfkd RveJvd snByac' and contains(text(), 'Join now')]" ))).click() 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') a = ActionChains(browser) time.sleep(5) a.key_down(Keys.CONTROL).send_keys('d' + 'e').key_up( Keys.CONTROL).perform() context.bot.delete_message(chat_id=userId, message_id=mid) time.sleep(7) 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: context.bot.send_message(chat_id=userId, text="Error occurred! Fix error and retry!") context.bot.send_message(chat_id=userId, text=str(e)) j = updater.job_queue j.run_repeating(students, 20, 1000)
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)
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)