From 88ea1b4c54d0a88af50168ea534fb4b1afa6022e Mon Sep 17 00:00:00 2001 From: Daniel Zeitoun Date: Mon, 5 Feb 2024 12:03:31 +0100 Subject: [PATCH 1/5] adding/filling is_paid_partnership flag to Story/extract_story_v1 --- instagrapi/extractors.py | 1 + instagrapi/types.py | 1 + 2 files changed, 2 insertions(+) diff --git a/instagrapi/extractors.py b/instagrapi/extractors.py index ab2b5cf8..c4cfa935 100644 --- a/instagrapi/extractors.py +++ b/instagrapi/extractors.py @@ -414,6 +414,7 @@ def extract_story_v1(data): story["links"].append(StoryLink(**link)) story["user"] = extract_user_short(story.get("user")) story["sponsor_tags"] = [tag["sponsor"] for tag in story.get("sponsor_tags", [])] + story["is_paid_partnership"] = story.get("is_paid_partnership") return Story(**story) diff --git a/instagrapi/types.py b/instagrapi/types.py index 123eb9a7..81c1e9f1 100644 --- a/instagrapi/types.py +++ b/instagrapi/types.py @@ -302,6 +302,7 @@ class Story(TypesBaseModel): video_url: Optional[HttpUrl] = None # for Video and IGTV video_duration: Optional[float] = 0.0 # for Video and IGTV sponsor_tags: List[UserShort] + is_paid_partnership: Optional[bool] mentions: List[StoryMention] links: List[StoryLink] hashtags: List[StoryHashtag] From 3c42d5cd29dd4f8303079165a89abb171280e2a7 Mon Sep 17 00:00:00 2001 From: Daniel Zeitoun Date: Mon, 5 Feb 2024 15:59:23 +0100 Subject: [PATCH 2/5] adding bio_links --- instagrapi/types.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/instagrapi/types.py b/instagrapi/types.py index 81c1e9f1..e5b2685e 100644 --- a/instagrapi/types.py +++ b/instagrapi/types.py @@ -29,6 +29,14 @@ class Resource(TypesBaseModel): thumbnail_url: HttpUrl media_type: int +class BioLink(TypesBaseModel): + link_id: str + url: str + lynx_url: Optional[str] = None + link_type: Optional[str] = None + title: Optional[str] = None + is_pinned: Optional[bool] = None + open_external_url_with_in_app_browser: Optional[bool] = None class User(TypesBaseModel): pk: str @@ -42,6 +50,7 @@ class User(TypesBaseModel): follower_count: int following_count: int biography: Optional[str] = "" + bio_links: List[BioLink] = [] external_url: Optional[str] = None account_type: Optional[int] = None is_business: bool From f26984f841b7ddcec1d84558b9156e7f0999367a Mon Sep 17 00:00:00 2001 From: Daniel Zeitoun Date: Mon, 5 Feb 2024 18:20:36 +0100 Subject: [PATCH 3/5] order imports --- instagrapi/extractors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instagrapi/extractors.py b/instagrapi/extractors.py index c4cfa935..c67df0c8 100644 --- a/instagrapi/extractors.py +++ b/instagrapi/extractors.py @@ -24,10 +24,10 @@ Resource, Story, StoryLink, - StoryMedia, - StoryMention, StoryLocation, StoryHashtag, + StoryMedia, + StoryMention, Track, User, UserShort, From 34c40373d57c69cd0d39a599624d22c8244aabcf Mon Sep 17 00:00:00 2001 From: Daniel Zeitoun Date: Wed, 7 Feb 2024 11:25:10 +0100 Subject: [PATCH 4/5] increase version number --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b46c4efb..0f6391f3 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ setup( name="instagrapi", - version="2.0.4", + version="2.1.0", author="Mark Subzeroid", author_email="143403577+subzeroid@users.noreply.github.com", license="MIT", From 2d18e43fa7543134520565f5743f1820e5ee4f69 Mon Sep 17 00:00:00 2001 From: Daniel Zeitoun Date: Tue, 13 Feb 2024 18:45:11 +0100 Subject: [PATCH 5/5] adding imported_taken_at to Story --- instagrapi/types.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/instagrapi/types.py b/instagrapi/types.py index e5b2685e..500db742 100644 --- a/instagrapi/types.py +++ b/instagrapi/types.py @@ -29,6 +29,7 @@ class Resource(TypesBaseModel): thumbnail_url: HttpUrl media_type: int + class BioLink(TypesBaseModel): link_id: str url: str @@ -38,6 +39,7 @@ class BioLink(TypesBaseModel): is_pinned: Optional[bool] = None open_external_url_with_in_app_browser: Optional[bool] = None + class User(TypesBaseModel): pk: str username: str @@ -253,6 +255,7 @@ class StoryHashtag(TypesBaseModel): height: Optional[float] = None rotation: Optional[float] = None + class StoryLocation(TypesBaseModel): location: Location x: Optional[float] = None @@ -304,6 +307,7 @@ class Story(TypesBaseModel): id: str code: str taken_at: datetime + imported_taken_at: Optional[datetime] = None media_type: int product_type: Optional[str] = "" thumbnail_url: Optional[HttpUrl] = None