igdownloader / InstagramDownloader

Firefox and Chrome Extention which creates an download button for instagram images and videos and videos
https://huiibuh.github.io/InstagramDownloader/
789 stars 151 forks source link

No Download Buttons under Posts (Picturs,Videos) #310

Open HVVFan opened 2 years ago

HVVFan commented 2 years ago

Expected behaviour There was always a Button under Pictures and Videos but that button is gone

Screenshots IG

Device PC:

skyfox1977 commented 2 years ago

I have same issue

shaun-of-the-dead commented 2 years ago

Hi. I'm reporting the same issue as well.

It started suddenly a few weeks ago, but I can't remember exactly when. My guess is Instagram updated something on the website.

I found that right-clicking a post to open directly into a new tab (rather than the post opening via the lightbox / modal) allows the download button to appear, however clicking the button produces a "Could not find post" error on still images. It still seems to work on video posts though.

JAKware commented 2 years ago

Same issue, just noticed it about 8/13/22. I found if I open the image and then press refresh the download and share buttons appear. The refresh seems to open the image in a different view (no next or back button and just 6 preview posts at the bottom).

skyfox1977 commented 2 years ago

Just get another add on, this one works for me and seems MUCH better: "Instagramâ„¢ Media Downloader" by [hawkynawa] https://addons.mozilla.org/en-US/firefox/addon/imd/

AlbertArulPrakash commented 2 years ago

@kmbarr, @HuiiBuh

Looks like the classes of the article is changed I see this function in developer tools

function(e) {
            e.ARTICLE_CONTAINER = "article._abj9, article._aa08, article._aa6a, article._ab6k, article._ab0v",
            e.ARTICLE_CONTAINER_FOR_BUTTON = "._aamu._aaz9",
            e.ARTICLE_LINK = ".oajrlxb2",
            e.ARTICLE_SLIDER_DETECTOR = ".JSZAJ, .ijCUd",
            e.ARTICLE_ACTIVE_POST = ".XCodT",
            e.SLIDER_ITEM = "._acaz",
            e.POST_SLIDER = ".JSZAJ, .ijCUd, ._acnb",
            e.POST_SLIDER_ACTIVE = ".XCodT, ._acnb._acnf",
            e.POST_CONTENT_WRAPPER = "._ab12, ._aatk._aatl, ._aatk._aatn, ._aato._ab1k._ab1l",
            e.POST_BOOKMARK = ".wmtNn, ._aamz > div",
            e.STORIES_BUTTON_CLOSE = ".K_10X, ._g3zU, .aUIsh, ._ac0g>._abl-, ._abl-",
            e.STORIES_POST = "._aa64, img._aa63 _ac51",
            e.ACCOUNT_IMAGE = "._aarf._aarg  ._aa8j, ._aadp",
            e.ACCOUNT_NAME = "._7UhW9.fKFbl.yUEEX.KV-D4.fDxYl, ._aacl._aacs._aact._aacx._aada",
            e.POST_PREVIEW = "._bz0w, .pKKVh",
            e.USER_ACCOUNT = "._7UhW9.fKFbl.yUEEX.KV-D4.fDxYl",
            e.BUTTON_FOR_DOWNLOAD = ".By4nA",
            e.BUTTON_FOR_STOP_DOWNLOAD = "._0mzm-.sqdOP.yWX7d",
            e.POST_ACCOUNT_NAME = "._aacl > ._aap6 >.oajrlxb2, _aacl._aaco._aacw._aacx._aad7._aade",
            e.USER_ACCOUNT_CONTAINER = ".RR-M-, .M-jxE, ._aadm"
        }(r || (r = {}));

The classes mentioned in e.ARTICLE_CONTAINER is not available in the HTML source of the page.

following are the new article classes "_aatb _aate _aatg _aati" HTML Code

<article class="_aatb _aate _aatg _aati" role="presentation" tabindex="-1">

the following createDownloadButton() function is searching for classes mentioned in postwrapper constant

 public async createDownloadButton(): Promise<void> {
        let postList: HTMLElement[] = [...document.querySelectorAll(QuerySelectors.postWrapper)] as HTMLElement[];

        // Sometimes the button gets added at the moment the image gets updated
        // If this is the case the image download button cannot be added, so here is a timeout to try it again
        if (postList.length === 0) {
            postList = await this.retryCreateButton();
        }
        this.creationTimeoutList.forEach(t => clearTimeout(t));
        this.creationTimeoutList = [];

        postList.forEach((element: HTMLElement) => {
            this.addDownloadButton(element);
        });

Fixing this variable (most likely postwrapper) will fix this issue.