From cc34b8340fb477864f46f8bb92730e152931c2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Koch-Kramer?= Date: Thu, 7 Jun 2018 15:32:23 +0200 Subject: [PATCH] Fix detection of sidecars and videos This was noticeable when downloading hashtags. Fixes #133 --- instaloader/structures.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/instaloader/structures.py b/instaloader/structures.py index a15dd31..e05da77 100644 --- a/instaloader/structures.py +++ b/instaloader/structures.py @@ -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."""