1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-09-11 16:22:24 +02:00

Post properties video_view_count and video_duration

Closes #239.
This commit is contained in:
Alexander Graf 2019-05-07 15:47:52 +02:00
parent 67d3b4fca1
commit 6b24b54591

View File

@ -284,6 +284,20 @@ class Post:
return self._field('video_url')
return None
@property
def video_view_count(self) -> Optional[int]:
"""View count of the video, or None."""
if self.is_video:
return self._field('video_view_count')
return None
@property
def video_duration(self) -> Optional[float]:
"""Duration of the video in seconds, or None."""
if self.is_video:
return self._field('video_duration')
return None
@property
def viewer_has_liked(self) -> Optional[bool]:
"""Whether the viewer has liked the post, or None if not logged in."""