diff --git a/tests/mocked-data/_issue_28_1.json b/tests/mocked-data/_issue_28_1.json index a14b540..a939772 100644 --- a/tests/mocked-data/_issue_28_1.json +++ b/tests/mocked-data/_issue_28_1.json @@ -101,6 +101,8 @@ }, "source": "Twitter for iPhone", "legacy": { + "bookmark_count": 0, + "bookmarked": false, "created_at": "Tue May 16 09:49:50 +0000 2023", "conversation_id_str": "1658409412799737856", "display_text_range": [ @@ -236,6 +238,8 @@ }, "source": "Twitter for Android", "legacy": { + "bookmark_count": 0, + "bookmarked": false, "created_at": "Tue May 16 09:41:01 +0000 2023", "conversation_id_str": "1658407192859492355", "display_text_range": [ @@ -709,6 +713,8 @@ }, "source": "Twitter Web App", "legacy": { + "bookmark_count": 0, + "bookmarked": false, "created_at": "Thu Jul 06 19:22:59 +0000 2023", "conversation_id_str": "1676995076461821958", "display_text_range": [ @@ -758,6 +764,8 @@ } }, "legacy": { + "bookmark_count": 0, + "bookmarked": false, "created_at": "Thu Jul 06 19:32:52 +0000 2023", "conversation_id_str": "1677037919880507392", "display_text_range": [ diff --git a/tests/mocked-data/_issue_28_2.json b/tests/mocked-data/_issue_28_2.json index 89ac9b0..9d6f341 100644 --- a/tests/mocked-data/_issue_28_2.json +++ b/tests/mocked-data/_issue_28_2.json @@ -170,6 +170,8 @@ }, "source": "Twitter for Android", "legacy": { + "bookmark_count": 0, + "bookmarked": false, "created_at": "Tue May 16 09:41:01 +0000 2023", "conversation_id_str": "1658407192859492355", "display_text_range": [ @@ -451,6 +453,8 @@ } }, "legacy": { + "bookmark_count": 0, + "bookmarked": false, "created_at": "Tue May 16 10:38:37 +0000 2023", "conversation_id_str": "1658421690001502208", "display_text_range": [ @@ -674,6 +678,8 @@ }, "source": "Twitter for iPhone", "legacy": { + "bookmark_count": 0, + "bookmarked": false, "created_at": "Wed Jul 05 21:00:17 +0000 2023", "conversation_id_str": "1676697529461743622", "display_text_range": [ @@ -825,6 +831,8 @@ } }, "legacy": { + "bookmark_count": 0, + "bookmarked": false, "created_at": "Thu Jul 06 09:43:43 +0000 2023", "conversation_id_str": "1676889656225411072", "display_text_range": [ diff --git a/tests/mocked-data/manual_tweet_with_video_1.json b/tests/mocked-data/manual_tweet_with_video_1.json index e284d4d..3ca0978 100644 --- a/tests/mocked-data/manual_tweet_with_video_1.json +++ b/tests/mocked-data/manual_tweet_with_video_1.json @@ -100,6 +100,8 @@ }, "source": "Twitter Web App", "legacy": { + "bookmark_count": 3167, + "bookmarked": false, "created_at": "Wed Jun 21 13:21:20 +0000 2023", "conversation_id_str": "1671508600538161153", "display_text_range": [0, 84], diff --git a/tests/mocked-data/manual_tweet_with_video_2.json b/tests/mocked-data/manual_tweet_with_video_2.json index 8d02723..815819b 100644 --- a/tests/mocked-data/manual_tweet_with_video_2.json +++ b/tests/mocked-data/manual_tweet_with_video_2.json @@ -100,6 +100,8 @@ }, "source": "Twitter for iPhone", "legacy": { + "bookmark_count": 0, + "bookmarked": false, "created_at": "Thu Jun 22 05:34:45 +0000 2023", "conversation_id_str": "1671753569412820992", "display_text_range": [0, 42], diff --git a/twscrape/models.py b/twscrape/models.py index 761f85b..4883c85 100644 --- a/twscrape/models.py +++ b/twscrape/models.py @@ -168,6 +168,7 @@ class Tweet(JSONTrait): retweetCount: int likeCount: int quoteCount: int + bookmarkedCount: int conversationId: int conversationIdStr: str hashtags: list[str] @@ -225,6 +226,7 @@ def parse(obj: dict, res: dict): retweetCount=obj["retweet_count"], likeCount=obj["favorite_count"], quoteCount=obj["quote_count"], + bookmarkedCount=obj["bookmark_count"], conversationId=int(obj["conversation_id_str"]), conversationIdStr=obj["conversation_id_str"], hashtags=[x["text"] for x in get_or(obj, "entities.hashtags", [])],