Skip to content

Commit 0bc6fee

Browse files
committed
fix: twitter scraper key issue
1 parent 8dc0470 commit 0bc6fee

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

app/services/scrapers/twitter/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,14 @@ def _process_tweet(self, tweet_data: Dict):
116116
self._process_tweet_Twitter154(tweet_data)
117117

118118
def _process_tweet_twitter135(self, tweet_data: Dict):
119-
entries = tweet_data["data"]["threaded_conversation_with_injections_v2"][
119+
tweet_data_instructions = tweet_data["data"]["threaded_conversation_with_injections_v2"][
120120
"instructions"
121-
][0]["entries"]
121+
]
122+
entries_instruction = next(
123+
(instr for instr in tweet_data_instructions if 'entries' in instr),
124+
None
125+
)
126+
entries = entries_instruction['entries']
122127
tweets = []
123128
for i in entries:
124129
if (

0 commit comments

Comments
 (0)