This commit is contained in:
NAME
2026-05-12 02:30:05 +00:00
parent b5cf2502be
commit c8ccb032d2
7 changed files with 194 additions and 142 deletions
+2 -29
View File
@@ -5,6 +5,7 @@ import {BrowserAccount, XBrowserService} from "./x-browser.service";
import {XApiService} from "./x-api.service";
import {XCookieService} from "./x-cookie.service";
import {NotifyService} from "../notify.service";
import {getAccount} from "./utils/x-headers.util";
export enum SUPPORT_SOCIAL_PROVIDERS {
FB = 'fb',
@@ -51,35 +52,7 @@ export class XPosterRouterService {
private readonly browserSvc: XBrowserService,
private readonly notifyService: NotifyService,
) {
this.X_UNIFIED_ACCOUNT = {
id: process.env.X_USERNAME!,
api: {
accessToken: '',
accessSecret: '',
appKey: process.env.TWITTER_CLIENT_ID + '',
appSecret: process.env.TWITTER_CLIENT_SECRET!,
},
cookie: {
authToken: process.env.X_COOKIE_AUTH_TOKEN!, // auth_token cookie
ct0: process.env.X_COOKIE_CT0!, // ct0 cookie (CSRF token)
proxy: '',
},
browser: {
accountId: process.env.X_USERNAME!,
cookies: [
{
name: 'auth_token',
value: process.env.X_COOKIE_AUTH_TOKEN!,
},
{
name: 'ct0',
value: process.env.X_COOKIE_CT0!,
},
],
proxy: '',
userAgent: process.env.BROWSER_USER_AGENT || '',
},
};
this.X_UNIFIED_ACCOUNT = getAccount();
console.error(this.X_UNIFIED_ACCOUNT);