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 method to get title of post (#969) #976

Merged

Conversation

17it151tejaschauhan
Copy link
Contributor

For the solution of issue #969

-- A motivation for this change

  • Fixes #
  • Some post of instagram has title as same as caption but current version of instaloader does not give title of post.
  • To get title of post, I've added one property method called title as same as caption method in class Post.

-- The completeness of this change

  • In json response of graphql query, it gives title of post with key name as title as same as location in value of shortcode_media
    but instaloader was not considering it.

  • Added one method named title in class Post which will get value of title from _full_metadata_dict dictionary.

  • If title is not present in json response, it will return None.

  • Need to update documentation for this method.

  • I consider it for ready to be merged.

  • Please guide me if necessary.

  • Example of use case:

from instaloader.instaloader import Instaloader, Post
L = Instaloader()
post = Post.from_shortcode(L.context, "CKA_09eMMVE")
print("Title of Post : ", post.title)

instaloader/structures.py Outdated Show resolved Hide resolved
@aandergr aandergr changed the base branch from master to upcoming/v4.7 January 16, 2021 17:44
@aandergr aandergr merged commit 43c521a into instaloader:upcoming/v4.7 Jan 16, 2021
@aandergr
Copy link
Member

Thanks! Merged for upcoming version 4.7.

@17it151tejaschauhan
Copy link
Contributor Author

Thanks! Merged for upcoming version 4.7.

Thanks for such a great library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants