0

I'm trying to use instaloader to download instagram videos (reels) via "shortcode" of those videos (essentially the link to the video) this is my current approach:

import instaloader 

L = instaloader.Instaloader()

post = instaloader.Post.from_shortcode(L.context, "SHORTCODE")
L.download_post(post, target=post.owner_username)

it's pretty simple but it simply does not download videos with audio. Is there a way to fix this/prevent this in instaloader or are there any different, better libraries that could be used for this task?

ypendi
  • 1
  • 1
  • 1

1 Answers1

0

I've been trying to do the same thing using instaloader but in my case it was working fine except I wanted to download only the video and nothing else such as the metadata or the desription...

so here's a working code for that.

import instaloader
L = instaloader.Instaloader()
post = instaloader.Post.from_shortcode(L.context, "reel_shortcode_here")
video_url = post.video_url
filename = L.format_filename(post, target=post.owner_username)
L.download_pic(filename=filename, url=video_url, mtime=post.date_utc)

this should download only the video(with sound) in the current directory.