Hi, this has started happening today every time I run Instapy and it hits at the first like
Traceback (most recent call last):
File "C:\Users\###\Telegram-InstaPy-Scheduling\scripts.py", line 208, in ###_script
interact=True)
File "C:\Users\###\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instapy\instapy.py", line 1811, in like_by_tags
liked_img)
File "C:\Users\###\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instapy\like_util.py", line 696, in like_image
naply = get_action_delay("like")
File "C:\Users\###\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instapy\util.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'like'
I have 3 setups of the bot on different machines, only one has this problem and I can't really understand why.
Win10, Chrome 73, instapy-chromedriver and every other dependency updated.
im also getting this error
Traceback (most recent call last):
File "insta.py", line 17, in <module>
bot.like_by_tags(['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX'], amount=100)
File "/usr/local/lib/python3.7/site-packages/instapy/instapy.py", line 1811, in like_by_tags
liked_img)
File "/usr/local/lib/python3.7/site-packages/instapy/like_util.py", line 696, in like_image
naply = get_action_delay("like")
File "/usr/local/lib/python3.7/site-packages/instapy/util.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'like'
I have the same Problem. Sadly your fix did not work for me. (or nor for long)
I run it on a raspbnerry pi 3 an everything is up to date (did a new install today)
INFO [2019-07-03 23:25:28] [sk] Session started!
oooooooooooooooooooooooooooooooooooooooooooooooooooooo
...................................................................
INFO [2019-07-03 23:26:03] [sk] Logged in successfully!
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
INFO [2019-07-03 23:26:03] [sk] Saving account progress...
INFO [2019-07-03 23:26:07] [sk] Tag [1/16]
INFO [2019-07-03 23:26:07] [sk] --> b'justgoshoot'
INFO [2019-07-03 23:26:37] [sk] Too few images, skipping this tag
INFO [2019-07-03 23:26:37] [sk] Tag [2/16]
INFO [2019-07-03 23:28:22] [sk] Sessional Live Report:
On session start was FOLLOWING 146 users & had 1002 FOLLOWERS
[Session lasted 2.96 minutes]
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
INFO [2019-07-03 23:28:22] [sk] Session ended!
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Traceback (most recent call last):
File "quickstart.py", line 41, in <module>
session.like_by_tags(['justgoshoot', 'djiglobal', 'worldplaces', 'myfeatureshoot', 'blickheimat', 'drohne', 'fotografie', 'artofvisuals', 'mavicpro', 'exploretocreate', 'liveofadventure', 'folkmagazine', 'theglobewanderer', 'peoplescreatives', 'watson_schweiz', 'visualsoflife'], amount=3)
File "/home/pi/.local/lib/python3.5/site-packages/instapy/instapy.py", line 1811, in like_by_tags
liked_img)
File "/home/pi/.local/lib/python3.5/site-packages/instapy/like_util.py", line 696, in like_image
naply = get_action_delay("Like")
File "/home/pi/.local/lib/python3.5/site-packages/instapy/util.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'Like'
Getting the same error here:
On session start was FOLLOWING 438 users & had 3948 FOLLOWERS
[Session lasted 1.36 minutes]
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
INFO [2019-07-03 19:18:39] [cc] Session ended!
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Traceback (most recent call last):
File "quickstart.py", line 90, in <module>
session.like_by_tags(my_hashtags, amount=60, media=None)
File "\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instapy\instapy.py", line 1811, in like_by_tags
liked_img)
File "\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instapy\like_util.py", line 673, in like_image
like_xpath = read_xpath(like_image.__name__, "Like")
File "\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instapy\xpath.py", line 4, in read_xpath
return xpath[function_name][xpath_name]
KeyError: 'Like'
Changing "like" to "Like" is doing nothing. Could this be a change of class name on the IG side? Site hashtags went down for a few hours today. Imagine they could have made a change to cause this type of break specifically.
i was able to run my script with release 0.5.3
successfully i guess the commits from there to 0.5.4
need a closer look
I have the same problem, has anyone managed to solve?
@rodrigosimoncalaca Just uninstall instapy==0.5.4 and dependencies and install instapy==0.5.3 as stated by @hijak !!! It will work.
I did this, but the problem continues.
I am using version 3.5 of python, can that be it?
How can I uninstall InstaPy and Reinstall the right version in Raspberry ?
I made it:
sudo pip uninstall instapy
sudo pip install instapy==0.5.3
But problem continues.
same here
i am using it in a pipeline like
- git clone https://github.com/timgrossmann/InstaPy.git /srv/InstaPy
- cd /srv/InstaPy && git checkout tags/0.5.3
- pip install /srv/InstaPy
- python myscript.py
Hey guys, can any of you post your script that results in this error ? I did the one-liner change in get_action_delays
that was merged yesterday. Maybe it broke something else, which I did not test.
For a quick fix
Edit instapy/util.py
starting at line 1764
change:
if (not config or
config["enabled"] is not True or
config[action] is None or
isinstance(config[action], (int, float))) is not True:
return defaults[action]
else:
custom_delay = config[action]
To:
if (not config or
config["enabled"] is not True or
action not in config or
isinstance(config[action], (int, float)) is not True):
return defaults[action]
else:
custom_delay = config[action]
Although @timgrossmann please stop accepting PR's from unknown sources because InstaPy is becoming bloated and bugged:
from the logs you can see that error occurs for following (KeyError: 'follow'
) and liking (KeyError: 'like'
) perfomed by the three following methods:
ineract_user_followers()
follow_likers()
like_by_tag()
In get_action_delay(action)
the config
variable is not complete. Probably Settings.action_delays
is not set correctly when InstaPy object is initialized.
def get_action_delay(action):
""" Get the delay time to sleep after doing actions """
defaults = {"like": 2,
"comment": 2,
"follow": 3,
"unfollow": 10}
config = Settings.action_delays
if (not config or
config["enabled"] is not True or
config[action] is None or
isinstance(config[action], (int, float))) is not True:
return defaults[action]
else:
custom_delay = config[action]
...
We initialize InstaPy like this: session = InstaPy(username=insta_username, password=insta_password, headless_browser=False, nogui=True)
INFO [2019-07-04 15:21:24] [0x2815561e236] [**********] User 'hannahloura' [14/112]
INFO [2019-07-04 15:21:29] [0x2815561e236] [**********] User: 'hannahloura' |> followers: 3388 |> following: 906 |> relationship ratio: 3.73
INFO [2019-07-04 15:21:29] [0x2815561e236] [**********] Interaction [4/112] | Total Interaction: 4
INFO [2019-07-04 15:21:29] [0x2815561e236] [**********] Starting to interact by users..
INFO [2019-07-04 15:21:29] [0x2815561e236] [**********] Username [1/1]
INFO [2019-07-04 15:21:29] [0x2815561e236] [**********] --> b'hannahloura'
INFO [2019-07-04 15:21:29] [0x2815561e236] [**********] username actions: following=False commenting=False liking=True
INFO [2019-07-04 15:21:29] [0x2815561e236] [**********] Getting hannahloura image list...
INFO [2019-07-04 15:21:34] [0x2815561e236] [**********] Post [1/3]
INFO [2019-07-04 15:21:34] [0x2815561e236] [**********] https://www.instagram.com/p/BzC6-qFppD4/
INFO [2019-07-04 15:21:38] [0x2815561e236] [**********] Image from: b'hannahloura'
INFO [2019-07-04 15:21:38] [0x2815561e236] [**********] Link: b'https://www.instagram.com/p/BzC6-qFppD4/'
INFO [2019-07-04 15:21:38] [0x2815561e236] [**********] Description: b'Enjoy it all.\n.\n.\n.\n#photography #blackandwhite #bw #pola #polaroid #pure #natural #smile #happy #longhair #agency #model #newface #modeling #fashion #beauty #commercial #face #sunday'
INFO [2019-07-04 15:21:41] [0x2815561e236] [**********] --> Image Liked!
ERROR [2019-07-04 15:21:41] [0x2815561e236] [**********] KeyError error occurred during interact user followers.
Traceback (most recent call last):
File "/opt/*********-box/main.py", line 584, in bot
session.interact_user_followers(settings['interactUserFollowers']['users'],**settings['interactUserFollowers']['kwargs'])
File "/opt/*********-box/libs/InstaPy/instapy/instapy.py", line 2942, in interact_user_followers
self.user_interact_media)
File "/opt/*********-box/libs/InstaPy/instapy/instapy.py", line 2350, in interact_by_users
total_liked_img)
File "/opt/*********-box/libs/InstaPy/instapy/like_util.py", line 696, in like_image
naply = get_action_delay("like")
File "/opt/*********-box/libs/InstaPy/instapy/util.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'like'
INFO [2019-07-04 15:21:41] [0x2815561e236] [**********] Starting to follow likers..
INFO [2019-07-04 15:22:20] [0x2815561e236] [**********] User: 'marcnideroest' |> followers: 1549 |> following: 6371 |> relationship ratio: 0.24
INFO [2019-07-04 15:22:20] [0x2815561e236] [**********] --> Not a valid user: User 'marcnideroest's following count exceeds maximum limit ~skipping user
INFO [2019-07-04 15:22:25] [0x2815561e236] [**********] User: 'avidue_official' |> followers: 298 |> following: 201 |> relationship ratio: 1.48
INFO [2019-07-04 15:22:30] [0x2815561e236] [**********] Last follow is verified after reloading the page!
INFO [2019-07-04 15:22:30] [0x2815561e236] [**********] --> Followed 'b'avidue_official''!
ERROR [2019-07-04 15:22:31] [0x2815561e236] [**********] KeyError error occurred during follow likers.
Traceback (most recent call last):
File "/opt/*********-box/main.py", line 593, in bot
session.follow_likers(settings['followLikers']['users'], **settings['followLikers']['kwargs'])
File "/opt/*********-box/libs/InstaPy/instapy/instapy.py", line 952, in follow_likers
interact)
File "/opt/*********-box/libs/InstaPy/instapy/instapy.py", line 1088, in follow_by_list
self.logfolder)
File "/opt/*********-box/libs/InstaPy/instapy/unfollow_util.py", line 764, in follow_user
naply = get_action_delay("follow")
File "/opt/*********-box/libs/InstaPy/instapy/util.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'follow'
INFO [2019-07-04 15:22:31] [0x2815561e236] [**********] Tag [1/4]
INFO [2019-07-04 15:22:31] [0x2815561e236] [**********] --> b'z\xc3\xbcrich'
INFO [2019-07-04 15:22:39] [0x2815561e236] [**********] desired amount: 113 | top posts [disabled]: 9 | possible posts: 2350768
INFO [2019-07-04 15:23:38] [0x2815561e236] [**********] Like# [1/113]
INFO [2019-07-04 15:23:38] [0x2815561e236] [**********] https://www.instagram.com/p/BzfedOToGL9/
INFO [2019-07-04 15:23:42] [0x2815561e236] [**********] Image from: b'm_aliaksandra'
INFO [2019-07-04 15:23:42] [0x2815561e236] [**********] Link: b'https://www.instagram.com/p/BzfedOToGL9/'
INFO [2019-07-04 15:23:42] [0x2815561e236] [**********] Description: b'\xd0\xbe\xd0\xba\xd1\x83\xd0\xbd\xd1\x83\xd0\xbb\xd0\xb8\xd1\x81\xd1\x8c \xd0\xbd\xd0\xb5 \xd0\xb2 \xd0\xb2\xd0\xbe\xd0\xb4\xd1\x83, \xd0\xbd\xd0\xbe \xd0\xb2 \xd0\xbd\xd0\xb5\xd1\x82\xd1\x80\xd0\xbe\xd0\xbd\xd1\x83\xd1\x82\xd1\x83\xd1\x8e (\xd0\xbd\xd1\x83, \xd0\xbf\xd0\xbe\xd1\x87\xd1\x82\xd0\xb8) \xd0\xbf\xd1\x80\xd0\xb8\xd1\x80\xd0\xbe\xd0\xb4\xd1\x83 \xd0\xb8 \xd0\xb1\xd1\x8b\xd1\x82 \xd0\xb0\xd0\xbb\xd1\x8c\xd0\xbf\xd0\xb8\xd0\xb9\xd1\x81\xd0\xba\xd0\xbe\xd0\xb9 \xd0\xb3\xd0\xbb\xd1\x83\xd0\xb1\xd0\xb8\xd0\xbd\xd0\xba\xd0\xb8 \xd1\x81 \xd0\xb8\xd1\x82\xd0\xb0\xd0\xbb\xd1\x8c\xd1\x8f\xd0\xbd\xd1\x81\xd0\xba\xd0\xb8\xd0\xbc\xd0\xb8 \xd0\xbc\xd0\xbe\xd1\x82\xd0\xb8\xd0\xb2\xd0\xb0\xd0\xbc\xd0\xb8'
INFO [2019-07-04 15:23:42] [0x2815561e236] [**********] --> Image not liked: b'Mandatory language not fulfilled'
INFO [2019-07-04 15:23:42] [0x2815561e236] [**********] Like# [2/113]
INFO [2019-07-04 15:23:42] [0x2815561e236] [**********] https://www.instagram.com/p/BzfaVvYo1pC/
INFO [2019-07-04 15:23:47] [0x2815561e236] [**********] Image from: b'kenny_bachelorette'
INFO [2019-07-04 15:23:47] [0x2815561e236] [**********] Link: b'https://www.instagram.com/p/BzfaVvYo1pC/'
INFO [2019-07-04 15:23:47] [0x2815561e236] [**********] Description: b'Leg\xc3\xa8re\n.\n.\n.\n#menfashion #menwithstyle #menwithstreetstyle #styleblogger #springoutfit #ootd #styleinspiration #fashionblogger #fashionable #themanity #streetstyle #instagood #instafashion #instadaily #photography #lightroom #switzerland #z\xc3\xbcrich #chic #suited'
INFO [2019-07-04 15:23:47] [0x2815561e236] [**********] Location: b'Cape Town, Western Cape'
INFO [2019-07-04 15:23:52] [0x2815561e236] [**********] User: 'kenny_bachelorette' |> followers: 8845 |> following: 175 |> relationship ratio: 50.54
INFO [2019-07-04 15:24:00] [0x2815561e236] [**********] --> Image Liked!
ERROR [2019-07-04 15:24:00] [0x2815561e236] [**********] KeyError error occurred during like by tags.
Traceback (most recent call last):
File "/opt/*********-box/main.py", line 602, in bot
session.like_by_tags(settings['likeByTags']['tags'], **settings['likeByTags']['kwargs'])
File "/opt/*********-box/libs/InstaPy/instapy/instapy.py", line 1811, in like_by_tags
liked_img)
File "/opt/*********-box/libs/InstaPy/instapy/like_util.py", line 696, in like_image
naply = get_action_delay("like")
File "/opt/*********-box/libs/InstaPy/instapy/util.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'like'
INFO [2019-07-04 15:24:00] [0x2815561e236] [**********] Sessional Live Report:
|> LIKED 0 images | ALREADY LIKED: 0
|> COMMENTED on 0 images
|> FOLLOWED 0 users | ALREADY FOLLOWED: 0
|> UNFOLLOWED 0 users
|> LIKED 0 comments
|> REPLIED to 0 comments
|> INAPPROPRIATE images: 0
|> NOT VALID users: 1
On session start was FOLLOWING 1094 users & had 5444 FOLLOWERS
[Session lasted 9.62 minutes]
INFO [2019-07-04 15:24:00] [0x2815561e236] [**********] Session ended!
Probably
Settings.action_delays
is not set correctly when InstaPy object is initialized.
It is never set FYI, hence defaults should be used for now. See my quick fix.
The problem was, that without this check https://github.com/timgrossmann/InstaPy/pull/4606/commits/b71563f7381e48c2bd8cccac1a861f720ddbb452 you could not really set any custom action_delays before. Pitty there are no tests, could be caught. I'll make PR with your fix.
@ivkins tried your fix and it's popping a different set of errors for me:
Traceback (most recent call last):
File "quickstart.py", line 90, in <module>
session.like_by_tags(my_hashtags, amount=60, media=None)
File "\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instapy\instapy.py", line 1811, in like_by_tags
liked_img)
File "\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instapy\like_util.py", line 696, in like_image
naply = get_action_delay("Like")
File "\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instapy\util.py", line 1768, in get_action_delay
return defaults[action]
KeyError: 'Like'
Seems to be working for other people - I imagine I'm doing something wrong here. Thoughts?
File "\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instapy\like_util.py", line 696, in like_image
naply = get_action_delay("Like")
@epaka3 for some reason there is Like
on 696
with capital letter L
-> don't see that in source. I guess that caused the error for you.
@MichalGallovic Yep. That fixed it. Forgot to reverse the "fix" someone mentioned up above. Much appreciated.
FYI I got the same issue with KeyError: 'follow'
I tried to add the fix https://github.com/timgrossmann/InstaPy/pull/4620 but I still have the issue:
Traceback (most recent call last):
File "mr_x.py", line 44, in <module>
session.follow_by_tags(['scrambler', 'caferacer', 'custombike'], amount=25)# 250
File "/home/xavier/InstaPy/instapy/instapy.py", line 4353, in follow_by_tags
self.logfolder)
File "/home/xavier/InstaPy/instapy/unfollow_util.py", line 764, in follow_user
naply = get_action_delay("follow")
File "/home/xavier/InstaPy/instapy/util.py", line 1772, in get_action_delay
custom_delay = config[action]
KeyError: 'follow'
root@vps63002:/home/xavier/InstaPy# pip3 show instapy
Name: instapy
Version: 0.5.3
Should I open a new ticket?
@angezanetti Apparently you haven't applied the fix correctly. Please add parentheses around the if
condition there, as this seem to be main issue. If still failing, show your util.py
file or use my fixed version.
Worked!
Works for me. Thanks a lot!
tied the fix now im stuck in at the instagram login screen :/
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.7/http/client.py", line 1321, in getresponse
response.begin()
File "/usr/lib/python3.7/http/client.py", line 296, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.7/http/client.py", line 265, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/bot/InstaPy/quickstart.py", line 26, in
with smart_run(session):
File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
return next(self.gen)
File "/home/pi/bot/InstaPy/instapy/util.py", line 1679, in smart_run
session.login()
File "/home/pi/bot/InstaPy/instapy/instapy.py", line 407, in login
self.bypass_with_mobile):
File "/home/pi/bot/InstaPy/instapy/login_util.py", line 167, in login_user
browser.add_cookie(cookie)
File "/home/pi/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 894, in add_cookie
self.execute(Command.ADD_COOKIE, {'cookie': cookie_dict})
File "/home/pi/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 319, in execute
response = self.command_executor.execute(driver_command, params)
File "/home/pi/.local/lib/python3.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 374, in execute
return self._request(command_info[0], url, body=data)
File "/home/pi/.local/lib/python3.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 397, in _request
resp = self._conn.request(method, url, body=body, headers=headers)
File "/usr/lib/python3/dist-packages/urllib3/request.py", line 72, in request
*urlopen_kw)
File "/usr/lib/python3/dist-packages/urllib3/request.py", line 150, in request_encode_body
return self.urlopen(method, url, *extra_kw)
File "/usr/lib/python3/dist-packages/urllib3/poolmanager.py", line 323, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 367, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3/dist-packages/six.py", line 692, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.7/http/client.py", line 1321, in getresponse
response.begin()
File "/usr/lib/python3.7/http/client.py", line 296, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.7/http/client.py", line 265, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
I same Error you have solution please ?
Traceback (most recent call last):
File "C:\Users\VFit-Family\DesktopInstaPy-master\John-Bot.py", line 372, in job9
session.like_by_locations(['215780716'], amount=15, skip_top_posts=True) # Lille
File "C:\Users\VFit-Family\DesktopInstaPy-master\instapy\instapy.py", line 1394, in like_by_locations
liked_img)
File "C:\Users\VFit-Family\DesktopInstaPy-master\instapy\like_util.py", line 696, in like_image
naply = get_action_delay("like")
File "C:\Users\VFit-Family\DesktopInstaPy-master\instapyutil.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'like'
This is my error after trying the solution.
Traceback (most recent call last):
File "quickstart.py", line 40, in
amount=10, randomize=True, media='Photo')
File "/home/gavvel/InstaPy/instapy/instapy.py", line 1811, in like_by_tags
liked_img)
File "/home/gavvel/InstaPy/instapy/like_util.py", line 696, in like_image
naply = get_action_delay("like")
File "/home/gavvel/InstaPy/instapy/util.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'like'
Hey @gavvel @johnvfitness there is PR #4620 with the fix. Did you try to apply that one ?
@MichalGallovic Hi. For me this fix does not work. Still having issues with liking:
Traceback (most recent call last):
File "itbs_insta.py", line 35, in <module>
session.like_by_tags(['hacking'], amount=15, skip_top_posts=False)
File "/usr/local/lib/python3.7/site-packages/instapy/instapy.py", line 1811, in like_by_tags
liked_img)
File "/usr/local/lib/python3.7/site-packages/instapy/like_util.py", line 696, in like_image
naply = get_action_delay("like")
File "/usr/local/lib/python3.7/site-packages/instapy/util.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'like'
@MichalGallovic Sorry, I have double checked the quick fix with util.py config and it worked for me. Thanks!
Traceback (most recent call last):
File "quickstart.py", line 32, in
session.like_by_tags(["chopper",'gezgin','motorsiklet','turkishriders','cruiser'], amount=10)
File "/usr/local/lib/python3.7/dist-packages/instapy/instapy.py", line 1811, in like_by_tags
liked_img)
File "/usr/local/lib/python3.7/dist-packages/instapy/like_util.py", line 696, in like_image
naply = get_action_delay("like")
File "/usr/local/lib/python3.7/dist-packages/instapy/util.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'like'
@angezanetti Apparently you haven't applied the fix correctly. Please add parentheses around the
if
condition there, as this seem to be main issue. If still failing, show yourutil.py
file or use my fixed version.
Plz can you repost your util.py ?
@angezanetti link not work pls repost your util.py ?
@mikediachenko
How to fix problems, I did util.py, like_util.py config, but not working Pls how did you fix it my problems;
We have the same problem,
Traceback (most recent call last):
File "quickstart.py", line 32, in
session.like_by_tags(["chopper",'gezgin','motorsiklet','turkishriders','cruiser'], amount=10)
File "/usr/local/lib/python3.7/dist-packages/instapy/instapy.py", line 1811, in like_by_tags
liked_img)
File "/usr/local/lib/python3.7/dist-packages/instapy/like_util.py", line 696, in like_image
naply = get_action_delay("Like")
File "/usr/local/lib/python3.7/dist-packages/instapy/util.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'Like'
@angezanetti Apparently you haven't applied the fix correctly. Please add parentheses around the
if
condition there, as this seem to be main issue. If still failing, show yourutil.py
file or use my fixed version.Plz can you repost your util.py ?
https://github.com/timgrossmann/InstaPy/issues/4610#issuecomment-508517795
here's the how to, works for me
@heyone56 getting a 404 on your fixed version?
Refer to pull request #4640 or @lvkins comment to get a working fix.
For a quick fix
Edit
instapy/util.py
starting at line1764
change:if (not config or config["enabled"] is not True or config[action] is None or isinstance(config[action], (int, float))) is not True: return defaults[action] else: custom_delay = config[action]
To:
if (not config or config["enabled"] is not True or action not in config or isinstance(config[action], (int, float)) is not True): return defaults[action] else: custom_delay = config[action]
Although @timgrossmann please stop accepting PR's from unknown sources because InstaPy is becoming bloated and bugged:
- ERROR [2019-07-04 17:18:53] [xxxxxxx] Unable to go to next profile post
- Unfollow loop issues
- Relationships math is weak
This fix is no working, also the error states that there is an error on the line 1771 however, this line is not changed on the fix propose.
I'm still getting this error:
File "/root/InstaPy/instapy/like_util.py", line 696, in like_image
naply = get_action_delay("like")
File "/root/InstaPy/instapy/util.py", line 1771, in get_action_delay
custom_delay = config[action]
KeyError: 'like'
hi guys my like problem is fixed;
My linux version :Linux ubuntu18 4.18.0-15-generic #16~18.04.1-Ubuntu SMP Thu Feb 7 14:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Util.py config : 1764
if (not config or
config["enabled"] is not True or
action not in config or
isinstance(config[action], (int, float)) is not True):
return defaults[action]
else:
custom_delay = config[action]
I forgot to do this : True):
Tanks You
@dsmh be sure to apply the fix correctly (note the parenthesis moved in the if clause).
If this not fix the problem, remove the python cache and run instapy again.
This solution is working for me too. Issue closed.
Most helpful comment
For a quick fix
Edit
instapy/util.py
starting at line1764
change:To:
Although @timgrossmann please stop accepting PR's from unknown sources because InstaPy is becoming bloated and bugged: