InstaPy / InstaPy

📷 Instagram Bot - Tool for automated Instagram interactions
GNU General Public License v3.0
16.73k stars 3.77k forks source link

Unfollow Error #2453

Closed andrei2306 closed 6 years ago

andrei2306 commented 6 years ago

Expected Behavior

Current Behavior

Sorry, an error occured: unfollow() takes exactly 14 arguments (15 given) INFO [2018-07-18 13:34:19]

Possible Solution (optional)

InstaPy configuration

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

DavidMolinari commented 6 years ago

Did you pull the recent changes ?

The function unfollow() takes 15 params

def unfollow(browser,
             username,
             amount,
             customList,
             InstapyFollowed,
             nonFollowers,
             allFollowing,
             style,
             automatedFollowedPool,
             relationship_data,
             dont_include,
             white_list,
             sleep_delay,
             logger,
             logfolder)
andrei2306 commented 6 years ago

yes i have the new one i just downloaded today on the unfollow_util.py on the line 93 is this def unfollow(browser, username, amount, customList, InstapyFollowed, nonFollowers, allFollowing, style, automatedFollowedPool, relationship_data, dont_include, white_list, sleep_delay, logger, logfolder):

andrei2306 commented 6 years ago

i delete all and i clone again now is not giving that error but still don't unfollow what i follow with instapy can you help me? NFO [2018-07-18 21:06:27] [xana_roo] Unfollowing the users followed by InstaPy

INFO [2018-07-18 21:06:27] [xana_roo] Total 0 users available to unfollow ~didn't pass unfollow_after: 4

INFO [2018-07-18 21:06:27] [xana_roo] There are no any users available to unfollow INFO [2018-07-18 21:06:27] [xana_roo] --> Total people unfollowed : 0

DavidMolinari commented 6 years ago

I did some tests right now

with these settings


session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=True,
                  multi_logs=True)

try:
    session.login()
    session.unfollow_users(amount=300, nonFollowers=True, style="RANDOM", unfollow_after=42 * 60 * 60, sleep_delay=655)
except Exception as exc:
    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))
    raise

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

And everything is working just fine

INFO [2018-07-19 09:39:04] [x]  --> Ongoing Unfollow From InstaPy 1/54, now unfollowing: b'x'
INFO [2018-07-19 09:39:29] [x]  --> Ongoing Unfollow From InstaPy 2/54, now unfollowing: b'x'
INFO [2018-07-19 09:39:55] [x]  --> Ongoing Unfollow From InstaPy 3/54, now unfollowing: b'x'
INFO [2018-07-19 09:40:26] [x]  --> Ongoing Unfollow From InstaPy 4/54, now unfollowing: b'x'
INFO [2018-07-19 09:40:55] [x]  --> Ongoing Unfollow From InstaPy 5/54, now unfollowing: b'x'