diff --git a/lib/routes/twitter/api/web-api/api.ts b/lib/routes/twitter/api/web-api/api.ts index 3e58fa363b0f08..6d331a2049b48b 100644 --- a/lib/routes/twitter/api/web-api/api.ts +++ b/lib/routes/twitter/api/web-api/api.ts @@ -1,4 +1,4 @@ -import { baseUrl, gqlMap, gqlFeatures, gqlMapThirdParty } from './constants'; +import { baseUrl, gqlMap, gqlFeatures } from './constants'; import { config } from '@/config'; import cache from '@/utils/cache'; import { twitterGot, paginationTweets, gatherLegacyFromData } from './utils'; @@ -24,7 +24,7 @@ const getUserData = (id) => }; if (config.twitter.thirdPartyApi) { - const endpoint = id.startsWith('+') ? gqlMapThirdParty.UserByRestId : gqlMapThirdParty.UserByScreenName; + const endpoint = id.startsWith('+') ? gqlMap.UserByRestId : gqlMap.UserByScreenName; return ofetch(`${config.twitter.thirdPartyApi}${endpoint}`, { method: 'GET', diff --git a/lib/routes/twitter/api/web-api/constants.ts b/lib/routes/twitter/api/web-api/constants.ts index 8906ce759abc9d..059dc0f85de496 100644 --- a/lib/routes/twitter/api/web-api/constants.ts +++ b/lib/routes/twitter/api/web-api/constants.ts @@ -15,10 +15,6 @@ const graphQLEndpointsPlain = [ const gqlMap = Object.fromEntries(graphQLEndpointsPlain.map((endpoint) => [endpoint.split('/')[3].replace(/V2$|Query$|QueryV2$/, ''), endpoint])); -const graphQLEndpointsThirdParty = ['/graphql/xxxxxxx/UserByScreenName', '/graphql/xxxxxxx/UserByRestId']; - -const gqlMapThirdParty = Object.fromEntries(graphQLEndpointsThirdParty.map((endpoint) => [endpoint.split('/')[3].replace(/V2$|Query$|QueryV2$/, ''), endpoint])); - const gqlFeatureUser = { hidden_profile_subscriptions_enabled: true, rweb_tipjar_consumption_enabled: true, @@ -116,4 +112,4 @@ const timelineParams = { const bearerToken = 'Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA'; -export { baseUrl, gqlMap, gqlMapThirdParty, gqlFeatures, timelineParams, bearerToken }; +export { baseUrl, gqlMap, gqlFeatures, timelineParams, bearerToken };