mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 09:57:38 +00:00
fix: screenshot size, add screenshot config setting (#53)
This commit is contained in:
+4
-3
@@ -21,10 +21,11 @@ const notifications = {
|
||||
};
|
||||
|
||||
const page = {
|
||||
height: 1920,
|
||||
capture: process.env.SCREENSHOT ?? 'true',
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
navigationTimeout: Number(process.env.PAGE_TIMEOUT) ?? 30000,
|
||||
userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',
|
||||
width: 1080
|
||||
userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'
|
||||
};
|
||||
|
||||
const rateLimitTimeout = Number(process.env.RATE_LIMIT_TIMEOUT) ?? 5000;
|
||||
|
||||
+4
-2
@@ -68,8 +68,10 @@ async function lookup(store: Store) {
|
||||
Logger.info(`🚀🚀🚀 [${store.name}] ${graphicsCard} IN STOCK 🚀🚀🚀`);
|
||||
Logger.info(link.url);
|
||||
|
||||
Logger.debug('ℹ saving screenshot');
|
||||
await page.screenshot({path: `success-${Date.now()}.png`});
|
||||
if (Config.page.capture === 'true') {
|
||||
Logger.debug('ℹ saving screenshot');
|
||||
await page.screenshot({path: `success-${Date.now()}.png`});
|
||||
}
|
||||
|
||||
const givenUrl = store.cartUrl ? store.cartUrl : link.url;
|
||||
await open(givenUrl);
|
||||
|
||||
Reference in New Issue
Block a user