This commit is contained in:
NAME
2026-05-11 08:02:34 +00:00
parent c72a38201a
commit b5cf2502be
13 changed files with 534 additions and 35 deletions
+3 -9
View File
@@ -1,12 +1,6 @@
// src/modules/x-browser/x-browser.service.ts
import {
Injectable,
Logger,
OnModuleInit,
OnModuleDestroy, HttpException,
} from '@nestjs/common';
import {chromium, Browser, BrowserContext, Page} from 'playwright';
import {buildXCookies} from "./utils/x-headers.util";
import {HttpException, Injectable, Logger, OnModuleDestroy, OnModuleInit,} from '@nestjs/common';
import {Browser, BrowserContext, chromium, Page} from 'playwright';
import {rand} from "../helper";
export interface BrowserAccount {
@@ -91,7 +85,7 @@ export class XBrowserService implements OnModuleInit, OnModuleDestroy {
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' +
'(KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
viewport: {width: 1366, height: 768},
locale: 'en-US',
locale: process.env.BROWSER_LOCALE || 'en-US',
proxy: account.proxy ? {server: account.proxy} : undefined,
});
console.log('getOrCreateContext:5')
+1 -1
View File
@@ -77,7 +77,7 @@ export class XPosterRouterService {
},
],
proxy: '',
userAgent: ''
userAgent: process.env.BROWSER_USER_AGENT || '',
},
};