Video downloads are broken as of today?
Closed this issue ยท 24 comments
Looks like instagram changed something.
edit: it appears that instagram reverted something, as it just werks again
It seems like the issue is back, as Instagram is having breaking changes.
Some videos are broken, others work, rather random indeed.
Thanks for your feedback.
I'm finding the new solution.
I also noticed that story images are sometimes not downloaded with the best resolution, the first one is from the download button, the second one from I get when using https://github.com/ehmorris/High-Resolution-Downloader-For-Instagram or jDownloader.
Thank you very much for looking into it! ๐ซ
I'm trying to figure a solution myself, but for some reason I can't figure out, the whole Instagram website is broken for me. Most of the time, a blank page would show up without any contents, unless the DevTools are opened.
Any progress on the issue?
Also what part exactly is broken. For me, was that some video were set to use blob instead of url, requiring to fetch that video's url through a request, but that isn't possible any more.
I also noticed that story images are sometimes not downloaded with the best resolution
Care to share that photo's page in order to test it?
Just take any instagram story picture, the resolution difference compared to other download methods is consistently different (lower).
Random recent one that should work for the next 24 hours: https://www.instagram.com/stories/eileen_gu_/2857129420782403566/
Download button: 750x1333, 243kb
Other methods: 1170x2080, 488kb
This user script tries to get the original image from the srcset
attribute first, then fallback to to the src
attribute, if not available. src
attribute seems to give the original image now. Probably, at some point in the past, this wasn't the case.
Anyways, in the user script code, comment (add // at the start of the line) some lines in storyGetUrl
function, to match the following
function storyGetUrl(target, sectionNode) {
let url = '';
if (sectionNode.querySelector('video > source')) {
url = sectionNode.querySelector('video > source').getAttribute('src');
} else if (sectionNode.querySelector('img[decoding="sync"]')) {
// let img = sectionNode.querySelector('img[decoding="sync"]');
// url = img.srcset.split(/ \d+w/g)[0].trim(); // extract first src from srcset attr. of img
// if (url.length > 0) {
// return url;
// }
url = sectionNode.querySelector('img[decoding="sync"]').getAttribute('src');
}
return url;
}
And see how the images compared to that extension's images, if they match, then it should be fixed.
Any progress on the issue? Also what part exactly is broken. For me, was that some video were set to use blob instead of url, requiring to fetch that video's url through a request, but that isn't possible any more.
I traced the Instagram web page and surveyed other similar projects. I think the current suitable solution is using the API https://i.instagram.com/api/v1/{info_type}/{id}/info/
to fetch the url.
{info_type}: may be media, users, web_profile_info...
{id}: id of media, user...
I did try that, but couldn't find the proper way to get the id of the media.
I found that the media id is embedded in the post web page (i.e., https://instagram.com/p/XXX) html head. But I'm not sure if this method works in any environment.
I will release a beta version which uses the info api in the next few days.
That solves it then. I don't see why it wouldn't work anywhere.
I have updated the script which uses the Info API to fetch urls.
Please update the script and help to test the new method if you can.
The update changed nothing for me, some videos can't be downloaded (example: https://www.instagram.com/p/Ceq-PNxgRE5/ ), and story images are still grabbing a lower resolution (example: https://www.instagram.com/stories/anna__shcherbakova_/2858320975204717916/ - 1080x1919 instead of 1284x2282).
The update changed nothing for me, some videos can't be downloaded (example: https://www.instagram.com/p/Ceq-PNxgRE5/ ), and story images are still grabbing a lower resolution (example: https://www.instagram.com/stories/anna__shcherbakova_/2858320975204717916/ - 1080x1919 instead of 1284x2282).
I found there is a bug in finding post id.
Could you replace line 397 (let match = link.match...) with let match = link.match(/^\/p\/([^/]+)\//);
and try again?
Besides, this update(1.13) did not modify the Story part (maybe try to fix it in the next update).
With version 1.13.1 I can download all videos (or at least I tried 5 random ones and it worked every time), great!
Great. No issues in here.
I guess something must have changed, as most video downloads are broken again.
Yes, there are some changes, but fortunately, not big changes.
I have updated the new script to fix it.
Please update and try again.
Updated, but nothing changed for me (video downloads don't work most of the time).
yeah video download on post and reels dont work for me
yeah video download on post and reels dont work for me
I'm also having the same issue now.
Edit: Never mind, I was using an old version, an update fixed it. ๐
thas cool