OlegYurchik / pyInstagram

This is a simple and easy-to-use library for interacting with the Instagram. The library works through the web interface of the Instagram and does not depend on the official API
MIT License
232 stars 49 forks source link

listing all comments on a media #10

Closed apexible closed 6 years ago

apexible commented 6 years ago

sorry I am new in python. this codes import instagram agent = instagram.Agent() account = instagram.Account('iyikianneoldum') agent.update(account) print(agent.getMedia(account, count=20))

lists last 20 media.

how can I list all comments on a media. can you share an example

r3dnck commented 6 years ago
media = agent.getMedia(account, count=20)

for m in media[0]:
    comments = agent.getComments(m, count=m.comments_count)  
    print(comments)
apexible commented 6 years ago

@r3dnck thank you. can I ask you something my post code = Bi0YDK7njB_

i write comments = agent.getComments('Bi0YDK7njB_', count=20)

i am getting an error like this TypeError: 'media' must be Media type

why?

OlegYurchik commented 6 years ago

You should create Media and send it to getComments

OlegYurchik commented 6 years ago

media=Media('Bi0YDK7njB_') comments=agent.getComments(media, count=20)

apexible commented 6 years ago

its working thank you so much