first commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// utils/x-headers.util.ts
|
||||
export function buildXHeaders(authToken: string, ct0: string) {
|
||||
return {
|
||||
authority: 'x.com',
|
||||
accept: '*/*',
|
||||
'accept-language': 'en-US,en;q=0.9',
|
||||
authorization: `Bearer ${process.env.X_BEARER_TOKEN}`,
|
||||
'content-type': 'application/json',
|
||||
cookie: `auth_token=${authToken}; ct0=${ct0};`,
|
||||
origin: 'https://x.com',
|
||||
referer: 'https://x.com/home',
|
||||
host: 'api.x.com',
|
||||
'user-agent':
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.2 Safari/605.1.15',
|
||||
'x-csrf-token': ct0,
|
||||
'x-twitter-active-user': 'yes',
|
||||
'x-twitter-auth-type': 'OAuth2Session',
|
||||
'x-twitter-client-language': 'en',
|
||||
};
|
||||
}
|
||||
|
||||
export function buildXCookies() {
|
||||
return [
|
||||
{
|
||||
name: "ct0",
|
||||
value: process.env.X_COOKIE_CT0,
|
||||
},
|
||||
{
|
||||
name: "auth_token",
|
||||
value: process.env.X_COOKIE_AUTH_TOKEN,
|
||||
},
|
||||
{name: "lang", value: "en"},
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user