Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't work anymore for photos and stories #67

Closed
mewlabs opened this issue Jun 2, 2022 · 9 comments
Closed

Don't work anymore for photos and stories #67

mewlabs opened this issue Jun 2, 2022 · 9 comments

Comments

@mewlabs
Copy link

mewlabs commented Jun 2, 2022

It works for video posts, but:

  1. for photos it don't work, message in console:
[instantgram] set language: en-US 
 For more information about available languages please check http://theus.github.io/instantgram
  1. for first photo in album (carousel) same thing, but for all next photos it works

  2. for stories don't work, error in console:

VM224:1 ImageVideoInStories() [instantgram] 4.0.7 TypeError: Cannot read properties of null (reading 'querySelectorAll')
    at t.execute (<anonymous>:1:10365)
    at Module.<anonymous> (<anonymous>:1:16465)
    at n (<anonymous>:1:123)
    at <anonymous>:1:915
    at <anonymous>:1:924
    at <anonymous>:1:16784
@mklaber
Copy link
Contributor

mklaber commented Jun 2, 2022

@theus I'd submit a PR to fix this but you've gone and made the code private. Assuming things haven't changed drastically since I last contributed a PR, this should fix it:

diff --git a/src/modules/ImageInPage.ts b/src/modules/ImageInPage.ts
index d62ccef..7bee7c9 100644
--- a/src/modules/ImageInPage.ts
+++ b/src/modules/ImageInPage.ts
@@ -16,8 +16,8 @@ export class ImageInPage implements Module {
     ===============================================*/
     try {
       searchImage: { // eslint-disable-line no-labels
-        if (document.querySelectorAll('#react-root > section').length === 1) {
-          const $container = document.querySelector('#react-root > section')
+        if (document.querySelectorAll('body > section').length === 1) {
+          const $container = document.querySelector('body > section')
           const $article = $container.querySelectorAll('div > div > div > article')
 
           let imageLink
diff --git a/src/modules/ImageVideoInStories.ts b/src/modules/ImageVideoInStories.ts
index 38c470d..f5e8c41 100644
--- a/src/modules/ImageVideoInStories.ts
+++ b/src/modules/ImageVideoInStories.ts
@@ -16,7 +16,7 @@ export class ImageVideoInStories implements Module {
     ===================================== */
     try {
       if (program.regexStoriesURI.test(program.path)) {
-        const $root = document.getElementById('react-root')
+        const $root = document.querySelector('body')
 
         const $video = $root.querySelectorAll('video > source') as NodeListOf<HTMLVideoElement>
         const $img = ($root.querySelector(program.mediaImageElExpression) || $root.querySelector(program.mediaImageElExpressions.img)) as HTMLImageElement
~

@theus
Copy link
Owner

theus commented Jun 2, 2022

@mklaber hey, if you'd like to, I can invite you to the private repo 🤔

@mklaber
Copy link
Contributor

mklaber commented Jun 2, 2022

Yes please :)

@theus
Copy link
Owner

theus commented Jun 2, 2022

Invite sent 📫

@kitocole
Copy link

kitocole commented Jun 3, 2022

Hello has this been fixed? It looks like a simple fix, when will the next release be? Thank you

@theus
Copy link
Owner

theus commented Jun 3, 2022

Hi @kitocole, it's not a simple change. Instagram changed their structure, so a couple modules of [instantgram] stopped work. A few modules will need to be rewrite.

theus added a commit that referenced this issue Jun 3, 2022
@theus
Copy link
Owner

theus commented Jun 3, 2022

@mklaber fixed the story module. Thanks!

I'll work in the other modules the next days.

@theus
Copy link
Owner

theus commented Jun 4, 2022

The new version should be working https://theus.github.io/instantgram/

@theus theus closed this as completed Jun 4, 2022
@UnixCro
Copy link

UnixCro commented Jun 9, 2022

Works with no problems :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants