mirror of
https://github.com/instaloader/instaloader.git
synced 2024-08-18 20:59:38 +02:00
parent
fbd7df2a90
commit
c0e5d0475b
@ -1115,6 +1115,21 @@ class StoryItem:
|
|||||||
def __hash__(self) -> int:
|
def __hash__(self) -> int:
|
||||||
return hash(self.mediaid)
|
return hash(self.mediaid)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_mediaid(cls, context: InstaloaderContext, mediaid: int):
|
||||||
|
"""Create a StoryItem object from a given mediaid.
|
||||||
|
|
||||||
|
.. versionadded:: 4.9
|
||||||
|
"""
|
||||||
|
pic_json = context.graphql_query(
|
||||||
|
'2b0673e0dc4580674a88d426fe00ea90',
|
||||||
|
{'shortcode': Post.mediaid_to_shortcode(mediaid)}
|
||||||
|
)
|
||||||
|
shortcode_media = pic_json['data']['shortcode_media']
|
||||||
|
if shortcode_media is None:
|
||||||
|
raise BadResponseException("Fetching StoryItem metadata failed.")
|
||||||
|
return cls(context, shortcode_media)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _iphone_struct(self) -> Dict[str, Any]:
|
def _iphone_struct(self) -> Dict[str, Any]:
|
||||||
if not self._context.iphone_support:
|
if not self._context.iphone_support:
|
||||||
|
Loading…
Reference in New Issue
Block a user