Fix detection of sidecars and videos

This was noticeable when downloading hashtags.
Fixes #133
This commit is contained in:
André Koch-Kramer 2018-06-07 15:32:23 +02:00
parent 45fe509ac4
commit cc34b8340f

View File

@ -206,10 +206,7 @@ class Post:
@property
def typename(self) -> str:
"""Type of post, GraphImage, GraphVideo or GraphSidecar"""
if '__typename' in self._node:
return self._node['__typename']
# if __typename is not in node, it is an old image or video
return 'GraphImage'
return self._field('__typename')
def get_sidecar_nodes(self) -> Iterator[PostSidecarNode]:
"""Sidecar nodes of a Post with typename==GraphSidecar."""