Fix detection of sidecars and videos
This was noticeable when downloading hashtags. Fixes #133
This commit is contained in:
parent
45fe509ac4
commit
cc34b8340f
@ -206,10 +206,7 @@ class Post:
|
|||||||
@property
|
@property
|
||||||
def typename(self) -> str:
|
def typename(self) -> str:
|
||||||
"""Type of post, GraphImage, GraphVideo or GraphSidecar"""
|
"""Type of post, GraphImage, GraphVideo or GraphSidecar"""
|
||||||
if '__typename' in self._node:
|
return self._field('__typename')
|
||||||
return self._node['__typename']
|
|
||||||
# if __typename is not in node, it is an old image or video
|
|
||||||
return 'GraphImage'
|
|
||||||
|
|
||||||
def get_sidecar_nodes(self) -> Iterator[PostSidecarNode]:
|
def get_sidecar_nodes(self) -> Iterator[PostSidecarNode]:
|
||||||
"""Sidecar nodes of a Post with typename==GraphSidecar."""
|
"""Sidecar nodes of a Post with typename==GraphSidecar."""
|
||||||
|
Loading…
Reference in New Issue
Block a user