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

Add more return fields on 'get_sidecar_nodes' method #2222

Open
Sprizgola opened this issue Mar 24, 2024 · 1 comment
Open

Add more return fields on 'get_sidecar_nodes' method #2222

Sprizgola opened this issue Mar 24, 2024 · 1 comment
Labels
feature suggestion Feature suggestion

Comments

@Sprizgola
Copy link

Provide us a use case of the feature
The user should call get_sidecar_nodes() or adding a list of GraphImage fields at the method call such as __get_sidecar_nodes(fields=["id", "shortcode", ....])_.
The return type should be either a GraphImage or a PostSidecarNode (as currently is)

Describe the solution you'd like
It could be a nice thing to add the fields in the instaloader.structure.Post.get_sidecar_nodes method.
The node is already in memory during the execution, so it could be a nice feature to add.

The actual implementation yield this response:

yield PostSidecarNode(is_video=is_video, display_url=display_url, video_url=node['video_url'] if is_video else None)

If the feature request is accepted, would you be willing to submit a pull request?
Yes (with some assistance during PR!)

Additional context
This feature could be a cool thing because, in my case, i need the metadata for every image without the needing to access private attribute.

@Sprizgola Sprizgola added the feature suggestion Feature suggestion label Mar 24, 2024
@Sprizgola Sprizgola changed the title Adding more return fields on 'get_sidecar_nodes' method Add more return fields on 'get_sidecar_nodes' method Mar 24, 2024
@aandergr
Copy link
Member

PostSidecarNode could be modified to contain more of the fields that are provided with the sidecar nodes. PostSidecarNode is currently implemented as a NamedTuple, however, these can be easily and backwards-compatibly refactored to a proper class, like has recently been done with PostComment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature suggestion Feature suggestion
Projects
None yet
Development

No branches or pull requests

2 participants