ohld / igbot

🐙 Free scripts, bots and Python API wrapper. Get free followers with our auto like, auto follow and other scripts!
https://hikerapi.com/p/N2P6iqiM
Apache License 2.0
4.69k stars 1.47k forks source link

can't download media by use #432

Closed ayush3298 closed 6 years ago

ayush3298 commented 6 years ago

Please follow the guide below


Before submitting an issue, make sure you have:

Purpose of your issue?


The following sections requests more details for particular types of issues, you can remove any section (the contents between the triple ---) not applicable to your issue.


For a bug report, you must include the Python version used, code that will reproduce the error, and the error log/traceback.

Paste the output of python -V here:

Code:

# Example code that will produce the error reported
from instabot import Bot

bot = Bot()
followers = bot.get_user_followers(bot.user_id)

Error/Debug Log:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero

Describe your issue

whenever i tries to download media by a user it shows me this

2018-01-05 12:52:06,102 - INFO - Going to download 158 medias.

0%| | 0/158 [00:00<?, ?it/s] 1%| | 1/158 [00:03<09:48, 3.75s/it] 1%|1 | 2/158 [00:07<10:09, 3.91s/it] 2%|1 | 3/158 [00:10<09:15, 3.58s/it] 3%|2 | 4/158 [00:14<09:34, 3.73s/it] 3%|3 | 5/158 [00:17<09:04, 3.56s/it]Traceback (most recent call last): File "C:\Users\ADMIN\Google Drive\python\my_programms\instabot-master\examples\download_photos_by_user.py", line 19, in bot.download_photos(medias) File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36-32\lib\site-packages\instabot\bot\bot.py", line 348, in download_photos return download_photos(self, medias, path, description) File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36-32\lib\site-packages\instabot\bot\bot_photo.py", line 39, in download_photos if not self.download_photo(media, path, description=description): File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36-32\lib\site-packages\instabot\bot\bot.py", line 345, in download_photo return download_photo(self, media_id, path, filename, description) File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36-32\lib\site-packages\instabot\bot\bot_photo.py", line 25, in download_photo photo = super(self.class, self).downloadPhoto(media_id, filename, False, path) File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36-32\lib\site-packages\instabot\api\api.py", line 198, in downloadPhoto return downloadPhoto(self, media_id, filename, media, path) File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36-32\lib\site-packages\instabot\api\api_photo.py", line 18, in downloadPhoto images = media['image_versions2']['candidates'] KeyError: 'image_versions2'

sudoguy commented 6 years ago

@ayush3298 You are forget to add bot.login(username="user", password="pass") after bot = Bot()

ayush3298 commented 6 years ago

It download some photos and after some photos it shows that error. And I logged in

sudoguy commented 6 years ago

@ayush3298 can you write me in telegram? https://t.me/sudoguy

sudoguy commented 6 years ago

Fixed https://github.com/instagrambot/instabot/commit/8ed47c249b6d03a5d239f16d6039bf4cfe3b4bcb

morier commented 6 years ago

i have same problem

usage: download_photos_by_user.py [-h] username download_photos_by_user.py: error: the following arguments are required: username

this is the error