[GH-ISSUE #16] CHECK_POSTS_IN_HOURS_RANGE settings are not being followed #13

Closed
opened 2026-02-27 20:04:59 +03:00 by kerem · 7 comments
Owner

Originally created by @tomballgithub on GitHub (Oct 2, 2025).
Original GitHub issue: https://github.com/misiektoja/instagram_monitor/issues/16

While trying to use the CHECK_POSTS_IN_HOUR_RANGE feature, it doesn't seem to be respecting the hour ranges defined.

The log below says the valid ranges are:
* Hours for checking posts/reels: 09:00 - 10:59, 22:00 - 23:59

But the same log shows updates to the followers and followings at times outside that range

Timestamp:		Wed, 01 Oct 2025, 02:58:55
Timestamp:		Wed, 01 Oct 2025, 06:19:56
Timestamp:		Wed, 01 Oct 2025, 12:18:35

And then there are three more related to login errors, also outside of the range, although maybe the feature isn't supposed to respect those times for these logins, although it's attempting to log in and possibly causes problems, as I am trying to restrict it to less hours per day.

Timestamp:		Wed, 01 Oct 2025, 15:09:23
Timestamp:		Wed, 01 Oct 2025, 17:59:18
Timestamp:		Wed, 01 Oct 2025, 21:03:45

Here is the related part of my config file:

# Limit checking for new posts/reels to specific hours of the day?
# If True, the tool will only check within the defined hour ranges below
CHECK_POSTS_IN_HOURS_RANGE = True

# First range of hours to check (if CHECK_POSTS_IN_HOURS_RANGE is True)
# Example: check from 00:00 to 04:59
#MIN_H1 = 0
#MAX_H1 = 4
MIN_H1 = 9
MAX_H1 = 10

# Second range of hours to check
# Example: check from 11:00 to 23:59
#MIN_H2 = 11
#MAX_H2 = 23
MIN_H2 = 22
MAX_H2 = 23

Here is the log, showing that those settings above are recognized as they should be.

Timestamp:		Tue, 30 Sep 2025, 20:36:17
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
* Followers (173) loaded from file 'instagram_xxxxxx_followers.json' (30 Sep 25, 08:57)

* Followings (4056) loaded from file 'instagram_xxxxxx_followings.json' (30 Sep 25, 06:13)
* Followings number changed by user xxxxxx from 4056 to 4060 (+4)

* Getting followings ...
* Instagram polling interval:		[ 2 hours, 30 minutes - 3 hours, 6 minutes ]
* Email notifications:			[new posts/reels/stories/followings/bio/profile picture/visibility = False]
*					[followers = False] [errors = True]
* Mode of the tool:			2 (session login)
* Human mode:				True
* Profile pic changes:			False
* Skip session login:			False
* Skip fetching followers:		False
* Skip fetching followings:		False
* Skip stories details:			True
* Skip posts details:			True
* Get more posts details:		False
* Hours for checking posts/reels:	09:00 - 10:59, 22:00 - 23:59
* Browser user agent:			Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0
* Mobile user agent:			Instagram 255.4.6.642 (iPhone12,5; iOS 16_0; en_US; en-US; scale=3.00; 1242x2688; 955884504731265) AppleWebKit/420+
* HTTP jitter/back-off:			True
* Liveness check:			True (12 hours)
* CSV logging enabled:			True (xxxxxx.csv)
* Display profile pics:			True (via C:\Python\Scripts\imgcat.EXE)
* Empty profile pic template:		True (instagram_profile_pic_empty.jpeg)
* Output logging enabled:		True (instagram_monitor_xxxxxx.log)
* Configuration file:			C:\Instagram Monitor\instagram_monitor.conf
* Dotenv file:				xxxxxx.env
* Local timezone:			America/Chicago

Monitoring Instagram user xxxxxx
-------------------------------------------
Sneaking into Instagram like a ninja ... (be patient, secrets take time)

Session user:		kaydenhill26

Username:		xxxxxx
User ID:		27129100349
URL:			https://www.instagram.com/xxxxxx/

Profile:		public
Can view all contents:	Yes

Posts:			1
Reels:			0

Followers:		173
Followings:		4060

Story available:	False

Bio:


Timestamp:		Tue, 30 Sep 2025, 23:07:20
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
* Followers (173) loaded from file 'instagram_xxxxxx_followers.json' (30 Sep 25, 10:57)

* Followings (4056) loaded from file 'instagram_xxxxxx_followings.json' (30 Sep 25, 08:13)
* Followings number changed by user xxxxxx from 4056 to 4060 (+4)

* Getting followings ...
* Followings saved to file 'instagram_xxxxxx_followings.json'

Removed followings:

xxxxxx

Added followings:

xxxxxx

Timestamp:		Tue, 30 Sep 2025, 23:42:54
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
* Followings number changed by user xxxxxx from 4060 to 4061 (+1)

Added followings:

xxxxxx

Check interval:		2 hours, 38 minutes (Wed 01 Oct 00:20 - 02:58)
Timestamp:		Wed, 01 Oct 2025, 02:58:55
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
* Followings number changed by user xxxxxx from 4061 to 4062 (+1)

Added followings:

xxxxxx

Check interval:		2 hours, 44 minutes (Wed 01 Oct 03:35 - 06:19)
Timestamp:		Wed, 01 Oct 2025, 06:19:56
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
* Followers number changed for user xxxxxx from 173 to 174 (+1)

Added followers:

xxxxxx

Check interval:		2 hours, 52 minutes (Wed 01 Oct 09:26 - 12:18)
Timestamp:		Wed, 01 Oct 2025, 12:18:35
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
* Error, retrying in 2 hours, 49 minutes: QueryReturnedBadRequestException: 400 Bad Request - "fail" status, message "challenge_required" when accessing https://i.instagram.com/api/v1/users/web_profile_info/?username=xxxxxx
* Session might not be valid anymore!
Sending email notification to xxxxxx
Timestamp:		Wed, 01 Oct 2025, 15:09:23
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
* Error, retrying in 3 hours, 4 minutes: QueryReturnedBadRequestException: 400 Bad Request - "fail" status, message "challenge_required" when accessing https://i.instagram.com/api/v1/users/web_profile_info/?username=xxxxxx
* Session might not be valid anymore!
Timestamp:		Wed, 01 Oct 2025, 17:59:18
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
* Error, retrying in 2 hours, 40 minutes: QueryReturnedBadRequestException: 400 Bad Request - "fail" status, message "challenge_required" when accessing https://i.instagram.com/api/v1/users/web_profile_info/?username=xxxxxx
* Session might not be valid anymore!
Timestamp:		Wed, 01 Oct 2025, 21:03:45
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Originally created by @tomballgithub on GitHub (Oct 2, 2025). Original GitHub issue: https://github.com/misiektoja/instagram_monitor/issues/16 While trying to use the CHECK_POSTS_IN_HOUR_RANGE feature, it doesn't seem to be respecting the hour ranges defined. The log below says the valid ranges are: `* Hours for checking posts/reels: 09:00 - 10:59, 22:00 - 23:59 ` But the same log shows updates to the followers and followings at times outside that range ``` Timestamp: Wed, 01 Oct 2025, 02:58:55 Timestamp: Wed, 01 Oct 2025, 06:19:56 Timestamp: Wed, 01 Oct 2025, 12:18:35 ``` And then there are three more related to login errors, also outside of the range, although maybe the feature isn't supposed to respect those times for these logins, although it's attempting to log in and possibly causes problems, as I am trying to restrict it to less hours per day. ``` Timestamp: Wed, 01 Oct 2025, 15:09:23 Timestamp: Wed, 01 Oct 2025, 17:59:18 Timestamp: Wed, 01 Oct 2025, 21:03:45 ``` Here is the related part of my config file: ``` # Limit checking for new posts/reels to specific hours of the day? # If True, the tool will only check within the defined hour ranges below CHECK_POSTS_IN_HOURS_RANGE = True # First range of hours to check (if CHECK_POSTS_IN_HOURS_RANGE is True) # Example: check from 00:00 to 04:59 #MIN_H1 = 0 #MAX_H1 = 4 MIN_H1 = 9 MAX_H1 = 10 # Second range of hours to check # Example: check from 11:00 to 23:59 #MIN_H2 = 11 #MAX_H2 = 23 MIN_H2 = 22 MAX_H2 = 23 ``` Here is the log, showing that those settings above are recognized as they should be. ``` Timestamp: Tue, 30 Sep 2025, 20:36:17 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── * Followers (173) loaded from file 'instagram_xxxxxx_followers.json' (30 Sep 25, 08:57) * Followings (4056) loaded from file 'instagram_xxxxxx_followings.json' (30 Sep 25, 06:13) * Followings number changed by user xxxxxx from 4056 to 4060 (+4) * Getting followings ... * Instagram polling interval: [ 2 hours, 30 minutes - 3 hours, 6 minutes ] * Email notifications: [new posts/reels/stories/followings/bio/profile picture/visibility = False] * [followers = False] [errors = True] * Mode of the tool: 2 (session login) * Human mode: True * Profile pic changes: False * Skip session login: False * Skip fetching followers: False * Skip fetching followings: False * Skip stories details: True * Skip posts details: True * Get more posts details: False * Hours for checking posts/reels: 09:00 - 10:59, 22:00 - 23:59 * Browser user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0 * Mobile user agent: Instagram 255.4.6.642 (iPhone12,5; iOS 16_0; en_US; en-US; scale=3.00; 1242x2688; 955884504731265) AppleWebKit/420+ * HTTP jitter/back-off: True * Liveness check: True (12 hours) * CSV logging enabled: True (xxxxxx.csv) * Display profile pics: True (via C:\Python\Scripts\imgcat.EXE) * Empty profile pic template: True (instagram_profile_pic_empty.jpeg) * Output logging enabled: True (instagram_monitor_xxxxxx.log) * Configuration file: C:\Instagram Monitor\instagram_monitor.conf * Dotenv file: xxxxxx.env * Local timezone: America/Chicago Monitoring Instagram user xxxxxx ------------------------------------------- Sneaking into Instagram like a ninja ... (be patient, secrets take time) Session user: kaydenhill26 Username: xxxxxx User ID: 27129100349 URL: https://www.instagram.com/xxxxxx/ Profile: public Can view all contents: Yes Posts: 1 Reels: 0 Followers: 173 Followings: 4060 Story available: False Bio: Timestamp: Tue, 30 Sep 2025, 23:07:20 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── * Followers (173) loaded from file 'instagram_xxxxxx_followers.json' (30 Sep 25, 10:57) * Followings (4056) loaded from file 'instagram_xxxxxx_followings.json' (30 Sep 25, 08:13) * Followings number changed by user xxxxxx from 4056 to 4060 (+4) * Getting followings ... * Followings saved to file 'instagram_xxxxxx_followings.json' Removed followings: xxxxxx Added followings: xxxxxx Timestamp: Tue, 30 Sep 2025, 23:42:54 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── * Followings number changed by user xxxxxx from 4060 to 4061 (+1) Added followings: xxxxxx Check interval: 2 hours, 38 minutes (Wed 01 Oct 00:20 - 02:58) Timestamp: Wed, 01 Oct 2025, 02:58:55 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── * Followings number changed by user xxxxxx from 4061 to 4062 (+1) Added followings: xxxxxx Check interval: 2 hours, 44 minutes (Wed 01 Oct 03:35 - 06:19) Timestamp: Wed, 01 Oct 2025, 06:19:56 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── * Followers number changed for user xxxxxx from 173 to 174 (+1) Added followers: xxxxxx Check interval: 2 hours, 52 minutes (Wed 01 Oct 09:26 - 12:18) Timestamp: Wed, 01 Oct 2025, 12:18:35 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── * Error, retrying in 2 hours, 49 minutes: QueryReturnedBadRequestException: 400 Bad Request - "fail" status, message "challenge_required" when accessing https://i.instagram.com/api/v1/users/web_profile_info/?username=xxxxxx * Session might not be valid anymore! Sending email notification to xxxxxx Timestamp: Wed, 01 Oct 2025, 15:09:23 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── * Error, retrying in 3 hours, 4 minutes: QueryReturnedBadRequestException: 400 Bad Request - "fail" status, message "challenge_required" when accessing https://i.instagram.com/api/v1/users/web_profile_info/?username=xxxxxx * Session might not be valid anymore! Timestamp: Wed, 01 Oct 2025, 17:59:18 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── * Error, retrying in 2 hours, 40 minutes: QueryReturnedBadRequestException: 400 Bad Request - "fail" status, message "challenge_required" when accessing https://i.instagram.com/api/v1/users/web_profile_info/?username=xxxxxx * Session might not be valid anymore! Timestamp: Wed, 01 Oct 2025, 21:03:45 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── ```
kerem 2026-02-27 20:04:59 +03:00
  • closed this issue
  • added the
    Stale
    label
Author
Owner

@tomballgithub commented on GitHub (Oct 2, 2025):

Looking at the code, only a small portion of all the instagram traffic is behind the CHECK_POSTS_IN_HOURS_RANGE.

And this is indeed documented as it impacts "checks for new posts / reels" rather than everything.

Is there a reason for this versus being able to restrict all traffic to certain times? I might edit the code to do what I'd like, but not if there is a technical or practical reason why this shouldn't be done @misiektoja

<!-- gh-comment-id:3358848825 --> @tomballgithub commented on GitHub (Oct 2, 2025): Looking at the code, only a small portion of all the instagram traffic is behind the CHECK_POSTS_IN_HOURS_RANGE. And this is indeed documented as it impacts "checks for new posts / reels" rather than everything. Is there a reason for this versus being able to restrict all traffic to certain times? I might edit the code to do what I'd like, but not if there is a technical or practical reason why this shouldn't be done @misiektoja
Author
Owner

@tomballgithub commented on GitHub (Oct 4, 2025):

I am testing out a change that bypasses all traffic outside of desired hours to see what happens. First thing I noticed is that blocking off hours impacts the calculation of the BE HUMAN probability, so I will need to adjust that

<!-- gh-comment-id:3368444551 --> @tomballgithub commented on GitHub (Oct 4, 2025): I am testing out a change that bypasses all traffic outside of desired hours to see what happens. First thing I noticed is that blocking off hours impacts the calculation of the BE HUMAN probability, so I will need to adjust that
Author
Owner

@misiektoja commented on GitHub (Oct 12, 2025):

Is there a reason for this versus being able to restrict all traffic to certain times? I might edit the code to do what I'd like, but not if there is a technical or practical reason why this shouldn't be done @misiektoja

I think it's like that for historical reasons. Initially, Instagram's anti-bot mechanisms weren't so strict and it was enough to have only the post/reel check covered by this mechanism. Recently they've tightened the screws, so that's no longer sufficient.
If you've already implemented something to handle this, please share a PR - it definitely makes sense to make it affect all checks.

<!-- gh-comment-id:3395355334 --> @misiektoja commented on GitHub (Oct 12, 2025): > Is there a reason for this versus being able to restrict all traffic to certain times? I might edit the code to do what I'd like, but not if there is a technical or practical reason why this shouldn't be done [@misiektoja](https://github.com/misiektoja) > I think it's like that for historical reasons. Initially, Instagram's anti-bot mechanisms weren't so strict and it was enough to have only the post/reel check covered by this mechanism. Recently they've tightened the screws, so that's no longer sufficient. If you've already implemented something to handle this, please share a PR - it definitely makes sense to make it affect all checks.
Author
Owner

@tomballgithub commented on GitHub (Oct 12, 2025):

I'll share a PR, just need to expand it to stop even the initial traffic before the primary loop. I'll make it all configurable.

For whatever reason, I went from accounts failing every single day and with repeated attempts making it barely to 3 days, to now I've been running 9 days without incident. I'm running 2 hrs in the AM and 2 in the PM and just checking followers/followees. Aside from the time changes, I haven't adjusted my config.

<!-- gh-comment-id:3395382948 --> @tomballgithub commented on GitHub (Oct 12, 2025): I'll share a PR, just need to expand it to stop even the initial traffic before the primary loop. I'll make it all configurable. For whatever reason, I went from accounts failing every single day and with repeated attempts making it barely to 3 days, to now I've been running 9 days without incident. I'm running 2 hrs in the AM and 2 in the PM and just checking followers/followees. Aside from the time changes, I haven't adjusted my config.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 12, 2025):

This issue has been marked as stale because it has been inactive for 30 days. It will be closed in 7 days if no further activity occurs.

<!-- gh-comment-id:3519404476 --> @github-actions[bot] commented on GitHub (Nov 12, 2025): This issue has been marked as stale because it has been inactive for 30 days. It will be closed in 7 days if no further activity occurs.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 20, 2025):

Closing this issue due to inactivity. Feel free to reopen if needed.

<!-- gh-comment-id:3555297449 --> @github-actions[bot] commented on GitHub (Nov 20, 2025): Closing this issue due to inactivity. Feel free to reopen if needed.
Author
Owner

@tomballgithub commented on GitHub (Dec 16, 2025):

Added PR #22 for this.

<!-- gh-comment-id:3661220324 --> @tomballgithub commented on GitHub (Dec 16, 2025): Added PR #22 for this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/instagram_monitor#13
No description provided.