Closed LilHayah closed 3 years ago
I can confirm this problem in Firefox and Chrome. There is also a delay of a few seconds up to several minutes for the Save dialog appearing, depending on how long the video is.
HMM. To combat this is there any way to bulk download from url. ( since the only the individual videos are downloading at around 40 kb/s. )
I am sorry, but there is nothing I can do to prevent instagram from throttling your download
Hi. What is possible to do is to change the user agent to curl/7.54.
This works here:
$ curl -o video.mp4 VIDEO_URL
Unfortunately, due to a bug in chromium the fetch below will not work:
fetch(VIDEO_URL, {
headers: {
'User-Agent': 'curl/7.54'
}
})
But it looks like in Firefox it will work https://bugzilla.mozilla.org/show_bug.cgi?id=1188932
@rayronvictor Did you try to set the user agent? I think Instagram checks the referrer which would be the extension and slows down the download because of that.
@HuiiBuh I don't tried yet with fetch, but with curl if you change the user agent from the default curl/7.54 to something the browser use (add -A "Mozilla etc..." to curl command) the download slows down.
This occurs because now Instagram use range requests for video resources. May be this is related to the client support for range requests and not to user agent. But is not related to referer header because if you open the video url in a new tab the download is slow down too.
@rayronvictor Thanks for your explanation and your investigation. This sounds really promising
@HuiiBuh, I tested on Firefox and worked with:
fetch('https://scontent.cdninstagram.com/v/t50.2886-16/10000000_210748647400973_8000148629428104423_n.mp4?_nc_ht=instagram.fnat1-1.fna.fbcdn.net&_nc_cat=105&_nc_ohc=BpezrlE49oUAX-64ojX&edm=AABBvjUBAAAA&ccb=7-4&oe=60B82936&oh=a57c4d1bda1578ffbb9946c1f6a6bc58&_nc_sid=83d603', {
headers: {
'User-Agent': 'curl/7.64.1'
}
})
11s for 150MB
For Chrome, declarativeNetRequest can be used to change the http request headers. Something like this, but I not tested:
{
"id": 10,
"priority": 2,
"action": {
"type": "modifyHeaders",
"requestHeaders": [
{ "header": "User-Agent", "operation": "set", "value": "curl/7.64.1" },
]
},
"condition": { "domain": ["cdninstagram.com", "fbcdn.net"] }
},
I submitted a PR https://github.com/HuiiBuh/InstagramDownloader/issues/196
Since two days ago, whenever I tried to download any short or long videos from instagram, the downloading speed was surprisingly slow (40kb/s at most).
At first, I thought it was my network problem. But after I checked everything and found the loading speed was as fast as usual, I just realized that the downloading speed might be throttled no matter you download by an extension or grab the url from that "?__a=1" page)
Is there anyway we can just save the loaded video from browser cache instead of downloading again from the url? Or can we figure out any other workaround? I can't imagine how much time it would take to download an hour-long saved live.