Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9a38f45

Browse files
caption text bug fix
fixed a bug where the bot stopped when there is no caption text
1 parent 6cdb3bf commit 9a38f45

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎instaAPI-bot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ def cleanup(): #logout and exit when CTRL + C is pressed
109109

110110
likes_per_tag = random.randint(min_likes_per_tag,max_likes_per_tag)
111111
for element in media_id['items'][:likes_per_tag]:
112+
if not element['caption']['text']:
113+
print('No caption')
114+
continue
112115
for hashtag in re.split(r'#|\s', element['caption']['text']): #blacklist
113116
if hashtag.strip().lower() in hashtag_blacklist:
114117
print('Blacklisted hashtag "{}" found, skipping...'.format(hashtag))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /