GramAddict / bot

Completely free and open-source human-like Instagram bot. Powered by UIAutomator2 and compatible with basically any Android device 5.0+ that can run Instagram - real or emulated.
https://docs.gramaddict.org
MIT License
1.02k stars 164 forks source link

Comment Action Not Working For Feed Or Any Other Job #312

Open MetaStellar opened 1 year ago

MetaStellar commented 1 year ago

I am writing to report an issue I'm experiencing with the bot not leaving comments either on the feed or on any other job.

I have tried different configurations and settings, yet the issue persists. As an example, I tried using a setup with 0% likes and 100% comments with the feed source, but the bot still won't comment on the feed posts.

Here are the details of my current configuration, filters, and comments:

Config:

##############################################################################
# For more information on parameters, refer to: 
# https://docs.gramaddict.org/#/configuration?id=configuration-file
#
# Note: be sure to comment out any parameters not used by adding a # in front
# AGAIN: YOU DON'T HAVE TO DELETE THE LINE, BUT ONLY COMMENT IT WITH A #!
##############################################################################
# General Configuration
##############################################################################

username: username # you have to put your IG name here!
# device: put_your_device_id_there # 'adb devices' in the console to know it.  It's needed only if you have more than 1 device connected
app-id: com.instagram.android
use-cloned-app: false
screen-sleep: true
screen-record: false
speed-multiplier: 2
debug: true
close-apps: false
disable-block-detection: false
disable-filters: false
dont-type: false
# scrape-to-file: scraped.txt
total-crashes-limit: 5
count-app-crashes: true
shuffle-jobs: false
truncate-sources: 3-5

##############################################################################
# Actions
##############################################################################

## Interaction (active jobs)
feed: 5-10

## Special modifier for jobs and sources
watch-video-time: 5-10
watch-photo-time: 3-4
# can-reinteract-after: 48 # the amount of hours that have to pass from the last interaction
delete-interacted-users: true

## Unfollow (unfollow jobs)
# unfollow: 10-20
# unfollow-any: 10-20
# unfollow-non-followers: 10-20
# unfollow-any-non-followers: 10-20
# unfollow-any-followers: 10-20
# unfollow-from-file: [usernames1.txt 7-15, usernames2.txt 6]

## Special modifier for unfollow jobs
# sort-followers-newest-to-oldest: false
# unfollow-delay: 15

## Remove followers (active jobs)
# remove-followers-from-file: [remove1.txt 5-10, remove2.txt 6]

## Special modifier for remove followers
# delete-removed-followers: true

## Post Processing
# analytics: false # no more supported
telegram-reports: false # for using telegram-reports you have also to configure telegram.yml in your account folder

## Special actions
# pre-script: pre_script_path_here
# post-script: post_script_path_here

##############################################################################
# Source Limits
##############################################################################

interactions-count: 5-12
likes-count: 0
likes-percentage: 0
stories-count: 2-3
stories-percentage: 50-90
carousel-count: 0
carousel-percentage: 0
max-comments-pro-user: 10
comment-percentage: 100
# pm-percentage: 30-40
interact-percentage: 30-40
follow-percentage: 0
follow-limit: 0
skipped-list-limit: 10-15
skipped-posts-limit: 5
fling-when-skipped: 0
min-following: 100

##############################################################################
# Total Limits Per Session
##############################################################################

total-likes-limit: 0
total-follows-limit: 0
total-unfollows-limit: 0
total-watches-limit: 0
total-successful-interactions-limit: 10-20
total-interactions-limit: 20-60
total-comments-limit: 5
total-pm-limit: 0
total-scraped-limit: 100-150

##############################################################################
# Ending Session Conditions
##############################################################################

end-if-likes-limit-reached: false
end-if-follows-limit-reached: false
end-if-watches-limit-reached: false
end-if-comments-limit-reached: true
end-if-pm-limit-reached: false

##############################################################################
# Scheduling
##############################################################################

working-hours: [10.15-16.40, 20.25-20.35, 20.43-20.52, 20.55-21.05]
time-delta: 0
repeat: 15-20
total-sessions: -1

Filters:

##############################################################################
# For more information on filters, refer to: 
# https://docs.gramaddict.org/#/configuration?id=available-filters
#
# Note: be sure to comment out any filter not used by adding a # in front
# AGAIN: YOU DON'T HAVE TO DELETE THE LINE, BUT ONLY COMMENT IT WITH A #!
##############################################################################

## Filters on profile type
skip_if_private: false
skip_if_public: false
skip_business: false
skip_non_business: false
skip_following: false
skip_follower: false
skip_if_link_in_bio: false
follow_private_or_empty: false

## Filters on profile stats
min_followers: 25
# max_followers: 2500
min_followings: 50
# max_followings: 2500
min_potency_ratio: 0.025
max_potency_ratio: 9999999999
min_posts: 1
mutual_friends: -1 # -1 for ignore that filter

## Filters on biography and name
# blacklist_words: [sex, link,]
# mandatory_words: [cat, dogs,]
# specific_alphabet: [LATIN, GREEK]
# biography_language: [it, en]
# biography_banned_language: [es, ch]

## Filters for enabling comments
# Action specific
comment_hashtag_likers_top: true
comment_hashtag_likers_recent: true
comment_hashtag_posts_top: true
comment_hashtag_posts_recent: true
comment_place_likers_top: true
comment_place_likers_recent: true
comment_place_posts_top: true
comment_place_posts_recent: true
comment_blogger_followers: true
comment_blogger_following: true
comment_blogger_post_likers: true
comment_blogger: true
comment_interact_usernames: true
comment_interact_from_file: true
comment_feed: true

# Content specific
comment_photos: true
comment_videos: true
comment_carousels: true

## Filters for sending PM
pm_to_private_or_empty: true

## Filters on number of post likers
# min_likers: 1
# max_likers: 1000

Comments:

%PHOTO
🥰
😍
❤
👌
🔥

%VIDEO
🥰
😍
❤
👌
🔥

%CAROUSEL
🥰
😍
❤
👌
🔥

Log

[05/31 22:52:54]     INFO | Scroll down to see next post.
[05/31 22:52:57]    DEBUG | Swipe from: (574,1233) to (566,275).
[05/31 22:52:59]    DEBUG | 0.45s sleep
[05/31 22:53:00]    DEBUG | Checking if it's an AD or an hashtag..
[05/31 22:53:02]    DEBUG | Description found!
[05/31 22:53:03]    DEBUG | I can see 1 media(s) in this view..
[05/31 22:53:04]    DEBUG | Likers container exists!
[05/31 22:53:04]     INFO | This post has 876 like(s).
[05/31 22:53:06]     INFO | Post has likes in range: 1-1000000.
[05/31 22:53:06]     INFO | @cnbc: interact
[05/31 22:53:08]     INFO | - Total Likes:                              Limit Reached (0/0)
[05/31 22:53:10]    DEBUG | Swipe from: (617,1494) to (620,757).
[05/31 22:53:11]    DEBUG | 0.3s sleep
[05/31 22:53:11]     INFO | Scroll down to see next post.

The behavior expected is for the bot to leave a comment on the feed posts, but it seems like the comment action is not getting triggered at all.

aschreque commented 1 year ago

Hello, I also had the same issue. Analyzing the code, it never can happen that a comment is posted from the feed because in the handle_posts method, the interaction is not called if it is... a feed job !

From handle_sources.py

                   if current_job != "feed":
                            opened, _, _ = post_view_list._post_owner(
                                current_job, Owner.OPEN, username
                            )
                            if opened:
                                if not interact(
                                    storage=storage,
                                    is_follow_limit_reached=is_follow_limit_reached,
                                    username=username,
                                    interaction=interaction,
                                    device=device,
                                    session_state=session_state,
                                    current_job=current_job,
                                    target=target,
                                    on_interaction=on_interaction,
                                ):
                                    break
                                device.back()

I made an ugly patch to call the _comment routine from interaction.py ... it works but that's not a fix neither a proper design. I will ask on Discord if somenone has a design to suggest.