mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 08:47:43 +00:00
feat: add proxy rotation (settable per store) (#1026)
This commit is contained in:
@@ -1,25 +1,14 @@
|
||||
import {startAPIServer, stopAPIServer} from './web';
|
||||
import {Browser} from 'puppeteer';
|
||||
import {adBlocker} from './adblocker';
|
||||
import {config} from './config';
|
||||
import {getSleepTime} from './util';
|
||||
import {logger} from './logger';
|
||||
import puppeteer from 'puppeteer-extra';
|
||||
import resourceBlock from 'puppeteer-extra-plugin-block-resources';
|
||||
import stealthPlugin from 'puppeteer-extra-plugin-stealth';
|
||||
import {storeList} from './store/model';
|
||||
import {tryLookupAndLoop} from './store';
|
||||
|
||||
puppeteer.use(stealthPlugin());
|
||||
if (config.browser.lowBandwidth) {
|
||||
puppeteer.use(
|
||||
resourceBlock({
|
||||
blockedTypes: new Set(['image', 'font'] as const)
|
||||
})
|
||||
);
|
||||
} else {
|
||||
puppeteer.use(adBlocker);
|
||||
}
|
||||
|
||||
let browser: Browser | undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user