From 2780f0f0c72fb531f7821004be668085e3584958 Mon Sep 17 00:00:00 2001 From: DarkWeb <54339318+TheDarkW3b@users.noreply.github.com> Date: Mon, 1 Jun 2020 17:25:51 +0530 Subject: [PATCH] Update main.py --- main.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index 77a195b..2f5fe0b 100644 --- a/main.py +++ b/main.py @@ -26,14 +26,11 @@ def download(bot, update): else: pass if "instagram.com" in instagram_post: - if instagram_post.endswith("/"): - pass - else: - bot.send_chat_action(chat_id=update.message.chat_id, action="typing") - bot.sendMessage(chat_id=update.message.chat_id, text="♨️ Link of Public Post Must End with / \nIt Should Be In Below Format \nFormat :- https://www.instagram.com/p/B4zvXCIlNTw/ ", parse_mode=ParseMode.HTML, disable_web_page_preview=True) - return - url = instagram_post + "?__a=1" + changing_url = instagram_post.split("/") + url_code = changing_url[4] + url = f"https://instagram.com/p/{url_code}?__a=1" try: + global checking_video visit = requests.get(url).json() checking_video = visit['graphql']['shortcode_media']['is_video'] except: @@ -70,4 +67,4 @@ def main(): updater.idle() if __name__ == "__main__": - main() \ No newline at end of file + main()