mirror of
https://github.com/instaloader/instaloader.git
synced 2024-10-27 13:42:32 +01:00
Add method to get title of post (#976)
Co-authored-by: Tejas Chauhan <tejas.chauhan@kevit.io> Co-authored-by: Alexander Graf <17130992+aandergr@users.noreply.github.com>
This commit is contained in:
parent
3955540080
commit
43c521afa9
@ -128,6 +128,14 @@ class Post:
|
|||||||
"""The mediaid is a decimal representation of the media shortcode."""
|
"""The mediaid is a decimal representation of the media shortcode."""
|
||||||
return int(self._node['id'])
|
return int(self._node['id'])
|
||||||
|
|
||||||
|
@property
|
||||||
|
def title(self) -> Optional[str]:
|
||||||
|
"""Title of post"""
|
||||||
|
try:
|
||||||
|
return self._field('title')
|
||||||
|
except KeyError:
|
||||||
|
return None
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<Post {}>'.format(self.shortcode)
|
return '<Post {}>'.format(self.shortcode)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user