No Result
View All Result
DevRescue
  • Home
  • Python
  • Lists
  • Movies
  • Finance
  • Opinion
  • About
  • Contact Us
  • Home
  • Python
  • Lists
  • Movies
  • Finance
  • Opinion
  • About
  • Contact Us
DevRescue
Home Blog Python

How to Download Instagram Reels in Python

by Khaleel O.
April 25, 2022
in Python
Reading Time: 3 mins read
A A
python instascrape instagram reels
python instascrape instagram reels

Let’s use instascrape to download Instagram video reels with python code. Instagram Reels are short video posts that appear along side regular image posts on instagram profiles. We will be using Python 3.8.10 for this example. Let’s go! ✨🔥⚡

UPDATE (Jan 9, 2023): THIS CODE MAY NO LONGER WORK AS EXPECTED DUE TO CHANGES IN INSTAGRAM. TRY INSTALOADER AS AN ALTERNATIVE. INSTALOADER ALLOWS YOU TO DOWNLOAD THE ENTIRE PROFILE EASILY.

First let’s install the instascrape library. We can install it with the following code at command line:

pip install insta-scrape

Here is our full code:

#Example reel: https://www.instagram.com/reel/Cccgd2MFCs4/

from instascrape import Reel 
import os
import time

sample_reel = Reel('https://www.instagram.com/reel/Cccgd2MFCs4/')
sample_reel.scrape()
reeldir = os.getcwd()
sample_reel.download(fp=f"{reeldir}\\reel{int(time.time())}.mp4")
print(dir)
print(f"This reel has {sample_reel.video_view_count:,} views.")

Let’s explain what is happening here:

  1. We import the Reel method from the instascrape library as well as os and time libraries which we will use to customize the file name of the downloaded file.
  2. We define the scraper for the instagram reel, sample_reel. We call the method Reel and supply the URL of the reel to be downloaded. Usually the reel URL can be found by clicking the kebab menu icon (3 horizontal or vertical dots) and clicking “copy link” in the menu that pops up.
  3. We call the method on our reel object, scrape() which returns a scrape instance.
  4. The variable reeldir simply stores the directory path of the current script, which is the path we will save our reel to.
  5. The download() method simply downloads the reel as an mp4 video to the path reeldir and the current time is appended to the filename. The path is given as parameter fp .
  6. The directory of the new file and the file name are printed to the screen along with the view count of the saved reel.

If all goes well, when the above code executes you should have new MP4 video file in the same file path as your python script.

We hope this tutorial on how to download instagram reels with Python helped. Good luck! 👌👌👌


Are you worried about your child’s online safety or your employees’ productivity? Do you wonder what they’re accessing on their devices? SentryPC is here to address these concerns. This all-in-one, cloud-based software provides robust activity monitoring, content filtering, and time management, making it ideal for both parental control and employee monitoring. Embrace peace of mind and enhanced efficiency with SentryPC, the proactive solution to your digital monitoring needs. CLICK HERE to get started.

Previous Post

Python pytrends Line Chart Tutorial

Next Post

Screenshot including Mouse Pointer with Python

Khaleel O.

Khaleel O.

I love to share, educate and help developers. I have 14+ years experience in IT. Currently transitioning from Systems Administration to DevOps. Avid reader, intellectual and dreamer. Enter Freely, Go safely, And leave something of the happiness you bring.

Related Posts

Python

Python Fibonacci Recursive Solution

by Khaleel O.
January 16, 2024
0
0

Let's do a Python Fibonacci Recursive Solution. Let's go! 🔥🔥🔥 The Fibonacci sequence is a series of numbers in which...

Read moreDetails
Python

Python Slice String List Tuple

by Khaleel O.
January 16, 2024
0
0

Let's do a Python Slice string list tuple how-to tutorial. Let's go! 🔥🔥🔥 In Python, a slice is a feature...

Read moreDetails
Python

Python Blowfish Encryption Example

by Khaleel O.
January 14, 2024
0
0

Let's do a Python Blowfish Encryption example. Let's go! 🔥 🔥 Blowfish is a symmetric-key block cipher algorithm designed for...

Read moreDetails
Python

Python Deque Methods

by Khaleel O.
January 14, 2024
0
0

In this post we'll list Python Deque Methods. Ready? Let's go! 🔥🔥🔥 A deque (double-ended queue) in Python is a...

Read moreDetails

DevRescue © 2021 All Rights Reserved. Privacy Policy. Cookie Policy

Manage your privacy

To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.

Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.

Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}
Manage your privacy
To provide the best experiences, DevRescue.com will use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}
No Result
View All Result
  • Home
  • Python
  • Lists
  • Movies
  • Finance
  • Opinion
  • About
  • Contact Us

DevRescue © 2022 All Rights Reserved Privacy Policy