SimpleInstaBot icon indicating copy to clipboard operation
SimpleInstaBot copied to clipboard

Bot does not detect beeing blocked

Open nocomment-bln opened this issue 5 years ago • 18 comments

Hi Mikael,

I just noticed that the bot does not detect if you are blocked by instagram.

The Bot continues unfollowing but without any effect.

image

nocomment-bln avatar Nov 20 '20 15:11 nocomment-bln

I logged me out manually and started the bot again. now instagram is letting the bot unfollow profiles...

any idea how we can fix this ?

does anyboy else has the problem ?

nocomment-bln avatar Nov 20 '20 18:11 nocomment-bln

Hi. are you running newest version?

mifi avatar Nov 21 '20 12:11 mifi

Yes I do

nocomment-bln avatar Nov 21 '20 12:11 nocomment-bln

that's odd.there is a check for this message in the code after unfollowing. are you not seeing any Action Blocked, waiting X hours... in the log? Does the bot continue to go on to other accounts and continue unfollowing other accounts like normal?

mifi avatar Nov 21 '20 13:11 mifi

"are you not seeing any Action Blocked, waiting X hours... in the log?" No nothing.

Does the bot continue to go on to other accounts and continue unfollowing other accounts like normal? yes the bot continues running

nocomment-bln avatar Nov 21 '20 13:11 nocomment-bln

Any Ideas ?

nocomment-bln avatar Nov 23 '20 20:11 nocomment-bln

The problem is that I cannot reproduce it. If you can reproduce it, and then open the Instagram window in simpleinstabot (not the window showing the bot is running). Then developer tools (View menu), then go to Elements tab, then copy the whole HTML and share it with me, I can have a look.

Screenshot 2020-11-24 at 00 16 57

mifi avatar Nov 23 '20 23:11 mifi

Hello @mifi I got the same situation... perhaps ig rolled out a newer frontend ?

What I noticed in this repo is, that the login verification is done via an aria-label const isLoggedIn = async () => (await page.$x('//*[@aria-label="Home"]')).length === 1;

Which is definitely not known in my retrieved dom. Did this in the dev-tools:

$('[aria-label="Home"]')
null

I assume you are trying to check, if the instagram logo in the top-left is appearing.

However this is the snapshot from my logged-in dom with focus on the ig logo in the top-left. Just the img alt attribute might be useful for identification I guess:

image

pgruener avatar Nov 08 '21 12:11 pgruener

Hi thanks for your research. Actually what the bot is trying to match is the "Home" button, see screenshot:

Screenshot 2021-11-09 at 13 10 23

How does your instqgram window look like? and how does the home button specifically look like in html? If possible you can share the whole html content as an attachment.

mifi avatar Nov 09 '21 06:11 mifi

Hi,

ok, I was showing the "other" home button in my previous dom. image

The one, you showed me is this one: image

image

Additionally I added the full dom in the gist https://gist.github.com/pgruener/c9dd85a4aac93684233afd99c7c7aea1 (reduced the data, as this is public here).

Tell me if you need more information.

pgruener avatar Nov 09 '21 07:11 pgruener

Thanks I found this: <svg aria-label="Startseite" class="_8-yf5 " color="#262626" fill="#262626" height="22" role="img" viewBox="0 0 48 48" width="22"><path d="M45.5 48H30.1c-.8 0-1.5-.7-1.5-1.5V34.2c0-2.6-2.1-4.6-4.6-4.6s-4.6 2.1-4.6 4.6v12.3c0 .8-.7 1.5-1.5 1.5H2.5c-.8 0-1.5-.7-1.5-1.5V23c0-.4.2-.8.4-1.1L22.9.4c.6-.6 1.6-.6 2.1 0l21.5 21.5c.3.3.4.7.4 1.1v23.5c.1.8-.6 1.5-1.4 1.5z"></path></svg>

i think Startseite is Home in German.

did you try with the newest version? In the latest version the bot will re-set language to english also after logging in. Let me know if it’s still in german with the newest version.

mifi avatar Nov 09 '21 08:11 mifi

Hi, yes, you are right. I downloaded the new version, and noticed, that it changes the language, but instagram changed it back (around 2-3 times).

But with this information in mind (also that I knew, another "home" icon is looked for) I was able to change language in the footer manually. Now it starts working.

So the minor issue is, that the translation affects the identification of the login-state. (Perhaps this could help a bot-detector, to narrow down this as "scary" activity).

But with the manual language switch as a workaround, it starts running at least .. thanks for that :)

pgruener avatar Nov 09 '21 12:11 pgruener

I downloaded the new version, and noticed, that it changes the language, but instagram changed it back (around 2-3 times).

What do you mean by instagram changing it back 2-3 times? I'd be really interested in finding a better way to change the language, because obviously the current technique of simply setting the ig_lang=en cookie doesn't seem to work in all cases. For me it works but apparently not for you. And if the bot has the wrong language, nothing really works...

I'm wondering why only some people have language set in the account. Is your account linked with facebook? Did you set language anywhere while setting up your account?

mifi avatar Nov 09 '21 13:11 mifi

What do you mean by instagram changing it back 2-3 times?

I noticed after the bot started the login page, that it switched the language to english. But nearly immediately afterwards it was set back to german. Im not 100% sure if I am remembering correctly, but the 2nd time was imho, after I approved the cookie banner. And finally after the login, i think to remember, it quickly switch to english again.. and afterwards to german.

It is possible to change the language in the settings (top right corner on your image -> profile) and then in the footer theres a simple select box, where the language can be changed, which is kept finally. image

And if the bot has the wrong language, nothing really works...

Ok, so are there more selectors, which rely on english behaviour (and not only the login state?) Perhaps we can try to sort this out by structure or other technical identification possibilities.

I'm wondering why only some people have language set in the account. Is your account linked with facebook? Did you set language anywhere while setting up your account?

Yes the account is linked to facebook, but unfortunately I dont remember, if I did some language settings during account creation.

pgruener avatar Nov 09 '21 13:11 pgruener

It is possible to change the language in the settings (top right corner on your image -> profile)

where exactly in the settings? cause I don't have any language option inside the settings, only the one in the footer.

I guess I need to change the code so it actually uses that selector in the footer.

Ok, so are there more selectors, which rely on english behaviour (and not only the login state?) Perhaps we can try to sort this out by structure or other technical identification possibilities.

Yes most selectors rely on the aria (accessibility) labels or the visual labels, because those are the only things that seem to be stable. All classes, id's etc are all minified and could change all the time. At least a user or screen reader user expects a button to say the same thing every time, so instagram cannot keep changing those. Supporting many languages is going to be a maintenance nightmare, so i'd rather have it work perfectly on english, than work half way in multiple languages.

mifi avatar Nov 09 '21 13:11 mifi

where exactly in the settings? cause I don't have any language option inside the settings, only the one in the footer.

I meant in the footer, like my last screenshot should display this. But this footer is not present on every page, but on the settings page (probably on other pages, too).

Yes most selectors rely on the aria (accessibility) labels or the visual labels

Thats bad if there is no reliable other way. But youre 100% right to better support 1 good, than 100 bad. But a better, t8n-independent way would be still cooler ;-)

however

pgruener avatar Nov 09 '21 13:11 pgruener

yea I think the only other way to support a i18n independent way is to look for and click buttons in the UI based on their visual location. but that is also prone to change every time layout changes.

I'm building a new version now that will select language from the language selector instead of creating a cookie, hopefully it will help!

mifi avatar Nov 09 '21 15:11 mifi

Yes a UI-location-based detection wont be as reliable as your current solution (i believe).

Probably it could be an option to read the aria-labels dynamically from an english configuration file to support translatable placeholders. With that, users could translate arias on their own, if they like, or keep the strong english fallback, which you're delivering by default.

Just as a "possibility" .. if that could influence the bot-detection .. if not, it might be useless anyways xD

pgruener avatar Nov 09 '21 15:11 pgruener