inDream / oh-my-ig

Provide what you expected from Instagram.
https://chrome.google.com/webstore/detail/glmlgaadcaohdmmpkkllhdkpjbeibond
MIT License
22 stars 6 forks source link

502 error #5

Open FeIipeSoares opened 6 years ago

FeIipeSoares commented 6 years ago

I think instagram is blocking Oh My Ig requests, i have created new account for testing and i receive 502 error in hours, my default account not working more.

inDream commented 6 years ago

Could you share your config? i.e. this is my config: Auto Reload Feed Page (mins) 3 No. of Feed per Page 50 Sync Count 6 No of items sync each time 33 Sync One Feed Interval (mins) 3 Sync Multi Feed Interval (mins) 30

FeIipeSoares commented 6 years ago

Auto Reload Feed Page (mins) 5 Sync Count 33 Sync One Feed Interval (mins) 5 No. of Feed per Page 200 No of items sync each time 50 Sync Multi Feed Interval (mins) 10

inDream commented 6 years ago

Could you try to reduce No of items sync each time to 33?

markhunte commented 6 years ago

Hi a number of my assoicates using the published version in the store are getting this 502 error and their main instragram accounts stop working. They get this in console

instagram

It does seem to be some sort of authorisation issue related to the use of this plugin. As it only happens when they use an account and the this plugin.

The instagram page starts to load but stalls due to the above error.

instagram screen

once the instagram account has broken there is no fixing it short of deleting it and starting over again. Just unistalling the plugin does not solve it.

markhunte commented 6 years ago

Anyone got any ideas how to fix this...!!??

FeIipeSoares commented 6 years ago

my idea is updating feed from profile page, i changed query_hash and used user_id Extension working fine

markhunte commented 6 years ago

Hi @cucucucu2

Thanks for your answer, Can you explain it in a bit more detail including where you did this.. we are using the extension from the app store and not a compiled clone..

inDream commented 6 years ago

@markhunte Could you try logout, clean cache (Ctrl + F5) and login again, then go to chrome://extensions/ reload the extension?

@cucucucu2 Could you give me more detail about update feed from profile?

FeIipeSoares commented 6 years ago

I edited this.query_hash = 'd6f4427fbe92d846298cf93df0b937d3'; to this.query_hash = '6305d415e36c0a5f0abb6daba312f2dd';

and manually put id from profile

  feed(oldCount, total) {
    let url = null;
    if (this.query_hash) {
      const data = JSON.stringify({
        fetch_media_item_count: this.syncEach,
        fetch_media_item_cursor: this.lastCursor,
        fetch_comment_count: 4,
        fetch_like: 10,
        has_stories: false,
      });
      url = `hash=${this.query_hash}&variables=${encodeURIComponent(data)}`;
    } else {
      url = `id=${this.query_id}&` +
        `fetch_media_item_count=${this.syncEach}&` +
        `fetch_media_item_cursor=${this.lastCursor}&` +
        'fetch_comment_count=4&fetch_like=10';
    }
    return this.getJSON(`graphql/query/?query_${url}`).then((body) => {
      const feed = body.data.user.edge_web_feed_timeline;
      this.lastCursor = feed.page_info.end_cursor;
      this.storeItem(feed.edges);
      const count = oldCount - 1;
      console.log(`Synced ${total - count}/${total} feed.`);
      chrome.browserAction.setBadgeText({ text: `${total - count}/${total}` });
      if (count > 0 && feed.page_info.has_next_page) {
        return pdelay(2000).then(() => {
          this.feed(count, total);
        });
      }
      return chrome.browserAction.setBadgeText({ text: '' });
    });
  }

to

feed(oldCount, total) {
    let url = null;
    var that = this;
setTimeout(function() {
    if (that.query_hash) {
      const data = JSON.stringify({
        id: 000000000, // profilePage_
        first: that.syncEach,
        after: null,
      });
      url = `hash=${that.query_hash}&variables=${encodeURIComponent(data)}`;
    }
    return that.getJSON(`graphql/query/?query_${url}`).then((body) => {
      const feed = body.data.user.edge_owner_to_timeline_media;
      that.lastCursor = feed.page_info.end_cursor;
      that.storeItem(feed.edges);
      const count = oldCount - 1;
      console.log(`Synced ${total - count}/${total} feed.`);
      chrome.browserAction.setBadgeText({ text: `${total - count}/${total}` });
      if (count > 0 && feed.page_info.has_next_page) {
        return pdelay(1000).then(() => {
          that.feed(count, total);
        });
      }
      return chrome.browserAction.setBadgeText({text: '1'});
    });
                }, 2000);
  }

I can't explain with very details due i not speak english very well i have changed other lines, you can see my modification to you update to next version

https://github.com/cucucucu2/igsync

inDream commented 6 years ago

@cucucucu2 Thanks for your help. I've fixed it at 24ad385936f43a40867fed01710549daf3d3442b. Could you help me check is version 0.0.4.10 fixed your issue?

markhunte commented 6 years ago

Will do. Thanks for looking at this. While I test it are you able to explain the issue.. Cheers