Instapy: unexpected keyword argument 'InstapyFollowed'

Created on 25 Jun 2018  路  8Comments  路  Source: timgrossmann/InstaPy

INFO [2018-06-25 08:58:33] [*] Logged in successfully!
INFO [2018-06-25 08:58:33] [
*] Session ended - 2018-06-25 08:58:33
INFO [2018-06-25 08:58:33] [**] --------------------

Traceback (most recent call last):
File "./unfollow.py", line 38, in
session.unfollow_users(amount=60, InstapyFollowed=(True, "all"), style="FIFO", unfollow_after=906060, sleep_delay=501)
TypeError: unfollow_users() got an unexpected keyword argument 'InstapyFollowed'
INFO [2018-06-25 08:58:04] [[email protected]] Session started - 2018-06-25 08:58:04

Arguments:
session.unfollow_users(amount=60, InstapyFollowed=(True, "all"), style="FIFO", unfollow_after=906060, sleep_delay=501)

wontfix

Most helpful comment

@Rajan4436 , seems the parameters have changed. This worked for me:

session.unfollow_users(amount=500, instapy_followed_enabled=True, instapy_followed_param="nonfollowers",
                           style="FIFO",
                           unfollow_after=12 * 60 * 60, sleep_delay=601)

All 8 comments

I think that "all" in InstapyFollowed must be in CAPS -> "ALL".
set also unfollow_after=90*60*60 with multiplication signs

p.s
remove or obscure your email

My all script code is as follows, still get getting same issue

import os
import time
import sys, json
from tempfile import gettempdir
from selenium.common.exceptions import NoSuchElementException
from instapy import InstaPy

insta_username = sys.argv[1]
insta_password = sys.argv[2]

session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=True,
multi_logs=True)
try:
session.login()

 session.unfollow_users(amount=60, InstapyFollowed=(True, "ALL"), style="FIFO", unfollow_after=90*60*60, sleep_delay=501)

except Exception as exc:
# if changes to IG layout, upload the file to help us locate the change
if isinstance(exc, NoSuchElementException):
file_path = os.path.join(gettempdir(), '{}.html'.format(time.strftime('%Y%m%d-%H%M%S')))
with open(file_path, 'wb') as fp:
fp.write(session.browser.page_source.encode('utf8'))
print('{0}nIf raising an issue, please also upload the file located at:n{1}n{0}'.format(
'*' * 70, file_path))
# full stacktrace when raising Github issue
raise

finally:
# end the bot session
session.end()

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

I am facing the same issue.

Same

@Rajan4436 , seems the parameters have changed. This worked for me:

session.unfollow_users(amount=500, instapy_followed_enabled=True, instapy_followed_param="nonfollowers",
                           style="FIFO",
                           unfollow_after=12 * 60 * 60, sleep_delay=601)

I am also not able to Fix this. Actually this error is showing not regularly. Sometimes the code is working and sometimes the Error Works.

    session.unfollow_users(amount=500, InstapyFollowed=(True, "nonfollowers"),
                           style="FIFO",
                           unfollow_after=12 * 60 * 60, sleep_delay=601)


Solved it with the following statement
session.unfollow_users(amount=30, allFollowing=False, nonFollowers=False, style="FIFO", unfollow_after=3*24*60*60, sleep_delay=60)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wyvers picture wyvers  路  3Comments

rahulkapoor90 picture rahulkapoor90  路  3Comments

seuraltimez picture seuraltimez  路  3Comments

deronsizemore picture deronsizemore  路  3Comments

n0sw34r picture n0sw34r  路  3Comments