parent
7329ee10d8
commit
793b7e82ba
@ -703,8 +703,10 @@ class Instaloader:
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
feed = data["user"]["edge_web_feed_timeline"]
|
feed = data["user"]["edge_web_feed_timeline"]
|
||||||
yield from (Post(self.context, edge["node"]) for edge in feed["edges"]
|
for edge in feed["edges"]:
|
||||||
if not edge["node"]["__typename"] == "GraphSuggestedUserFeedUnit")
|
node = edge["node"]
|
||||||
|
if node.get("__typename") in Post.supported_graphql_types() and node.get("shortcode") is not None:
|
||||||
|
yield Post(self.context, node)
|
||||||
if not feed["page_info"]["has_next_page"]:
|
if not feed["page_info"]["has_next_page"]:
|
||||||
break
|
break
|
||||||
data = self.context.graphql_query("d6f4427fbe92d846298cf93df0b937d3",
|
data = self.context.graphql_query("d6f4427fbe92d846298cf93df0b937d3",
|
||||||
|
@ -98,6 +98,11 @@ class Post:
|
|||||||
raise InvalidArgumentException("Wrong mediaid {0}, unable to convert to shortcode".format(str(mediaid)))
|
raise InvalidArgumentException("Wrong mediaid {0}, unable to convert to shortcode".format(str(mediaid)))
|
||||||
return b64encode(mediaid.to_bytes(9, 'big'), b'-_').decode().replace('A', ' ').lstrip().replace(' ', 'A')
|
return b64encode(mediaid.to_bytes(9, 'big'), b'-_').decode().replace('A', ' ').lstrip().replace(' ', 'A')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def supported_graphql_types() -> List[str]:
|
||||||
|
"""The values of __typename fields that the :class:`Post` class can handle."""
|
||||||
|
return ["GraphImage", "GraphVideo", "GraphSidecar"]
|
||||||
|
|
||||||
def _asdict(self):
|
def _asdict(self):
|
||||||
node = self._node
|
node = self._node
|
||||||
if self._full_metadata_dict:
|
if self._full_metadata_dict:
|
||||||
|
Loading…
Reference in New Issue
Block a user