ohld / igbot

🐙 Free scripts, bots and Python API wrapper. Get free followers with our auto like, auto follow and other scripts!
https://hikerapi.com/p/N2P6iqiM
Apache License 2.0
4.69k stars 1.47k forks source link

Filtering media not working as it should #1254

Open TerrorFactor opened 4 years ago

TerrorFactor commented 4 years ago

Please follow the guide below

Before submitting an issue, make sure you have:

Purpose of your issue?

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: Python 2.7.17

Code:

# Example code that will produce the error reported
from instabot import Bot

bot = Bot()
bot.login(username="user", password="pass")
medias = bot.get_hashtag_medias("drifted")

Error/Debug Log:

2020-01-22 23:06:04,738 - DEBUG - GET to endpoint: feed/tag/drifted/?max_id=&rank_token=28438133771_e63fb8db-0d3d-4882-8052-fd2c482ba12d&ranked_content=true& returned response: <Response [200]>
2020-01-22 23:06:04,779 - INFO - Received 84 medias.
2020-01-22 23:06:04,780 - INFO - After filtration 0 medias left.

I followed the installation guide, and used pip to install the bot. Then used git to download the examples, as shown in the installation guide for Linux. I am using everything default, nothing changed.

After going through the code, I tried to comment the filter_medias function in bot_filter.py, like this:

def filter_medias(self, media_items, filtration=True, quiet=False, is_comment=False):
    # if filtration:
        # if not quiet:
            # self.logger.info("Received {} medias.".format(len(media_items)))
        # if not is_comment:
            # media_items = _filter_medias_not_liked(media_items)
            # if self.max_likes_to_like:
                # media_items = _filter_medias_nlikes(
                    # media_items, self.max_likes_to_like, self.min_likes_to_like
                # )
        # else:
            # media_items = _filter_medias_not_commented(self, media_items)
        # if not quiet:
            # msg = "After filtration {} medias left."
            # self.logger.info(msg.format(len(media_items)))
    return _get_media_ids(media_items)

Weirdly enough, this doesn't solve it, and I get:

2020-01-22 23:06:04,779 - INFO - Received 84 medias.
2020-01-22 23:06:04,780 - INFO - After filtration 3 medias left.

Using

medias = bot.get_hashtag_medias("drifted",filtration=False)

does seem to work, but you obviously don't have any control at that point anymore.

Initially I tried using the example script to download by hashtag (same error), but tried manually to simplify the problem as much as possible.

duplicate-issues[bot] commented 4 years ago

Hey @TerrorFactor,

We did a quick check and this issue looks very darn similar to

This could be a coincidence, but if any of these issues solves your problem then I did a good job :smile:

If not, the maintainers will get to this issue shortly.

Cheers, Your Friendly Neighborhood ProBot

bruvv commented 4 years ago

Thanks for the issue! Indeed looks like a bug, when I have more time I can debug the other issues first.

stale[bot] commented 4 years ago

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.