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

Multiple KeyErrors #32

Closed Teoretic6 closed 5 years ago

Teoretic6 commented 5 years ago

I tried the Quick Start example and got multiple errors.

In the line: self.resources = [resource["src"] for resource in data["display_resources"]] there's an error: Error: 'display_resources'

I changed it to thumbnail_resources (because you get this in the data object): self.resources = [resource["src"] for resource in data["thumbnail_resources"]]

but got another error: Error: 'edge_sidecar_to_children' which can also be fixed by changing the line to get the data by another key: for edge in data["edge_media_to_caption"]["edges"]:

I suppose the return data from requests to Instagram has changed.

Can I PR on this?

Teoretic6 commented 5 years ago

Actually there's an PR on this already from @posox :) https://github.com/OlegYurchik/InstaParser/pull/31

posox commented 5 years ago

/assign

OlegYurchik commented 5 years ago

Hello anythere! Can you give me code for getting this error? I want to understand where we can catch this error

Teoretic6 commented 5 years ago

@OlegYurchik sure! File instaparser/entities.py Lines: 141, 145

OlegYurchik commented 5 years ago

Fixed