Skip to content

Instagram Video and IGTV downloader #3981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 29, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions web_programming/instagram_video.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import json
from datetime import datetime

import requests

if __name__ == "__main__":
link = input("Enter Video/IGTV url: ").strip()
url = f"https://downloadgram.net/wp-json/wppress/video-downloader/video?url={link}"
req = requests.get(url)
res = req.content
json_data = json.loads(res)
print(f"Downloading video from {link} ...")
video_data = requests.get(json_data[0]["urls"][0]["src"]).content
file_name = f"{datetime.now():%Y-%m-%d_%H:%M:%S}.mp4"
with open(file_name, "wb") as fp:
fp.write(video_data)
print(f"Done. Video saved to disk as {file_name}.")