shine-jayakumar/insta-likecom-bot

in last and most recent conflict

VincentEmmanuel opened this issue · 1 comments

Hi,

I encountered this issue.
in last set to 5 days
num of post 10
most recent is true

If my loaded hashtags produces only 5 more recent post that are within 5 days, the script will keep skipping. I was thinking maybe we can continue the next hashtags if most recent is true and there are no more post older than 5 days, no point skipping post because it will never find it.

so i was looking into the script and located the section

if profile.inlast:
# get post date
postdate, ts = insta.get_post_date()

            if not insta.post_within_last(ts=ts, multiplier=profile.inlast_multiplier, tparam=profile.inlast_tparam):
                logger.info(
                    f'Post [{postdate}] is older than {profile.inlast_multiplier} {TParam[profile.inlast_tparam].value}{"s" if profile.inlast_multiplier>1 else ""}. Skipping'
                )
                insta.next_post()
                # time.sleep(DELAY or randint(1,10))
                time.sleep(get_delay(profile.delay))
                continue

can we modify it to something like this

if not insta.post_within_last(ts=ts, multiplier=profile.inlast_multiplier, tparam=profile.inlast_tparam) and not profile.mostrecent:
logger.info(
f'Post [{postdate}] is older than {profile.inlast_multiplier} {TParam[profile.inlast_tparam].value}{"s" if profile.inlast_multiplier>1 else ""}. Skipping'
)
insta.next_post()
time.sleep(get_delay(profile.delay))
continue
elif not insta.post_within_last(ts=ts, multiplier=profile.inlast_multiplier, tparam=profile.inlast_tparam) and profile.mostrecent:
logger.info(
f'Post [{postdate}] is older than {profile.inlast_multiplier} {TParam[profile.inlast_tparam].value}{"s" if profile.inlast_multiplier>1 else ""}. No more recent posts. Stopping'
)
break

It is ok now, I have made some changes to the code that made it work for me. Thanks