Open sector13ghost opened 2 years ago
Having the same issue here within the past week or so - whenever the first image gets clicked the session ends and the following traceback occurs:
Traceback (most recent call last):
File "/home/ubuntu/quickstart.py", line 60, in
Running instapy 0.6.16 headless on Ubuntu / RPi B+...
I'm having the same issue. Session dies on the first image.
Same issue here, still happens.
simple fix (please note that I ignored the owner_comments whatever it is):
in like_util.py line 619 remove these lines:
media = post_page[0]["shortcode_media"]
is_video = media["is_video"]
user_name = media["owner"]["username"]
image_text = media["caption"]
owner_comments = browser.execute_script(
"""
latest_comments = window._sharedData.entry_data.PostPage[
0].media.comments.nodes;
if (latest_comments === undefined) {
latest_comments = Array();
owner_comments = latest_comments
.filter(item => item.user.username == arguments[0])
.map(item => item.text)
.reduce((item, total) => item + '\\n' + total, '');
return owner_comments;}
else {
return null;}
""",
user_name,
)
if owner_comments == "":
owner_comments = None
and add this instead:
'''
original code:
media = post_page[0]["shortcode_media"]
is_video = media["is_video"]
user_name = media["owner"]["username"]
image_text = media["caption"]
'''
# fixed by uvzz
media = post_page["items"][0]
is_video = media["is_unified_video"]
user_name = media["user"]["username"]
image_text = media["caption"]["text"]
'''
commenting this out:
owner_comments = browser.execute_script(
"""
latest_comments = window._sharedData.entry_data.PostPage[
0].media.comments.nodes;
if (latest_comments === undefined) {
latest_comments = Array();
owner_comments = latest_comments
.filter(item => item.user.username == arguments[0])
.map(item => item.text)
.reduce((item, total) => item + '\\n' + total, '');
return owner_comments;}
else {
return null;}
""",
user_name,
)
if owner_comments == "":
owner_comments = None
'''
# added this line instead
owner_comments = None
It is now liking 1 photo and then I am getting more errors:
File "C:\python\Insta\instabot.py", line 12, in
Any known fixes to this?
https://github.com/InstaPy/InstaPy/pull/6467
Check this one .
line 1980 line 619 Then all this and more i dont have a clue what is wrong im no expert ^^
Error occurs after clicking on a photo