InstaPy / InstaPy/instapy-quickstart
Error making comments
- 主要言語
- Python
- スター
- 777
- フォーク
- 763
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
**Community,
This error is appearing
I can follow, like it, but I can't comment and when trying the session ends.
I have tried several different templates and the error persists.**
` Session ended!
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Traceback (most recent call last):
File "quickstart.py", line 97, in
session.follow_user_followers(random_targets,
File "/home/fao/.local/lib/python3.8/site-packages/instapy/instapy.py", line 3461, in follow_user_followers
followed = self.follow_by_list(
File "/home/fao/.local/lib/python3.8/site-packages/instapy/instapy.py", line 1221, in follow_by_list
self.interact_by_users(
File "/home/fao/.local/lib/python3.8/site-packages/instapy/instapy.py", line 2545, in interact_by_users
success = process_comments(
File "/home/fao/.local/lib/python3.8/site-packages/instapy/comment_util.py", line 431, in process_comments
if not commenting_approved:
UnboundLocalError: local variable 'commenting_approved' referenced before assignment`
**My templates currently look like this:**
`import random
from instapy import InstaPy
from instapy import smart_run
# login credentials
insta_username = 'xxx'
insta_password = 'xxxx'
# restriction data
dont_likes = ['xxx']
ignore_users = ['xxxxx']
""" Prevent commenting on and unfollowing your good friends (the images will
still be liked)...
"""
friends = ['friend2', 'friend3']
""" Prevent posts that contain...
"""
ignore_list = []
# TARGET data
""" Set similar accounts and influencers from your niche to target...
"""
targets = ['xxxx']
""" Skip all business accounts, except from list given...
"""
target_business_categories = ['xxxxxx']
# COMMENT data
comments = ['Nice shot! @{}',
'I love your profile! @{}',
'Your feed is an inspiration :thumbsup:',
'Just incredible :open_mouth:',
'What camera did you use @{}?',
'Love your posts @{}',
'Looks awesome @{}',
'Getting inspired by you @{}',
':raised_hands: Yes!',
'I can feel your passion @{} :muscle:']
# get a session!
session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=True,
disable_image_load=True,
multi_logs=True)
# let's go! :>
with smart_run(session):
# HEY HO LETS GO
# general settings
session.set_dont_include(friends)
session.set_dont_like(dont_likes)
session.set_ignore_if_contains(ignore_list)
session.set_ignore_users(ignore_users)
session.set_simulation(enabled=True)
session.set_relationship_bounds(enabled=True,
potency_ratio=None,
delimit_by_numbers=True,
max_followers=7500,
max_following=3000,
min_followers=25,
min_following=25,
min_posts=10)
session.set_skip_users(skip_private=True,
skip_no_profile_pic=True,
skip_business=True,
dont_skip_business_categories=[
target_business_categories])
session.set_user_interact(amount=3, randomize=True, percentage=100,
media='Photo')
session.set_do_like(enabled=True, percentage=90)
session.set_do_comment(enabled=True, percentage=100)
session.set_comments(comments, media='Photo')
session.set_do_follow(enabled=True, percentage=40, times=1)
# activities
# FOLLOW+INTERACTION on TARGETED accounts
""" Select users form a list of a predefined targets...
"""
number = random.randint(3, 5)
random_targets = targets
if len(targets) <= number:
random_targets = targets
else:
random_targets = random.sample(targets, number)
""" Interact with the chosen targets...
"""
session.follow_user_followers(random_targets,
amount=random.randint(30, 60),
randomize=True, sleep_delay=600,
interact=True)
# UNFOLLOW activity
""" Unfollow nonfollowers after one day...
"""
session.unfollow_users(amount=random.randint(75, 100),
InstapyFollowed=(True, "nonfollowers"),
style="FIFO",
unfollow_after=24 * 60 * 60, sleep_delay=600)
""" Unfollow all users followed by InstaPy after one week to keep the
following-level clean...
"""
session.unfollow_users(amount=random.randint(75, 100),
InstapyFollowed=(True, "all"), style="FIFO",
unfollow_after=168 * 60 * 60, sleep_delay=600)
""" Joining Engagement Pods...
"""
session.join_pods()`
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。