From ad4e9e56925875fbdc47ef069ddbcce1274fb32f Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 11 Jun 2022 20:41:49 -0500 Subject: [PATCH 1/2] Fixes for missing download buttons --- docs/_includes/changelog.md | 14 ++++++++++++++ package-lock.json | 2 +- package.json | 2 +- src/manifest_chrome.json | 2 +- src/manifest_firefox.json | 2 +- src/scss/main.scss | 2 +- src/ts/QuerySelectors.ts | 8 ++++---- src/ts/downloaders/PostDownloader.ts | 3 +-- 8 files changed, 24 insertions(+), 11 deletions(-) diff --git a/docs/_includes/changelog.md b/docs/_includes/changelog.md index 4a99e8a..2db4455 100644 --- a/docs/_includes/changelog.md +++ b/docs/_includes/changelog.md @@ -2,6 +2,20 @@ # Looking for a new maintainer or buyer Hi, I am looking for a new maintainer, because I do not use IG and I do not find any pleasure in developing this extension any more. If you want to maintain this extension please contact me. +### Version 4.6.3 + +`11.06.2022` + +#### Fixes + ++ Fixed some issues with image download not showing up + +#### Known Issues + ++ Unable to download some videos due to change in IG format + +--- + ### Version 4.6.2 `02.06.2022` diff --git a/package-lock.json b/package-lock.json index 6ba5993..7ec098e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "instagram_downloader", - "version": "4.0.0", + "version": "4.6.3", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 88c9911..c2cf9c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "instagram_downloader", - "version": "4.5.3", + "version": "4.6.3", "description": "Browser extension which downloads images and videos from instagram", "main": "index.js", "scripts": { diff --git a/src/manifest_chrome.json b/src/manifest_chrome.json index 606c16c..ca7104b 100644 --- a/src/manifest_chrome.json +++ b/src/manifest_chrome.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "IG Downloader", "description": "Open Source und privacy conscious Instagram Downloader, which downloads images, videos, Instagram stories and IGTV.", - "version": "4.6.2", + "version": "4.6.3", "icons": { "512": "icons/instagram.png" }, diff --git a/src/manifest_firefox.json b/src/manifest_firefox.json index 2778f2d..d78567b 100644 --- a/src/manifest_firefox.json +++ b/src/manifest_firefox.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "IG Downloader", - "version": "4.6.2", + "version": "4.6.3", "icons": { "512": "icons/instagram.png" }, diff --git a/src/scss/main.scss b/src/scss/main.scss index d661529..2314726 100644 --- a/src/scss/main.scss +++ b/src/scss/main.scss @@ -90,7 +90,7 @@ // Hover over account to display the download button -.RR-M-:hover, .M-jxE:hover, ._aarf._aarg:hover { +.RR-M-:hover, .M-jxE:hover, ._aarf._aarg:hover, ._aa_j ._aarf:hover { .account-download-button { opacity: 1; visibility: visible; diff --git a/src/ts/QuerySelectors.ts b/src/ts/QuerySelectors.ts index 136f252..cdfd4a0 100644 --- a/src/ts/QuerySelectors.ts +++ b/src/ts/QuerySelectors.ts @@ -11,22 +11,22 @@ export enum QuerySelectors { // Post - postWrapper = '.M9sTE, .NI8nC, article._aalr, article._aa6a, article._aatb', + postWrapper = '.M9sTE, .NI8nC, article._aalr, article._aa6a, article._aatb, article._ab0-', postBookmark = '.wmtNn, ._aamz > div', postSliderBubble = '.JSZAJ, .ijCUd, ._acnb', postAccountName = "._aacl > ._aap6 >.oajrlxb2", postSliderBubbleActive = '.XCodT, ._acnb._acnf', sliderItem = "._acaz", - postContentWrapper = "._aatk._aatl, ._aatk._aatn, ._aato._ab1k._ab1l", + postContentWrapper = "._aatk._aatl, ._aatk._aatn, ._aato._ab1k._ab1l, ._aagu._ab64 ._aagv", // Story storyImage = '.y-yJ5, img._aa63', storyCloseButton = '.K_10X, ._g3zU, .aUIsh, ._ac0g>._abl-', // Account, Hover, Explore, Reels - accountImage = '._aarf._aarg ._aa8j', + accountImage = '._aarf._aarg ._aa8j, ._aa_j ._aarf ._aa8h ._aa8j', accountName = '._7UhW9.fKFbl.yUEEX.KV-D4.fDxYl, ._aacl._aacs._aact._aacx._aada', // Account Image - accountImageWrapper = '.RR-M-, .M-jxE, ._aarf._aarg', + accountImageWrapper = '.RR-M-, .M-jxE, ._aarf._aarg, ._aarf ._aa8h', } diff --git a/src/ts/downloaders/PostDownloader.ts b/src/ts/downloaders/PostDownloader.ts index aef0574..2bdf32e 100644 --- a/src/ts/downloaders/PostDownloader.ts +++ b/src/ts/downloaders/PostDownloader.ts @@ -179,8 +179,7 @@ export class PostDownloader extends Downloader { const bookmarkElement: HTMLElement = element.querySelector(QuerySelectors.postBookmark) as HTMLElement; const downloadButton: HTMLElement = document.createElement('span'); downloadButton.classList.add('post-download-button'); - bookmarkElement.appendChild(downloadButton); - downloadButton.onclick = () => PostDownloader.downloadContent(element); + bookmarkElement?.appendChild(downloadButton); } } From 7852448d5bd415518cbc74d9598b0ac82605b002 Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 11 Jun 2022 21:56:51 -0500 Subject: [PATCH 2/2] Additional fixes for downloads --- src/ts/QuerySelectors.ts | 3 ++- src/ts/downloaders/PostDownloader.ts | 3 ++- src/ts/downloaders/StoryDownloader.ts | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ts/QuerySelectors.ts b/src/ts/QuerySelectors.ts index cdfd4a0..cba1031 100644 --- a/src/ts/QuerySelectors.ts +++ b/src/ts/QuerySelectors.ts @@ -11,7 +11,7 @@ export enum QuerySelectors { // Post - postWrapper = '.M9sTE, .NI8nC, article._aalr, article._aa6a, article._aatb, article._ab0-', + postWrapper = '.M9sTE, .NI8nC, article._aalr, article._aa6a, article._aatb, article._ab0-, article._ab6k', postBookmark = '.wmtNn, ._aamz > div', postSliderBubble = '.JSZAJ, .ijCUd, ._acnb', postAccountName = "._aacl > ._aap6 >.oajrlxb2", @@ -22,6 +22,7 @@ export enum QuerySelectors { // Story storyImage = '.y-yJ5, img._aa63', storyCloseButton = '.K_10X, ._g3zU, .aUIsh, ._ac0g>._abl-', + storyAccountName = '._a3gq ._ac0q a', // Account, Hover, Explore, Reels accountImage = '._aarf._aarg ._aa8j, ._aa_j ._aarf ._aa8h ._aa8j', diff --git a/src/ts/downloaders/PostDownloader.ts b/src/ts/downloaders/PostDownloader.ts index 2bdf32e..87be91b 100644 --- a/src/ts/downloaders/PostDownloader.ts +++ b/src/ts/downloaders/PostDownloader.ts @@ -106,7 +106,8 @@ export class PostDownloader extends Downloader { } private static async downloadWithOutSlider(element: HTMLElement): Promise { - const postContentWrapper = document.querySelector(QuerySelectors.postContentWrapper); + const postContentWrapper = element.querySelector(QuerySelectors.postContentWrapper) + || document.querySelector(QuerySelectors.postContentWrapper); const img = postContentWrapper?.querySelector?.('img'); const video = postContentWrapper?.querySelector?.('video'); diff --git a/src/ts/downloaders/StoryDownloader.ts b/src/ts/downloaders/StoryDownloader.ts index 0843dfe..4677015 100644 --- a/src/ts/downloaders/StoryDownloader.ts +++ b/src/ts/downloaders/StoryDownloader.ts @@ -39,9 +39,11 @@ export class StoryDownloader extends Downloader { url = extractSrcSet(img); } + const storyAccountName = (document.querySelector(QuerySelectors.storyAccountName) as HTMLElement | null)?.innerText || 'unknown'; + const downloadMessage: DownloadMessage = { imageURL: [url], - accountName: 'unknown', + accountName: storyAccountName, type: DownloadType.single, }; await browser.runtime.sendMessage(downloadMessage);