Skip to content

Instantly share code, notes, and snippets.

@BexTuychiev
Last active July 17, 2020 09:03
Show Gist options
  • Save BexTuychiev/2e204f2845ec83c5e9483df815d0eaa9 to your computer and use it in GitHub Desktop.
Save BexTuychiev/2e204f2845ec83c5e9483df815d0eaa9 to your computer and use it in GitHub Desktop.
# Load the hashtag
hashtag = instaloader.Hashtag.from_name(bot.context, 'python')
# Load posts with `python` tag into a generator object
python_posts = hashtag.get_posts()
# Iterate over posts to download them
for index, post in enumarate(python_posts, 1):
bot.download_post(post, target=f'{hashtag.name}_{index}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment