Downloading Video From Instagram
Online video download services
- savefrom.net
Requires a VPN. Doesn't work in the US. But it does successfully download IG videos with audio elsewhere.
Command line
Instaloader
Instaloader is a command line utility for downloading images and video. I don't think I have tried it for downloading video with audio.
It can be installed with
$ pip3 install instaloader
Which installs it wherever python is installed, i.e. not somewhere included in PATH. So either include the python bin directory in path, or run instaloader using its full path, e.g. /Users/[me]/Library/Python/3.9/bin/instaloader.
To download all the image associated with an Instagram post:
$ instaloader -- -[POST_ID]
This will create a folder in the current directory named "-[POST_ID]". The dash in the filename screws with using it as a command line argument. Using a relative path to access it works, e.g. cd ./-[POST_ID]
Download via browser
- Load the video on its own page, not within a feed.
- Right click on the video, then click Inspect to open Chrome Developer Tools.
- Select the Network tab.
- Search (Cmd + F) for "mp4" or "m3u8" to locate video sources on the page.
- Click on one of the results.
- This should cause content to be loaded in the Preview subtab, still under Network.
- Click on the Headers subtab (same level as the Response tab.)
- This should display a Request URL under the General section.
- Copy the Request URL link.
- Paste that request URL into a new browser tab.
- Remove the
bytestartandbyteendparameters from the URL. - Now hit enter to process that request without those two parameters in the URL.
- The video should be displayed but it won't have audio. Apparently Facebook delivers video and audio separately.
- Right click on the video and select Download.
- Remove the
TODO
Figure out how to download the audio file and stitch it back together with the video using either VLC or ffmpeg.
Reference
- Saving Video Streamed Via Blob URLs - Wiki article
- Decoding facebook's blob video url - StackOverflow
- How To Download A Video With A Blob In The URL - Alphr
- Some Instagram videos are now blobs and can't download - "High Resolution Downloader For Instagram" on GitHub