Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.9b2: sidecar posts url is not set when comming from Hashtag.get_posts() #1427

Closed
4bo opened this issue Feb 28, 2022 · 4 comments
Closed

4.9b2: sidecar posts url is not set when comming from Hashtag.get_posts() #1427

4bo opened this issue Feb 28, 2022 · 4 comments
Labels
bug Bug good first issue Easy to tackle, good starting point for new Instaloader contributors stale Issue is inactive for a long time

Comments

@4bo
Copy link

4bo commented Feb 28, 2022

Describe the bug
using Hashtag.get_posts(), when post type is Sidecar, using post.url raises this error:

app_1  |   File "/usr/local/lib/python3.9/site-packages/instaloader/structures.py", line 296, in url
app_1  |     return self._node["display_url"] if "display_url" in self._node else self._node["display_src"]
app_1  | KeyError: 'display_src'

To Reproduce

hashtag = Hashtag.from_name(client.context, name="cat")
posts = hashtag.get_posts()
for post in posts:
    print(post.url)

Expected behavior
print url!

Instaloader version
4.9b2

@4bo 4bo added the bug Bug label Feb 28, 2022
@scanansi
Copy link

I am seeing that the response data from the explore/tags/{name}/ call is not providing a 'display_src' but a 'display_url' now instead. see screenshot. I am not able to fix the bug on the repo, I can just share what i see. Hope that helps

image

@4bo
Copy link
Author

4bo commented Feb 28, 2022

@scanansi the url property also checks display_url, but can not find it:

    return self._node["display_url"] if "display_url" in self._node else self._node["display_src"]

@aandergr
Copy link
Member

aandergr commented Mar 4, 2022

Thanks for trying out our beta and for reporting this bug, @4bo. You can retrieve the URLs for a sidecar post with media.display_url for media in post.get_sidecar_nodes(). Accessing post.url of a sidecar does not make any sense, since a sidecar consists of multiple media, and as such, of multiple URLs. Still, Instaloader should not produce a KeyError when accessing, rather it should return the URL of the first sidecar media, to be consistent with sidecar Post instances of other origin than Hashtag posts.

@aandergr aandergr added the good first issue Easy to tackle, good starting point for new Instaloader contributors label Mar 18, 2022
@github-actions
Copy link

github-actions bot commented Aug 1, 2022

There has been no activity on this issue for an extended period of time. This issue will be closed after further 14 days of inactivity.

@github-actions github-actions bot added the stale Issue is inactive for a long time label Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug good first issue Easy to tackle, good starting point for new Instaloader contributors stale Issue is inactive for a long time
Projects
None yet
Development

No branches or pull requests

3 participants