From 6e07da913325d488e789e2dc68fbeb18fa750bf6 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Fri, 15 Nov 2024 20:54:21 +0800 Subject: [PATCH 1/2] Try fix --- lib/routes/twitter/api/web-api/utils.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/routes/twitter/api/web-api/utils.ts b/lib/routes/twitter/api/web-api/utils.ts index c3ed221b7ed70f..d3902425deecc8 100644 --- a/lib/routes/twitter/api/web-api/utils.ts +++ b/lib/routes/twitter/api/web-api/utils.ts @@ -286,6 +286,14 @@ export function gatherLegacyFromData(entries: any[], filterNested?: string[], us t.legacy.quoted_status = quote.legacy; t.legacy.quoted_status.user = quote.core.user_result?.result?.legacy || quote.core.user_results?.result?.legacy; } + if (t.note_tweet) { + const tmp = t.note_tweet.note_tweet_results.result; + t.legacy.entities.hashtags = tmp.entity_set.hashtags; + t.legacy.entities.symbols = tmp.entity_set.symbols; + t.legacy.entities.urls = tmp.entity_set.urls; + t.legacy.entities.user_mentions = tmp.entity_set.user_mentions; + t.legacy.full_text = tmp.text; + } } const legacy = tweet.legacy; if (legacy) { From 6add8f810f133a91ea8015f32fafa8a1ac5dc60c Mon Sep 17 00:00:00 2001 From: lifegpc Date: Fri, 15 Nov 2024 21:46:15 +0800 Subject: [PATCH 2/2] apply fix for mobile api --- lib/routes/twitter/api/mobile-api/api.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/routes/twitter/api/mobile-api/api.ts b/lib/routes/twitter/api/mobile-api/api.ts index 6552fc1f2d99fe..d4b79e511612a4 100644 --- a/lib/routes/twitter/api/mobile-api/api.ts +++ b/lib/routes/twitter/api/mobile-api/api.ts @@ -160,6 +160,14 @@ function gatherLegacyFromData(entries, filterNested, userId) { t.legacy.quoted_status = quote.legacy; t.legacy.quoted_status.user = quote.core.user_result?.result?.legacy || quote.core.user_results?.result?.legacy; } + if (t.note_tweet) { + const tmp = t.note_tweet.note_tweet_results.result; + t.legacy.entities.hashtags = tmp.entity_set.hashtags; + t.legacy.entities.symbols = tmp.entity_set.symbols; + t.legacy.entities.urls = tmp.entity_set.urls; + t.legacy.entities.user_mentions = tmp.entity_set.user_mentions; + t.legacy.full_text = tmp.text; + } } const legacy = tweet.legacy; if (legacy) {