ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.19k stars 10.02k forks source link

[Instagram] Restricted Instagram video file download speed from `scontent.cdninstagram.com` #29736

Open GetPHP-IR opened 3 years ago

GetPHP-IR commented 3 years ago

Checklist

Verbose log


youtube-dl -v --cookies yt-cookies.txt https://www.instagram.com/tv/CSL6jroDj-Q/?utm_source=ig_web_copy_link
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--cookies', 'yt-cookies.txt', 'https://www.instagram.com/tv/CSL6jroDj-Q/?utm_source=ig_web_copy_link']
[debug] Encodings: locale cp1252, fs mbcs, out cp65001, pref cp1252
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: ffmpeg N-102995-g694545b6d5-20210718, ffprobe N-102995-g694545b6d5-20210718
[debug] Proxy map: {}
[Instagram] CSL6jroDj-Q: Downloading webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://instagram.fgbb2-2.fna.fbcdn.net/v/t50.2886-16/10000000_942878172924073_6269058584333381852_n.mp4?_nc_ht=instagram.fgbb2-2.fna.fbcdn.net&_nc_cat=101&_nc_ohc=eB0Lj4CACZIAX_SYGaj&edm=ADECaisBAAAA&ccb=7-4&oe=610E3AF4&oh=317173a3c01f3018bb5bd8291be73c7f&_nc_sid=ca78b6'
[download] Destination: Great White 2021-CSL6jroDj-Q.mp4
[download] 100% of 17.91MiB in 08:13```

## Description

<!--
Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

The Download speed from instagram is so low and i can not download with max speed .
I even use cookies to bypass login redirect.
The problem is when the youtube-dl start to download for example the file url redirect from https://instagram.fgbb2-2.fna.fbcdn.net/**** to https://scontent.cdninstagram.com/****.
The download speed from https://scontent.cdninstagram.com/ is too low to download instead of https://instagram.fgbb2-2.fna.fbcdn.net/.
I enter the address in chrome and go the https://instagram.fgbb2-2.fna.fbcdn.net, then there is no redirection to https://scontent.cdninstagram.com/

Now I want to use only https://instagram.fgbb2-2.fna.fbcdn.net like url to download videos from instagram
bashonly commented 3 years ago

I can confirm that instagram seems to be throttling youtube-dl video download speeds. With youtube-dl, I get a 45KB/s download speed. When I download the same video using the mp4 URL with my browser or cURL, I get 4+MB/s download speeds. This seems to be happening with every video regardless of whether I am logged in or not.

ghost commented 3 years ago

Try with --referer https://www.instagram.com/

bashonly commented 3 years ago

Try with --referer https://www.instagram.com/

This worked for me.

GetPHP-IR commented 3 years ago

Thanks👌 and Facebook is same as Instagram. They use same algorithm and Facebook throttling the speed. Is this solution work with Facebook??