Igbot: Cannot like medias on your own "following" users due to Check_User Filtration

Created on 16 Mar 2019  路  7Comments  路  Source: ohld/igbot

Please follow the guide below

  • Issues submitted without this template format will be ignored.
  • You will be asked some questions and requested to provide some information, please read them carefully and answer completely.
  • Put an x into all the boxes [ ] relevant to your issue (like so [x]).
  • Use the Preview tab to see how your issue will actually look like.

Before submitting an issue, make sure you have:

  • [X] Updated to the latest version
  • [X] Read the README and docs
  • [X] [Searched](https://github.com/instagrambot/instabot/search?type=Issues) the bugtracker for similar issues including closed ones

Purpose of your issue?

  • [X] Bug report (encountered problems/errors)
  • [] Feature request (request for a new functionality)
  • [] Question
  • [] Other

The following sections requests more details for particular types of issues, you can remove any section (the contents between the triple ---) not applicable to your issue.


For a bug report, you must include the Python version used, code that will reproduce the error, and the error log/traceback.

Paste the output of python -V here:
image

Code:

# Example code that will produce the error reported
sys.path.append(os.path.join(sys.path[0], '../'))
from instabot import Bot

parser = argparse.ArgumentParser(add_help=True)
parser.add_argument('-u', type=str, help="username")
parser.add_argument('-p', type=str, help="password")
parser.add_argument('-proxy', type=str, help="proxy")
args = parser.parse_args()
with open('message.txt', encoding="utf-8") as f:
    directMessage = f.read()

bot = Bot()
bot.login(username=args.u, password=args.p,
          proxy=args.proxy)

non_followers = set(bot.following) - set(bot.followers) - bot.friends_file.set
non_followers = list(non_followers)

for non_follower in tqdm(non_followers):
    bot.like_user(non_follower, amount=randint(1, 3), filtration=False)
    sleep(randint(30, 50))
    if (bot.send_message(directMessage, non_follower)):
        bot.sent_message_file.append(non_follower)

print('Sent An Individual Messages To All Users..')
sleep(3)


Describe your issue

You cannot like your own following users due to Check_User function Filtration.
when you like user (using filtration) - apparently you end up liking his media by "Check_Media" function.
this function includes "check_user", and return false if it fails - means, you cannot filter media without filter also users.
image

what if you want to like your own followers? youll have to turn off filtration by users. although check_user if effects other scripts running.

by calling this function we may add the attribute filtration=True, unless programmer define something else and all chain calling the function should support this attribute.
thank you!

stale

All 7 comments

here's an solution i made:

bot_filter.py - the main issue:
image

bot.py edit:
image

bot_like.py:
image
image

let me know what you think :)

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.

i will try

Eran111 i tryed your solution but not work

I find a new solution: i change filter_users=True, in filter_users=False, and now it like to people that already follow

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.

well, @thedarkknight197
your solution does work,
but sometimes you do want the filtration to work in other cases and in this case not.
so either changing it each time i made my own "like users" function
heres whats important for it to work..:
i suggest instabot will do something similar..

image
image

afterwards the function continue with like process

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nizarganteng picture nizarganteng  路  3Comments

balochlens picture balochlens  路  5Comments

HappySeal picture HappySeal  路  3Comments

yaniferhaoui picture yaniferhaoui  路  6Comments

santiagobassani96 picture santiagobassani96  路  5Comments