On interacting with other user followers -
Script just stops randomly after message:
“Getting “username” image list...
Interaction begings...”
And then nothing happens
same for me
@uluQulu could you have a look into this? i saw that you worked on the get_links_for_username function in like_util.py 4 days ago
i think this problem occours when the desired amount of liked images is higher than 0 but lower than the available amount of images of the user.
the while loop will only break by its own once len(links) is >= the desired amount.
if this is not possible because there are not enoug images there is only one other place where it breaks, and that is inside this if len(links) == len(initial_links):
if clause. but initial_links is always empty and links is only empty if there are no posts at all.
so both of these break conditions are not met when there are less pictures available than desired but not 0
added PR for this
Amazing - will try this tonight!
Not sure if it is related at all - but a similar problem, when user is private (and hence there are no pictures at all) it also spends quite a bit if time on it, returning “page does not contain a picture” for about 10 times ish...
Hey @torbenberger
I think the logic is correct I used in there.
At worst case, it will break after the 7th attempt (_7*0.66 seconds_) in case of either there are less posts than it is written in Posts count
in there (_regardless of the amount you gave_) OR in situations like request hangs causing scroll or sth else misfunctional.
_But if you clearly explain the problem you face I will understand it much better. But I personally use it right now without problems._
@Tachenz, all I have done in my latest PR changing some lines in that function WAS to make it return the desired amount of links all the time and I did not touch anything other there.
The problem you have outlined in upper comment is related to the _check_ of private
ness.
There is a live PR touching that issue of checking private
ness, so I will not talk much, but for now, you can do this:
replace
is_private = body_elem.find_element_by_xpath(
'//h2[@class="_kcrwx"]')
with
is_private = browser.execute_script(
"return window._sharedData.entry_data."
"ProfilePage[0].graphql.user.is_private")
Thank you @uluqulu - do you mean to replace it in that PR (for privateness)?
As for the original topic - it just hangs on “interaction begins” for hours... Even though user has about 10 posts ...
Welcome, @Tachenz
The changes I proposed above are intended for your last comment. And if you apply the modifications in my previous comment, the issue of private
ness in your previous comment will (_should_) be solved.
_Find that line to replace in get_links_for_username
definition of like_util.py file._
The problem you have started this Issue for is unknown to me. If you provide more details, I will help.
Got it about Privateness :)
Sorry @uluqulu I was still not clear about the original issue with getting images:
With cureent bot version, for some users it just stops at “Interaction begins...” and does not break at all, just hangs in there
Okay I got a few questions.
Considering that case of hanging at "_Interaction begin..._":
_The answer(s) must be of the same scenario._
If there are any other console log messages pointing some error, also include it.
Monseigneur @uluQulu here we go:
@uluQulu sorry, i missed smth. you are right, it's not needed. but still its hangig. didnt had a chance to debug it. the problem is that it only occures in very few occasions... so would have to debug through a lot of users until one fails..
closed the pr and will look into it again
Hey @Tachenz
You have posted a great feedback again and I could find that nasty bug with its help! 😂
To SOLVE, open up like_util.py file- there, find and replace
links.extend(get_links(browser, username, logger, media, main_elem))
with
links = links + get_links(browser, username, logger, media, main_elem)
The reason ties up to the extend
(+=
) method resulting the reference
stay alive which causes a misbehavior in the functionality of the code.
Although that is a general bug, the reason you have faced it is you have put media="Photo"
in configurations and in that page there is only 1 photo (_with other 12 videos_) WHERE you requested 3 photos to interact with.
But don't worry, after applying the change above, if there is this situation again, it will try for 7 times and if yet not finds desired amount, it will give up and continue with the next operations.
I have got a major modification set in my files, so I couldn't PR this fix, I wish some of you can do it.
Maybe @torbenberger?
@Tachenz, if you get too many not valid
users out of relationship bounds, you can simply turn it off, or decrease the amounts, or soften them a bit :-)
It's just an optional functionality for several purposes
@torbenberger, thanks for hitting me up, so that we could solve this issue happened after my modifications WHICH I held the responsibility of 🌠
Cheers 🤩
Thank you @uluQulu will try this soon!
Meanwhile also encountered this (that happened after applying your fix in the previous post)
Stays on this message for hours as well...
@Tachenz
It's gonna be solved, too!
Just apply that modification above properly
@uluQulu created a PR for this , thanks for the fast fix :-)
@uluQulu and @torbenberger - you guys obviously rock. That seems to have taken care of the issue!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. > If this problem still occurs, please open a new issue
Most helpful comment
@uluQulu and @torbenberger - you guys obviously rock. That seems to have taken care of the issue!