Extracting Internet videos on a Mac
On a mac, you need to open a terminal window (Terminal in the apps folder)
you will need “git” and “python”, which are I think included with macs now. I’m a software guy and if they didn’t come built in, I got them from somewhere, probably from homebrew
This is “homebrew”, a system of adding open source software to Macs. there are other such systems, this is the one I use. you would need brew anyway for the other tool (ffmpeg) I think, anyway.
The hard work is done by this open source software project, https://github.com/yt-dlp/yt-dlp which I download with git
(in a terminal:
git clone https://github.com/yt-dlp/yt-dlp.git
)
The program “yt-dlp.sh” is the key — e.g. , with the commands :
cd yt-dlp (may need to go first to where you downloaded it )
./yt-dlp.sh -F <youtube or instagram URL>
with “-F”
it will spit out stuff that tells you the formats the video is available in
MacBook-Pro-3:√ Documents/yt-dlp % ./yt-dlp.sh -F https://www.instagram.com/p/DPTt1V1EXwI/
[Instagram] Extracting URL: https://www.instagram.com/p/DPTt1V1EXwI/
[Instagram] DPTt1V1EXwI: Setting up session
[Instagram] DPTt1V1EXwI: Downloading JSON metadata
WARNING: [Instagram] unable to extract like count; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
[info] Available formats for DPTt1V1EXwI:
ID EXT RESOLUTION │ FILESIZE TBR PROTO │ VCODEC VBR ACODEC ABR ASR MORE INFO
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
dash-745937025086047ad m4a audio only │ ≈265.76KiB 46k https │ audio only mp4a.40.5 46k 44k DASH audio, m4a_dash
dash-1368255847966042vd mp4 360x640 │ ≈593.21KiB 103k https │ vp09.00.21.08 103k video only DASH video, mp4_dash
dash-4211411839115830v mp4 540x960 │ ≈773.53KiB 134k https │ vp09.00.30.08 134k video only DASH video, mp4_dash
3 mp4 640x1136 │ https │ unknown unknown
dash-1883738559231094v mp4 720x1280 │ ≈ 1.01MiB 179k https │ vp09.00.31.08 179k video only DASH video, mp4_dash
dash-859116686440647v mp4 720x1280 │ ≈ 1.52MiB 270k https │ vp09.00.31.08 270k video only DASH video, mp4_dash
dash-1484502616132956v mp4 720x1280 │ ≈ 2.30MiB 408k https │ vp09.00.31.08 408k video only DASH video, mp4_dash
dash-777428211810385v mp4 720x1280 │ ≈ 3.38MiB 600k https │ vp09.00.31.08 600k video only DASH video, mp4_dash
dash-1322935185883400v mp4 720x1280 │ ≈ 4.99MiB 885k https │ vp09.00.31.08 885k video only DASH video, mp4_dash
dash-2006636706542850v mp4 720x1280 │ ≈ 8.20MiB 1455k https │ vp09.00.31.08 1455k video only DASH video, mp4_dash
Notice the first one says “audio only” and “m4a”, - sometimes there are multiple options for audio and some are better quality…..the other one is “video only"
download that file with
./yt-dlp.sh -f dash-745937025086047ad https://www.instagram.com/p/DPTt1V1EXwI
download a video file like
./yt-dlp.sh -f dash-2006636706542850v https://www.instagram.com/p/DPTt1V1EXwI
the “-f” means which format to get. These commands will download the audio and video into two files.
Then you need one more tool, “ffmpeg”, you can get it with “brew install ffmpeg”
You can combine the audio and video into one file like
ffmpeg -i Video\ by\ ctajewsandallies4palestine\ \[DPTt1V1EXwI\].m4a -i Video\ by\ ctajewsandallies4palestine\ \[DPTt1V1EXwI\].mp4 bustingTheFlotilla.mp4
This command means tell ffmpeg to take the files and give them as input (why there are “-i” parts) and combine them into one mp4 file (the last part, which will be the name of the result, and the .mp4 extension is needed). The “\” characters tell the terminal that the spaces etc after them are not to be considered as the dividing lines between parts of the commands.
note that when you’re typing that command, the tab key will (probably) autocomplete the filename after you type the beginning of it, which is very helpful. Also the terminal program can insert and copy text (when selected with mouse) with standard command-V and command-C keystrokes. So when the format codes are long like this, I copy them and paste them into the commands.
often, the videos are available in multiple formats, and often they are identified with just numbers when you run ./yt-dlp.sh -F , which makes it easier. You can get things in different resolutions and qualities and file types, I generally look for “m4a” audio files and “mp4” video files marked as the best quality/highest resolution. other formats may or may not work.
I’m a software guy as I said, I found this way to “liberate” Insta and youtube videos, there may be easier or better ways, I don’t know.
On windows it would be the same thing in terms of git, yt-dlp, python, and ffmpeg, it’s just a matter of getting those programs installed. The options for a terminal on windows are a little different as well. I have a windows 11 machine I could look into it work out instructions for you if you need them. I haven’t done that before but I could figure it out.
This is something I started experimenting with some months ago and this is my current knowledge on it. I have seen people find (and experienced myself) that youtube videos, etc., are removed, so I think it’s good to have your own copies of things. It also makes them sharable and might help get us away from these giant tech companies.