Further clean Sonar: merge base RUN, strip comments, node imports
This commit is contained in:
parent
405e801851
commit
397871b012
4 changed files with 2 additions and 17 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -23,8 +23,6 @@ RUN apt-get update \
|
|||
novnc websockify \
|
||||
dos2unix \
|
||||
python3-pip \
|
||||
# && npx playwright install-deps firefox \
|
||||
&& apt-get install --no-install-recommends -y \
|
||||
libgtk-3-0 \
|
||||
libasound2 \
|
||||
libxcomposite1 \
|
||||
|
|
@ -43,12 +41,8 @@ RUN apt-get update \
|
|||
/usr/share/doc/* \
|
||||
/var/cache/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/tmp/*
|
||||
|
||||
# RUN node --version
|
||||
# RUN npm --version
|
||||
|
||||
RUN useradd -ms /bin/bash fgc \
|
||||
/var/tmp/* \
|
||||
&& useradd -ms /bin/bash fgc \
|
||||
&& ln -s /usr/share/novnc/vnc_auto.html /usr/share/novnc/index.html \
|
||||
&& pip install apprise
|
||||
|
||||
|
|
|
|||
5
gog.js
5
gog.js
|
|
@ -32,7 +32,6 @@ if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
|
|||
|
||||
const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist
|
||||
await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it
|
||||
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
||||
|
||||
const notify_games = [];
|
||||
let user;
|
||||
|
|
@ -42,7 +41,6 @@ try {
|
|||
|
||||
await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); // default 'load' takes forever
|
||||
|
||||
// page.click('#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll').catch(_ => { }); // does not work reliably, solved by setting CookieConsent above
|
||||
const signIn = page.locator('a:has-text("Sign in")').first();
|
||||
await Promise.any([signIn.waitFor(), page.waitForSelector('#menuUsername')]);
|
||||
while (await signIn.isVisible()) {
|
||||
|
|
@ -71,12 +69,9 @@ try {
|
|||
await iframe.locator('#second_step_authentication_send').click();
|
||||
await page.waitForTimeout(1000); // TODO still needed with wait for username below?
|
||||
}).catch(_ => { });
|
||||
// iframe.locator('iframe[title=reCAPTCHA]').waitFor().then(() => {
|
||||
// iframe.locator('.g-recaptcha').waitFor().then(() => {
|
||||
iframe.locator('text=Invalid captcha').waitFor().then(() => {
|
||||
console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.');
|
||||
notify('gog: got captcha during login. Please check.');
|
||||
// TODO solve reCAPTCHA?
|
||||
}).catch(_ => { });
|
||||
await page.waitForSelector('#menuUsername');
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ const gitBin = process.env.GIT_BIN || '/usr/bin/git';
|
|||
const runGit = (...args) => new Promise((resolve, reject) => {
|
||||
execFile(gitBin, args, { cwd: process.cwd() }, (error, stdout, stderr) => {
|
||||
if (stderr) console.error(`stderr: ${stderr}`);
|
||||
// if (stdout) console.log(`stdout: ${stdout}`);
|
||||
if (error) {
|
||||
console.log(`error: ${error.message}`);
|
||||
if (error.code === 'ENOENT' || error.message.includes('command not found')) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ const { fingerprint, headers } = new FingerprintGenerator().getFingerprint({
|
|||
|
||||
const context = await firefox.launchPersistentContext(cfg.dir.browser, {
|
||||
headless: cfg.headless,
|
||||
// viewport: { width: cfg.width, height: cfg.height },
|
||||
locale: 'en-US', // ignore OS locale to be sure to have english text for locators -> done via /en in URL
|
||||
userAgent: fingerprint.navigator.userAgent,
|
||||
viewport: {
|
||||
|
|
@ -29,7 +28,6 @@ const context = await firefox.launchPersistentContext(cfg.dir.browser, {
|
|||
'accept-language': headers['accept-language'],
|
||||
},
|
||||
});
|
||||
// await stealth(context);
|
||||
await new FingerprintInjector().attachFingerprintToPlaywright(context, { fingerprint, headers });
|
||||
|
||||
context.setDefaultTimeout(cfg.debug ? 0 : cfg.timeout);
|
||||
|
|
@ -61,7 +59,6 @@ try {
|
|||
db.data[title] = stat;
|
||||
}
|
||||
|
||||
// await page.pause();
|
||||
} catch (error) {
|
||||
process.exitCode ||= 1;
|
||||
console.error('--- Exception:');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue