Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDarkW3b authored Jun 1, 2020
1 parent 71f9a6e commit 2780f0f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \n<b>Format :-</b> 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:
Expand Down Expand Up @@ -70,4 +67,4 @@ def main():
updater.idle()

if __name__ == "__main__":
main()
main()

0 comments on commit 2780f0f

Please sign in to comment.