diff --git a/.dockerignore b/.dockerignore index a46f2d4..f9686e7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,3 +6,4 @@ node_modules runInDocker.* yt-cookies.json wiki +build diff --git a/.github/workflows/publish-docker-image.yaml b/.github/workflows/publish-docker-image.yaml index 16df902..e2a8dcf 100644 --- a/.github/workflows/publish-docker-image.yaml +++ b/.github/workflows/publish-docker-image.yaml @@ -6,6 +6,8 @@ on: paths-ignore: - '**/wiki/**' - '/wiki/**' + - 'docker-compose.yml' + - '.env' env: IMAGE_TAG: alexincube/aicotest diff --git a/docker-compose.yml b/docker-compose.yml index 60da987..ef6b42f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,9 +37,3 @@ services: - aicbot-mongo depends_on: - aicbot-mongo - aicbot-watchtower: - image: containrrr/watchtower - container_name: aicbot-watchtower - volumes: - - /var/run/docker.sock:/var/run/docker.sock - command: --interval 3600 aicbot-bot diff --git a/package.json b/package.json index 36c3c74..6dd0fa2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aicbot", - "version": "3.2.0", + "version": "3.2.1", "description": "Discord Bot for playing music", "main": "build/main.js", "scripts": { diff --git a/src/CookiesAutomation.ts b/src/CookiesAutomation.ts index 72e0612..84dfb9e 100644 --- a/src/CookiesAutomation.ts +++ b/src/CookiesAutomation.ts @@ -48,13 +48,19 @@ export async function getYoutubeCookie() { } const cookies = await page.cookies(); + + await browser.close(); + + if (cookies.length < 10) { + loggerError('Something went wrong during authentication to Google'); + return undefined; + } + const cookiesJson = JSON.stringify(cookies, null, 2); fs.writeFileSync('yt-cookies.json', cookiesJson); //loggerSend(cookiesJson); - await browser.close(); - if (!cookies) loggerError('Failed to fetch YouTube cookies'); if (cookiesJson) loggerSend('YouTube Cookies fetched successfully'); diff --git a/wiki/Setup.md b/wiki/Setup.md index 6cbc7b1..2cc1160 100644 --- a/wiki/Setup.md +++ b/wiki/Setup.md @@ -36,9 +36,6 @@ Also you need retrieve token, client id and enable intents on Discord Developer # 🐋 Run in Docker (recommended) -> [!NOTE] -> Using Docker provides the auto-update feature - - Install [Docker](https://www.docker.com/get-started/) - Copy docker-compose.yml, Dockerfile in empty folder - Follow the [Configure .env](#-configure-env) section and copy .env.production in folder with docker-compose.yml etc.