From 927adc6d7120305e1bcb79dc94dd158658bbf801 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sat, 14 Sep 2024 20:04:23 -0700 Subject: [PATCH 01/76] End-to-end test workflow --- .github/workflows/test.yml | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1698167 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +name: Test +on: + workflow_dispatch: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + script-method: + name: Test plugin + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download yt-dlp + run: curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o yt-dlp + - name: Install and build server dependencies + run: cd server/ && yarn install --frozen-lockfile && npx tsc + - name: Install plugin + run: | + mkdir ~/yt-dlp-plugins && curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o ~/yt-dlp-plugins/yt-dlp-get-pot.zip + cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ + - name: Test script method + run: | + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js") + echo $script_response + if [[ "$script_response" != *"BgUtilScriptPot: _get_pot_via_script response"* ]]; then + echo "BgUtilScriptPot was not invoked" + exit 1 + fi + - name: Test server method + run: | + cd server/ + node build/main.js& + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416") + echo $script_response + if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then + echo "BgUtilHTTPPot was not invoked" + exit 1 + fi From 591bb45558820cd51c9b5d48085ce7c903675600 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sat, 14 Sep 2024 20:05:25 -0700 Subject: [PATCH 02/76] Chmod --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1698167..c7adcc9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Download yt-dlp - run: curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o yt-dlp + run: curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o yt-dlp && chmod +x ./yt-dlp - name: Install and build server dependencies run: cd server/ && yarn install --frozen-lockfile && npx tsc - name: Install plugin From 46f382e74550175eedbb746b12ff959044e1932e Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sat, 14 Sep 2024 20:26:21 -0700 Subject: [PATCH 03/76] Capture stderr --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c7adcc9..52b0555 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ - name: Test script method run: | - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js") + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js 2>&1") echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: _get_pot_via_script response"* ]]; then echo "BgUtilScriptPot was not invoked" @@ -33,7 +33,7 @@ jobs: run: | cd server/ node build/main.js& - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416") + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416 2>&1") echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then echo "BgUtilHTTPPot was not invoked" From d37e6a0c2a5a1aedd3b84c672d449ffcb518f00f Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sat, 14 Sep 2024 20:27:32 -0700 Subject: [PATCH 04/76] fix 2>&1 position --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 52b0555..f0466e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ - name: Test script method run: | - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js 2>&1") + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: _get_pot_via_script response"* ]]; then echo "BgUtilScriptPot was not invoked" From 801f146b34e32e1b29aaee9d336bf4cbd711fba5 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sat, 14 Sep 2024 20:30:31 -0700 Subject: [PATCH 05/76] cd .. --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f0466e1..05fb277 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,7 @@ jobs: run: | cd server/ node build/main.js& + cd .. script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416 2>&1") echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then From 50c755550b09898ce093dd0f3bbf027f4e43c5a7 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 15:31:58 +1200 Subject: [PATCH 06/76] Update .github/workflows/test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 05fb277..d395423 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: cd server/ node build/main.js& cd .. - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416 2>&1") + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then echo "BgUtilHTTPPot was not invoked" From d4afa2d283001bce9cc36119cb5dbe31bd7ff853 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sat, 14 Sep 2024 20:32:14 -0700 Subject: [PATCH 07/76] wait for server up --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 05fb277..9195cb9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,10 @@ jobs: cd server/ node build/main.js& cd .. + until curl --silent --fail http://127.0.0.1:4416/ping; do + echo "Waiting for server to be up..." + sleep 5 + done script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416 2>&1") echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then From 50d8576a1abef4f6c5b4d58d435879b46d32a771 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 15:56:47 +1200 Subject: [PATCH 08/76] move `lint and format check` to test.yml --- .github/workflows/release.yml | 26 -------------------------- .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ff90a7..b0be793 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,32 +8,6 @@ concurrency: cancel-in-progress: true jobs: - lint-format: - name: Lint and format check - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - steps: - - uses: actions/checkout@v4 - if: always() - - name: Install Ruff and autopep8 - if: always() - run: pip install ruff autopep8 - - name: Python lint check (Ruff) - if: always() - run: ruff check --output-format=github -v plugin/ - - name: Python lint check (autopep8) - if: always() - run: autopep8 --diff plugin/ - - name: Install server dependencies - if: always() - run: cd server && yarn install - - name: Server lint check (ESlint) - if: always() - run: cd server && npx eslint --max-warnings=0 src/ - - name: Server format check (Prettier) - if: always() - run: cd server && npx prettier --check 'src/**/*.{js,ts}' - release: name: Release to Github permissions: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb0bc24..d6a4d50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,32 @@ concurrency: cancel-in-progress: true jobs: + lint-format: + name: Lint and format check + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@v4 + if: always() + - name: Install Ruff and autopep8 + if: always() + run: pip install ruff autopep8 + - name: Python lint check (Ruff) + if: always() + run: ruff check --output-format=github -v plugin/ + - name: Python lint check (autopep8) + if: always() + run: autopep8 --diff plugin/ + - name: Install server dependencies + if: always() + run: cd server && yarn install + - name: Server lint check (ESlint) + if: always() + run: cd server && npx eslint --max-warnings=0 src/ + - name: Server format check (Prettier) + if: always() + run: cd server && npx prettier --check 'src/**/*.{js,ts}' + script-method: name: Test plugin runs-on: ubuntu-latest From 375254b40a80e45d7a5d2779d5388ca5210c7e59 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:07:19 +1200 Subject: [PATCH 09/76] be consistent: search for corresponding msg --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d6a4d50..7cd3d05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,7 +51,7 @@ jobs: run: | script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) echo $script_response - if [[ "$script_response" != *"BgUtilScriptPot: _get_pot_via_script response"* ]]; then + if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then echo "BgUtilScriptPot was not invoked" exit 1 fi From f24b523572619e9815c2c2be2c7f6aacee16d83a Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:34:21 +1200 Subject: [PATCH 10/76] use github-styled error output - show `waiting for the server to be up` only once - reduce timeout - sleep less per loop --- .github/workflows/test.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7cd3d05..706a61e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,21 +52,23 @@ jobs: script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then - echo "BgUtilScriptPot was not invoked" + echo "::error file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::BgUtilScriptPot was not invoked" exit 1 fi - name: Test server method + if: always() + timeout-minutes: 3 run: | cd server/ node build/main.js& cd .. + echo "Waiting for server to be up..." until curl --silent --fail http://127.0.0.1:4416/ping; do - echo "Waiting for server to be up..." - sleep 5 + sleep 0.5 done script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then - echo "BgUtilHTTPPot was not invoked" + echo "::error file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py::BgUtilHTTPPot was not invoked" exit 1 fi From 77319317a2ba5363ca5602af63862a99a8d375ae Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:37:17 +1200 Subject: [PATCH 11/76] [wrong] test --- plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py | 1 + plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py | 1 + 2 files changed, 2 insertions(+) diff --git a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py index 1874b09..8c0ee75 100644 --- a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py +++ b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py @@ -47,6 +47,7 @@ def _validate_get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data f'Please ensure they are on the same version. ' f'(plugin: {self.VERSION}, server: {response.get("version", "unknown")})', once=True) + raise UnsupportedRequest self.base_url = base_url def _get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data_sync_id=None, player_url=None, **kwargs) -> str: diff --git a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py index c7ccf66..98649b1 100644 --- a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py +++ b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py @@ -46,6 +46,7 @@ def _validate_get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data 'Incorrect script passed to extractor args. Path to generate_once.js required') if shutil.which('node') is None: raise UnsupportedRequest('node is not in PATH') + raise UnsupportedRequest self.script_path = script_path def _get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data_sync_id=None, player_url=None, **kwargs) -> str: From a196a5247c897dabf45334f4fc47031c627f62f8 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:39:39 +1200 Subject: [PATCH 12/76] [wrong] fix gh error msg --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 706a61e..59e7f15 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,7 @@ jobs: script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then - echo "::error file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::BgUtilScriptPot was not invoked" + echo "::error file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py,line=1,col=1,endColumn=2::BgUtilScriptPot was not invoked" exit 1 fi - name: Test server method @@ -69,6 +69,6 @@ jobs: script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then - echo "::error file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py::BgUtilHTTPPot was not invoked" + echo "::error file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py,line=1,col=1,endColumn=2::BgUtilHTTPPot was not invoked" exit 1 fi From fd5d6438245255d1efa90ffc8c6d89e45d183a2c Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:43:49 +1200 Subject: [PATCH 13/76] [wrong] dont report file path wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59e7f15..f77867a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,7 @@ jobs: script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then - echo "::error file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py,line=1,col=1,endColumn=2::BgUtilScriptPot was not invoked" + echo "::error::BgUtilScriptPot was not invoked" exit 1 fi - name: Test server method @@ -69,6 +69,6 @@ jobs: script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then - echo "::error file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py,line=1,col=1,endColumn=2::BgUtilHTTPPot was not invoked" + echo "::error::BgUtilHTTPPot was not invoked" exit 1 fi From 5f5f2b91034c80b95fce0ca25f49d1597aa4df8d Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:46:44 +1200 Subject: [PATCH 14/76] [wrong] fill required field `title` wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f77867a..70147d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,8 @@ jobs: script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then - echo "::error::BgUtilScriptPot was not invoked" + echo "::error title=BgUtilScriptPot was not invoked::BgUtilScriptPot was not invoked" + # ::error file={name},line={line},endLine={endLine},title={title}::{message} exit 1 fi - name: Test server method @@ -69,6 +70,7 @@ jobs: script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then - echo "::error::BgUtilHTTPPot was not invoked" + echo "::error title=BgUtilHTTPPot was not invoked::BgUtilHTTPPot was not invoked" + # ::error file={name},line={line},endLine={endLine},title={title}::{message} exit 1 fi From 45a6f677057cee61969fc1e25a8025e5d6c9ec69 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:48:49 +1200 Subject: [PATCH 15/76] [wrong] test wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 70147d0..b39b6bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,8 +52,8 @@ jobs: script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then - echo "::error title=BgUtilScriptPot was not invoked::BgUtilScriptPot was not invoked" - # ::error file={name},line={line},endLine={endLine},title={title}::{message} + # echo "::error title=BgUtilScriptPot was not invoked::BgUtilScriptPot was not invoked" + echo "::error file=LICENSE,line=1,endLine=3,title=title::msg“ exit 1 fi - name: Test server method @@ -70,7 +70,7 @@ jobs: script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then - echo "::error title=BgUtilHTTPPot was not invoked::BgUtilHTTPPot was not invoked" - # ::error file={name},line={line},endLine={endLine},title={title}::{message} + # echo "::error title=BgUtilHTTPPot was not invoked::BgUtilHTTPPot was not invoked" + echo "::error file=.gitignore,line=1,endLine=3,title=title::msg“ exit 1 fi From dbb6d1af877d9859d75249ab75bf54f4de0e3587 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:53:06 +1200 Subject: [PATCH 16/76] [wrong] test: dont exit with 1 wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b39b6bb..78af964 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,7 +54,7 @@ jobs: if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then # echo "::error title=BgUtilScriptPot was not invoked::BgUtilScriptPot was not invoked" echo "::error file=LICENSE,line=1,endLine=3,title=title::msg“ - exit 1 + # exit 1 fi - name: Test server method if: always() @@ -71,6 +71,7 @@ jobs: echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then # echo "::error title=BgUtilHTTPPot was not invoked::BgUtilHTTPPot was not invoked" - echo "::error file=.gitignore,line=1,endLine=3,title=title::msg“ - exit 1 + # echo "::error file=.gitignore,line=1,endLine=3,title=title::msg“ + echo "::error title=ERROR (...),file=/_file,line=1,col=1,endLine=1,endColumn=1::_file:1:1: msg" + # exit 1 fi From c761f42948541d73820a1166b7b2fcdfa76f1106 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:57:49 +1200 Subject: [PATCH 17/76] [wrong] handle non-zero exit code from ytdlp wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78af964..a3f8374 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,12 +49,12 @@ jobs: cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ - name: Test script method run: | - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || echo "::error title=PLACEHOLDER::Failed to run yt-dlp!" echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then - # echo "::error title=BgUtilScriptPot was not invoked::BgUtilScriptPot was not invoked" - echo "::error file=LICENSE,line=1,endLine=3,title=title::msg“ - # exit 1 + echo "BgUtilScriptPot was not invoked" + echo "::error title=BgUtilScriptPot was not invoked::BgUtilScriptPot was not invoked" + exit 1 fi - name: Test server method if: always() @@ -67,11 +67,11 @@ jobs: until curl --silent --fail http://127.0.0.1:4416/ping; do sleep 0.5 done - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) || echo "::error title=PLACEHOLDER::Failed to run yt-dlp!" echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then - # echo "::error title=BgUtilHTTPPot was not invoked::BgUtilHTTPPot was not invoked" - # echo "::error file=.gitignore,line=1,endLine=3,title=title::msg“ + echo "BgUtilHTTPPot was not invoked" + echo "::error title=BgUtilHTTPPot was not invoked::BgUtilHTTPPot was not invoked" echo "::error title=ERROR (...),file=/_file,line=1,col=1,endLine=1,endColumn=1::_file:1:1: msg" - # exit 1 + exit 1 fi From 8b61f0fc033c55ff46c2297145e1c9f499a8589b Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:02:25 +1200 Subject: [PATCH 18/76] [wrong] write error titles wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a3f8374..4e2392b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,7 +49,7 @@ jobs: cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ - name: Test script method run: | - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || echo "::error title=PLACEHOLDER::Failed to run yt-dlp!" + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || echo "::error title=Failed to run yt-dlp::Failed to run yt-dlp!" echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then echo "BgUtilScriptPot was not invoked" @@ -67,11 +67,12 @@ jobs: until curl --silent --fail http://127.0.0.1:4416/ping; do sleep 0.5 done - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) || echo "::error title=PLACEHOLDER::Failed to run yt-dlp!" + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) || echo "::error title=Failed to run yt-dlp::Failed to run yt-dlp!" echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then echo "BgUtilHTTPPot was not invoked" echo "::error title=BgUtilHTTPPot was not invoked::BgUtilHTTPPot was not invoked" - echo "::error title=ERROR (...),file=/_file,line=1,col=1,endLine=1,endColumn=1::_file:1:1: msg" + echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py,line=1,col=1,endLine=1,endColumn=1::_file:1:1: msg placeholder" + echo "::error title=BgUtilHTTPPot was not invoked,file=/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py,line=1,col=1,endLine=1,endColumn=1::_file:1:1: msg placeholder2" exit 1 fi From 6472d51e86ea6118b2cf992a4e957196c8e7864f Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:09:53 +1200 Subject: [PATCH 19/76] [wrong] format ping result with jq wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e2392b..ba0dbe5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,7 +49,7 @@ jobs: cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ - name: Test script method run: | - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || echo "::error title=Failed to run yt-dlp::Failed to run yt-dlp!" + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || echo "::error title=Failed to run yt-dlp::yt-dlp returned $? exit status" echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then echo "BgUtilScriptPot was not invoked" @@ -64,15 +64,14 @@ jobs: node build/main.js& cd .. echo "Waiting for server to be up..." - until curl --silent --fail http://127.0.0.1:4416/ping; do + until RESP=$(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1); do sleep 0.5 done - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) || echo "::error title=Failed to run yt-dlp::Failed to run yt-dlp!" + echo $RESP|jq + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) || echo "::error title=Failed to run yt-dlp::yt-dlp returned $? exit status" echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then echo "BgUtilHTTPPot was not invoked" - echo "::error title=BgUtilHTTPPot was not invoked::BgUtilHTTPPot was not invoked" - echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py,line=1,col=1,endLine=1,endColumn=1::_file:1:1: msg placeholder" - echo "::error title=BgUtilHTTPPot was not invoked,file=/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py,line=1,col=1,endLine=1,endColumn=1::_file:1:1: msg placeholder2" + echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py,line=1,col=1,endLine=1,endColumn=1::BgUtilHTTPPot was not invoked" exit 1 fi From 3edd4108e3971948bcbb94feb9de3b0c15879674 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:09:55 +1200 Subject: [PATCH 20/76] [wrong] format ping result with jq wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci From 6fbe394d664acd8da04f42be567cf7ff5a5929f5 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:13:42 +1200 Subject: [PATCH 21/76] [wrong] display source when yt-dlp fails wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ba0dbe5..85b9c16 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,15 +49,13 @@ jobs: cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ - name: Test script method run: | - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || echo "::error title=Failed to run yt-dlp::yt-dlp returned $? exit status" + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || echo "::error title=Failed to run yt-dlp when testing script::yt-dlp returned $? exit status" echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then echo "BgUtilScriptPot was not invoked" echo "::error title=BgUtilScriptPot was not invoked::BgUtilScriptPot was not invoked" - exit 1 fi - name: Test server method - if: always() timeout-minutes: 3 run: | cd server/ @@ -68,10 +66,9 @@ jobs: sleep 0.5 done echo $RESP|jq - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416" 2>&1) || echo "::error title=Failed to run yt-dlp::yt-dlp returned $? exit status" + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc 2>&1) || echo "::error title=Failed to run yt-dlp when testing HTTP server::yt-dlp returned $? exit status" echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then echo "BgUtilHTTPPot was not invoked" echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py,line=1,col=1,endLine=1,endColumn=1::BgUtilHTTPPot was not invoked" - exit 1 fi From 9bee51e8cbaf0ef47a9876ed59c4280650996f11 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:26:24 +1200 Subject: [PATCH 22/76] [wrong] test github styled output: ::error wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 85b9c16..96bcf4f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,6 +54,7 @@ jobs: if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then echo "BgUtilScriptPot was not invoked" echo "::error title=BgUtilScriptPot was not invoked::BgUtilScriptPot was not invoked" + exit 1 fi - name: Test server method timeout-minutes: 3 @@ -71,4 +72,5 @@ jobs: if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then echo "BgUtilHTTPPot was not invoked" echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py,line=1,col=1,endLine=1,endColumn=1::BgUtilHTTPPot was not invoked" + echo "::error" fi From 6a248a4fd167dfa374ed66c9f97c968480bd791d Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:27:21 +1200 Subject: [PATCH 23/76] [wrong] add if:always() wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96bcf4f..00d2447 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,6 +58,7 @@ jobs: fi - name: Test server method timeout-minutes: 3 + if: always() run: | cd server/ node build/main.js& From 338a52fe69e7f8c4c1ab242f33eae9377e2197a0 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:31:52 +1200 Subject: [PATCH 24/76] [wrong] exit 1, try omitting line/column wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 00d2447..c18dc66 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,7 +53,8 @@ jobs: echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then echo "BgUtilScriptPot was not invoked" - echo "::error title=BgUtilScriptPot was not invoked::BgUtilScriptPot was not invoked" + # echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py,line=1,col=1,endLine=1,endColumn=1::BgUtilScriptPot was not invoked" + echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::BgUtilScriptPot was not invoked" exit 1 fi - name: Test server method @@ -73,5 +74,5 @@ jobs: if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then echo "BgUtilHTTPPot was not invoked" echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py,line=1,col=1,endLine=1,endColumn=1::BgUtilHTTPPot was not invoked" - echo "::error" + exit 1 fi From 37eebb50f14c05ef2d5139291b5a8be3fa8d7cec Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:34:23 +1200 Subject: [PATCH 25/76] [wrong] remove line/column wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c18dc66..adeb912 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,7 +53,6 @@ jobs: echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then echo "BgUtilScriptPot was not invoked" - # echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py,line=1,col=1,endLine=1,endColumn=1::BgUtilScriptPot was not invoked" echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::BgUtilScriptPot was not invoked" exit 1 fi @@ -73,6 +72,6 @@ jobs: echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then echo "BgUtilHTTPPot was not invoked" - echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py,line=1,col=1,endLine=1,endColumn=1::BgUtilHTTPPot was not invoked" + echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py::BgUtilHTTPPot was not invoked" exit 1 fi From 5b4dfa501c8401b979e5ce368cd10509f18fad27 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:37:12 +1200 Subject: [PATCH 26/76] [wrong] remove redundant logging, code formatting wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index adeb912..104a3de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,6 @@ jobs: script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || echo "::error title=Failed to run yt-dlp when testing script::yt-dlp returned $? exit status" echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then - echo "BgUtilScriptPot was not invoked" echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::BgUtilScriptPot was not invoked" exit 1 fi @@ -67,11 +66,10 @@ jobs: until RESP=$(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1); do sleep 0.5 done - echo $RESP|jq + echo $RESP | jq script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc 2>&1) || echo "::error title=Failed to run yt-dlp when testing HTTP server::yt-dlp returned $? exit status" echo $script_response if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then - echo "BgUtilHTTPPot was not invoked" echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py::BgUtilHTTPPot was not invoked" exit 1 fi From fc67dd9ca9835bd9303b6e83cdbe3dc3f4bc2f70 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:41:58 +1200 Subject: [PATCH 27/76] [wrong] correct one intentional issue - use default script path wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 6 ++++-- plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 104a3de..6b72d0c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,14 +42,16 @@ jobs: - name: Download yt-dlp run: curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o yt-dlp && chmod +x ./yt-dlp - name: Install and build server dependencies - run: cd server/ && yarn install --frozen-lockfile && npx tsc + run: | + cd server/ && yarn install --frozen-lockfile && npx tsc + cp -aT . $HOME/bgutil-ytdlp-pot-provider/server - name: Install plugin run: | mkdir ~/yt-dlp-plugins && curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o ~/yt-dlp-plugins/yt-dlp-get-pot.zip cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ - name: Test script method run: | - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || echo "::error title=Failed to run yt-dlp when testing script::yt-dlp returned $? exit status" + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc 2>&1) || echo "::error title=Failed to run yt-dlp when testing script::yt-dlp returned $? exit status" echo $script_response if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::BgUtilScriptPot was not invoked" diff --git a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py index 98649b1..c7ccf66 100644 --- a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py +++ b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py @@ -46,7 +46,6 @@ def _validate_get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data 'Incorrect script passed to extractor args. Path to generate_once.js required') if shutil.which('node') is None: raise UnsupportedRequest('node is not in PATH') - raise UnsupportedRequest self.script_path = script_path def _get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data_sync_id=None, player_url=None, **kwargs) -> str: From e3f12e083d53890e3a0155f23037b295aad8ca89 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:43:47 +1200 Subject: [PATCH 28/76] [wrong] fix: path doesnt exist wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6b72d0c..39619b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,8 @@ jobs: - name: Install and build server dependencies run: | cd server/ && yarn install --frozen-lockfile && npx tsc - cp -aT . $HOME/bgutil-ytdlp-pot-provider/server + mkdir -p $HOME/bgutil-ytdlp-pot-provider/server/ + cp -aT ./ $HOME/bgutil-ytdlp-pot-provider/server/ - name: Install plugin run: | mkdir ~/yt-dlp-plugins && curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o ~/yt-dlp-plugins/yt-dlp-get-pot.zip From a4a49ddbe084f89bd690f70b8ef1bfde52824224 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 18:15:28 +1200 Subject: [PATCH 29/76] [wrong] group logs, support multi-line logs - handle error when node fails to start - improve readability - kill server(unnecessary but is a good habit) wrong: this commit contains intentional issues or reserved a bug from previous commits intentionally in order to test the ci --- .github/workflows/test.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 39619b0..6a20a94 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,9 +51,12 @@ jobs: mkdir ~/yt-dlp-plugins && curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o ~/yt-dlp-plugins/yt-dlp-get-pot.zip cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ - name: Test script method + shell: bash run: | script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc 2>&1) || echo "::error title=Failed to run yt-dlp when testing script::yt-dlp returned $? exit status" - echo $script_response + echo "::group::Logs from yt-dlp" + printf "%s\n" "$script_response" + echo "::endgroup::" if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::BgUtilScriptPot was not invoked" exit 1 @@ -61,17 +64,25 @@ jobs: - name: Test server method timeout-minutes: 3 if: always() + shell: bash run: | cd server/ node build/main.js& - cd .. + NODE_PID=$! echo "Waiting for server to be up..." until RESP=$(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1); do sleep 0.5 + # TODO: add timeout (is timeout-minutes enough or should we handle timeout ourselves?) done + echo "::group::Response from HTTP Server" echo $RESP | jq + echo "::endgroup::" + cd .. script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc 2>&1) || echo "::error title=Failed to run yt-dlp when testing HTTP server::yt-dlp returned $? exit status" - echo $script_response + kill $NODE_PID + echo "::group::Logs from yt-dlp" + printf "%s\n" "$script_response" + echo "::endgroup::" if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py::BgUtilHTTPPot was not invoked" exit 1 From d8c92547726b3e3f96b450ea8a159b3e4ff901b5 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 18:18:43 +1200 Subject: [PATCH 30/76] [correct] remove intentional raise --- plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py index 8c0ee75..1874b09 100644 --- a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py +++ b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py @@ -47,7 +47,6 @@ def _validate_get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data f'Please ensure they are on the same version. ' f'(plugin: {self.VERSION}, server: {response.get("version", "unknown")})', once=True) - raise UnsupportedRequest self.base_url = base_url def _get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data_sync_id=None, player_url=None, **kwargs) -> str: From 2d1e6ddbc932ffaf488fe2f1e02c5318f4613751 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 18:27:02 +1200 Subject: [PATCH 31/76] dont use default path: interferes with HTTP test --- .github/workflows/test.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a20a94..0c34a3d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,10 +42,7 @@ jobs: - name: Download yt-dlp run: curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o yt-dlp && chmod +x ./yt-dlp - name: Install and build server dependencies - run: | - cd server/ && yarn install --frozen-lockfile && npx tsc - mkdir -p $HOME/bgutil-ytdlp-pot-provider/server/ - cp -aT ./ $HOME/bgutil-ytdlp-pot-provider/server/ + run: cd server/ && yarn install --frozen-lockfile && npx tsc - name: Install plugin run: | mkdir ~/yt-dlp-plugins && curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o ~/yt-dlp-plugins/yt-dlp-get-pot.zip @@ -53,7 +50,7 @@ jobs: - name: Test script method shell: bash run: | - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc 2>&1) || echo "::error title=Failed to run yt-dlp when testing script::yt-dlp returned $? exit status" + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || echo "::error title=Failed to run yt-dlp when testing script::yt-dlp returned $? exit status" echo "::group::Logs from yt-dlp" printf "%s\n" "$script_response" echo "::endgroup::" From 6af787254b764ac66f82144715da3b9957872b6b Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 18:38:15 +1200 Subject: [PATCH 32/76] capture server log --- .github/workflows/test.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c34a3d..e35943c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -64,22 +64,33 @@ jobs: shell: bash run: | cd server/ - node build/main.js& + SERVER_LOG_PATH=$(mktemp) + node build/main.js >$SERVER_LOG_PATH 2>&1 & NODE_PID=$! echo "Waiting for server to be up..." until RESP=$(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1); do sleep 0.5 - # TODO: add timeout (is timeout-minutes enough or should we handle timeout ourselves?) + # TODO: add timeout (is the step's timeout-minutes enough or should we handle timeout ourselves?) done - echo "::group::Response from HTTP Server" + + echo "::group::Response from HTTP server" echo $RESP | jq echo "::endgroup::" + cd .. script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc 2>&1) || echo "::error title=Failed to run yt-dlp when testing HTTP server::yt-dlp returned $? exit status" + kill $NODE_PID + + echo "::group::Logs from HTTP server" + cat "$SERVER_LOG_PATH" + echo "::endgroup::" + rm -f $SERVER_LOG_PATH + echo "::group::Logs from yt-dlp" printf "%s\n" "$script_response" echo "::endgroup::" + if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py::BgUtilHTTPPot was not invoked" exit 1 From 1892ede7132e3ca4bb2a21cecfc66c759baed4da Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 18:46:18 +1200 Subject: [PATCH 33/76] remove several unnecessary `always()` --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e35943c..cde16bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,12 +14,9 @@ jobs: if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 - if: always() - name: Install Ruff and autopep8 - if: always() run: pip install ruff autopep8 - name: Python lint check (Ruff) - if: always() run: ruff check --output-format=github -v plugin/ - name: Python lint check (autopep8) if: always() @@ -54,7 +51,7 @@ jobs: echo "::group::Logs from yt-dlp" printf "%s\n" "$script_response" echo "::endgroup::" - if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script"* ]]; then + if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script: "* ]]; then echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::BgUtilScriptPot was not invoked" exit 1 fi From f0ddaac544edc6e2f2847dca2472df5f2a5104ed Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:18:16 +1200 Subject: [PATCH 34/76] [wrong:for testing] add timer for http server --- .github/workflows/test.yml | 24 +++++++++++++------ .../extractor/getpot_bgutil_script.py | 1 + 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cde16bd..5dfc345 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,8 @@ jobs: printf "%s\n" "$script_response" echo "::endgroup::" if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script: "* ]]; then - echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::BgUtilScriptPot was not invoked" + echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::" \ + "BgUtilScriptPot was not invoked" exit 1 fi - name: Test server method @@ -65,17 +66,25 @@ jobs: node build/main.js >$SERVER_LOG_PATH 2>&1 & NODE_PID=$! echo "Waiting for server to be up..." - until RESP=$(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1); do - sleep 0.5 - # TODO: add timeout (is the step's timeout-minutes enough or should we handle timeout ourselves?) - done + + ping() { + until RESP=$(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1); do + sleep ${1:-0.5} + done + } + export -f ping + timeout 7.5 bash -c "ping 0.5" || \ + echo "::error title=Timeout reached,file=server/src/main.ts::" \ + "Timeout reached before the server is up." echo "::group::Response from HTTP server" echo $RESP | jq echo "::endgroup::" cd .. - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc 2>&1) || echo "::error title=Failed to run yt-dlp when testing HTTP server::yt-dlp returned $? exit status" + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc 2>&1) || \ + echo "::error title=Failed to run yt-dlp when testing HTTP server::" \ + "yt-dlp returned $? exit status" kill $NODE_PID @@ -89,6 +98,7 @@ jobs: echo "::endgroup::" if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then - echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py::BgUtilHTTPPot was not invoked" + echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py::" \ + "BgUtilHTTPPot was not invoked" exit 1 fi diff --git a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py index c7ccf66..98649b1 100644 --- a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py +++ b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py @@ -46,6 +46,7 @@ def _validate_get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data 'Incorrect script passed to extractor args. Path to generate_once.js required') if shutil.which('node') is None: raise UnsupportedRequest('node is not in PATH') + raise UnsupportedRequest self.script_path = script_path def _get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data_sync_id=None, player_url=None, **kwargs) -> str: From ff2c4ba64bb95d85ec61b9f6971f2e04ba6e15e9 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:19:48 +1200 Subject: [PATCH 35/76] try to fix trailing spaces --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5dfc345..9bc1ca8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,12 +47,14 @@ jobs: - name: Test script method shell: bash run: | - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || echo "::error title=Failed to run yt-dlp when testing script::yt-dlp returned $? exit status" + script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || \ + echo "::error title=Failed to run yt-dlp when testing script::"\ + "yt-dlp returned $? exit status" echo "::group::Logs from yt-dlp" printf "%s\n" "$script_response" echo "::endgroup::" if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script: "* ]]; then - echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::" \ + echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::"\ "BgUtilScriptPot was not invoked" exit 1 fi From 9b94c4a24a9c68ae06b1f16b1d7019af749565ae Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:21:56 +1200 Subject: [PATCH 36/76] try to fix trailing spaces --- .github/workflows/test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9bc1ca8..7e456e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,14 +48,15 @@ jobs: shell: bash run: | script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || \ - echo "::error title=Failed to run yt-dlp when testing script::"\ - "yt-dlp returned $? exit status" + echo "::error title=Failed to run yt-dlp when testing script::\ + yt-dlp returned $? exit status" + echo "::group::Logs from yt-dlp" printf "%s\n" "$script_response" echo "::endgroup::" if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script: "* ]]; then - echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::"\ - "BgUtilScriptPot was not invoked" + echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::" \ + "BgUtilScriptPot was not invoked" exit 1 fi - name: Test server method From 44a6a1880c25ddc4e481cfccd5d5111a3cafe3c1 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:26:36 +1200 Subject: [PATCH 37/76] [wrong] test ci --- .github/workflows/test.yml | 16 ++++++++-------- .../extractor/getpot_bgutil_http.py | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7e456e0..6d4a077 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,8 +55,8 @@ jobs: printf "%s\n" "$script_response" echo "::endgroup::" if [[ "$script_response" != *"BgUtilScriptPot: Generating POT via script: "* ]]; then - echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::" \ - "BgUtilScriptPot was not invoked" + echo "::error title=BgUtilScriptPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py::\ + BgUtilScriptPot was not invoked" exit 1 fi - name: Test server method @@ -77,8 +77,8 @@ jobs: } export -f ping timeout 7.5 bash -c "ping 0.5" || \ - echo "::error title=Timeout reached,file=server/src/main.ts::" \ - "Timeout reached before the server is up." + echo "::error title=Timeout reached,file=server/src/main.ts::\ + Timeout reached before the server is up." echo "::group::Response from HTTP server" echo $RESP | jq @@ -86,8 +86,8 @@ jobs: cd .. script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc 2>&1) || \ - echo "::error title=Failed to run yt-dlp when testing HTTP server::" \ - "yt-dlp returned $? exit status" + echo "::error title=Failed to run yt-dlp when testing HTTP server::\ + yt-dlp returned $? exit status" kill $NODE_PID @@ -101,7 +101,7 @@ jobs: echo "::endgroup::" if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then - echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py::" \ - "BgUtilHTTPPot was not invoked" + echo "::error title=BgUtilHTTPPot was not invoked,file=plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py::\ + BgUtilHTTPPot was not invoked" exit 1 fi diff --git a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py index 1874b09..8c0ee75 100644 --- a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py +++ b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py @@ -47,6 +47,7 @@ def _validate_get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data f'Please ensure they are on the same version. ' f'(plugin: {self.VERSION}, server: {response.get("version", "unknown")})', once=True) + raise UnsupportedRequest self.base_url = base_url def _get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data_sync_id=None, player_url=None, **kwargs) -> str: From 535a2138251054e3fd2e5d3094e5ccf621d88c12 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:28:53 +1200 Subject: [PATCH 38/76] remove intentional `raise`s --- plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py | 1 - plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py | 1 - 2 files changed, 2 deletions(-) diff --git a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py index 8c0ee75..1874b09 100644 --- a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py +++ b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_http.py @@ -47,7 +47,6 @@ def _validate_get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data f'Please ensure they are on the same version. ' f'(plugin: {self.VERSION}, server: {response.get("version", "unknown")})', once=True) - raise UnsupportedRequest self.base_url = base_url def _get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data_sync_id=None, player_url=None, **kwargs) -> str: diff --git a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py index 98649b1..c7ccf66 100644 --- a/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py +++ b/plugin/yt_dlp_plugins/extractor/getpot_bgutil_script.py @@ -46,7 +46,6 @@ def _validate_get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data 'Incorrect script passed to extractor args. Path to generate_once.js required') if shutil.which('node') is None: raise UnsupportedRequest('node is not in PATH') - raise UnsupportedRequest self.script_path = script_path def _get_pot(self, client: str, ydl: YoutubeDL, visitor_data=None, data_sync_id=None, player_url=None, **kwargs) -> str: From 755e8888fb142b9015137c0ca95b7adfbe2d92b2 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:36:31 +1200 Subject: [PATCH 39/76] [wrong] test with problematic server --- server/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main.ts b/server/src/main.ts index a23ee01..891dbd4 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -1,4 +1,4 @@ -import { SessionManager } from "./session_manager"; +somethingthatkeepsthescriptfromrunningnormallyimport { SessionManager } from "./session_manager"; import { VERSION } from "./version"; import { Command } from "@commander-js/extra-typings"; import express from "express"; From 94e9ddb12a994e9c3124f23523ed4b86375603a7 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:39:54 +1200 Subject: [PATCH 40/76] [wrong:server] exit when timeout reached --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d4a077..b057a4b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -77,8 +77,8 @@ jobs: } export -f ping timeout 7.5 bash -c "ping 0.5" || \ - echo "::error title=Timeout reached,file=server/src/main.ts::\ - Timeout reached before the server is up." + (echo "::error title=Timeout reached,file=server/src/main.ts::\ + Timeout reached before the server is up." && exit 1) echo "::group::Response from HTTP server" echo $RESP | jq From e54276bb58d8e5838ec7cd011203a5abab036624 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:53:58 +1200 Subject: [PATCH 41/76] [wrong:server] kill the process after being pinged --- server/src/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/main.ts b/server/src/main.ts index 891dbd4..0b1bf89 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -1,4 +1,4 @@ -somethingthatkeepsthescriptfromrunningnormallyimport { SessionManager } from "./session_manager"; +import { SessionManager } from "./session_manager"; import { VERSION } from "./version"; import { Command } from "@commander-js/extra-typings"; import express from "express"; @@ -70,4 +70,5 @@ httpServer.get("/ping", async (request, response) => { server_uptime: process.uptime(), version: VERSION, }); + process.kill(process.pid); }); From bdde8c1c4c94814bc2647d2f30b9293490d59d01 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:56:28 +1200 Subject: [PATCH 42/76] check if process is running before killing --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b057a4b..3fede07 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,7 +89,9 @@ jobs: echo "::error title=Failed to run yt-dlp when testing HTTP server::\ yt-dlp returned $? exit status" - kill $NODE_PID + if ps -p $PID > /dev/null; then + kill $NODE_PID + fi echo "::group::Logs from HTTP server" cat "$SERVER_LOG_PATH" From 8d82fcedf13609c5a3a6c0c8284d9436c9f975f9 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:57:23 +1200 Subject: [PATCH 43/76] fix var name --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3fede07..2361fea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,7 +89,7 @@ jobs: echo "::error title=Failed to run yt-dlp when testing HTTP server::\ yt-dlp returned $? exit status" - if ps -p $PID > /dev/null; then + if ps -p $NODE_PID > /dev/null; then kill $NODE_PID fi From 40a6840270ba7c425ef94d58532c305b06ff196b Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:59:10 +1200 Subject: [PATCH 44/76] fix everything wrong --- server/src/main.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/server/src/main.ts b/server/src/main.ts index 0b1bf89..a23ee01 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -70,5 +70,4 @@ httpServer.get("/ping", async (request, response) => { server_uptime: process.uptime(), version: VERSION, }); - process.kill(process.pid); }); From 0a768bbaefaa2e5868af8fbd93bc9489b82b542a Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 22:16:02 +1200 Subject: [PATCH 45/76] --no-simulate --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2361fea..ad07d59 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: - name: Test script method shell: bash run: | - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || \ + script_response=$(./yt-dlp -vF --print-traffic --no-simulate BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || \ echo "::error title=Failed to run yt-dlp when testing script::\ yt-dlp returned $? exit status" @@ -85,7 +85,7 @@ jobs: echo "::endgroup::" cd .. - script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc 2>&1) || \ + script_response=$(./yt-dlp -vF --print-traffic --no-simulate BaW_jenozKc 2>&1) || \ echo "::error title=Failed to run yt-dlp when testing HTTP server::\ yt-dlp returned $? exit status" From d00f5b50d3b99f6517addc68ba8733494219a576 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 22:52:34 +1200 Subject: [PATCH 46/76] fix: display ping response properly --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ad07d59..41566e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,8 +70,9 @@ jobs: NODE_PID=$! echo "Waiting for server to be up..." + PING_RESP_PATH=$(mktemp) ping() { - until RESP=$(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1); do + until $(curl -o "$PING_RESP_PATH" --silent --fail http://127.0.0.1:4416/ping 2>&1); do sleep ${1:-0.5} done } @@ -81,8 +82,9 @@ jobs: Timeout reached before the server is up." && exit 1) echo "::group::Response from HTTP server" - echo $RESP | jq + cat $PING_RESP_PATH | jq echo "::endgroup::" + rm -f $PING_RESP_PATH cd .. script_response=$(./yt-dlp -vF --print-traffic --no-simulate BaW_jenozKc 2>&1) || \ From 89242617ee52a01f6d0030c131acf8e936b85a7d Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 22:54:52 +1200 Subject: [PATCH 47/76] fix: `tee` output --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 41566e0..e948d6f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,7 +72,7 @@ jobs: PING_RESP_PATH=$(mktemp) ping() { - until $(curl -o "$PING_RESP_PATH" --silent --fail http://127.0.0.1:4416/ping 2>&1); do + until $(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1 | tee "$PING_RESP_PATH"); do sleep ${1:-0.5} done } From abc3c43c14982f053cfb881015f9e98fd3916391 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 22:57:51 +1200 Subject: [PATCH 48/76] export ping rresp path --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e948d6f..43308b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,7 +70,7 @@ jobs: NODE_PID=$! echo "Waiting for server to be up..." - PING_RESP_PATH=$(mktemp) + export PING_RESP_PATH=$(mktemp) ping() { until $(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1 | tee "$PING_RESP_PATH"); do sleep ${1:-0.5} From 189e52b6701824a41e51ebe2f738c574c0e597f8 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:02:25 +1200 Subject: [PATCH 49/76] override PING_RESP_PATH instead --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 43308b9..b3c201f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,19 +70,19 @@ jobs: NODE_PID=$! echo "Waiting for server to be up..." - export PING_RESP_PATH=$(mktemp) + PING_RESP_PATH=$(mktemp) ping() { until $(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1 | tee "$PING_RESP_PATH"); do sleep ${1:-0.5} done } export -f ping - timeout 7.5 bash -c "ping 0.5" || \ + timeout 7.5 bash -c "PING_RESP_PATH=$PING_RESP_PATH ping 0.5" || \ (echo "::error title=Timeout reached,file=server/src/main.ts::\ Timeout reached before the server is up." && exit 1) echo "::group::Response from HTTP server" - cat $PING_RESP_PATH | jq + cat $PING_RESP_PATH echo "::endgroup::" rm -f $PING_RESP_PATH From 4266e845e86b908ae9d790b350aa309c872c5e38 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:05:11 +1200 Subject: [PATCH 50/76] dont use tmp file, capture output instead --- .github/workflows/test.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3c201f..505f988 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,21 +70,19 @@ jobs: NODE_PID=$! echo "Waiting for server to be up..." - PING_RESP_PATH=$(mktemp) ping() { - until $(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1 | tee "$PING_RESP_PATH"); do + until curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1; do sleep ${1:-0.5} done } export -f ping - timeout 7.5 bash -c "PING_RESP_PATH=$PING_RESP_PATH ping 0.5" || \ + PING_RESP=$(timeout 7.5 bash -c "ping 0.5") || \ (echo "::error title=Timeout reached,file=server/src/main.ts::\ Timeout reached before the server is up." && exit 1) echo "::group::Response from HTTP server" - cat $PING_RESP_PATH + cat $PING_RESP | jq echo "::endgroup::" - rm -f $PING_RESP_PATH cd .. script_response=$(./yt-dlp -vF --print-traffic --no-simulate BaW_jenozKc 2>&1) || \ From 3321f5ac637ad275694625dc9b0eead6445d3eca Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:07:29 +1200 Subject: [PATCH 51/76] use echo for strings --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 505f988..1ba74a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,7 +81,7 @@ jobs: Timeout reached before the server is up." && exit 1) echo "::group::Response from HTTP server" - cat $PING_RESP | jq + echo "$script_response" | jq echo "::endgroup::" cd .. From fefe0c195ff634d518bd0cd6e8509bbb7a59169b Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:10:32 +1200 Subject: [PATCH 52/76] dont fmt with jq --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1ba74a6..08954d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,7 +81,7 @@ jobs: Timeout reached before the server is up." && exit 1) echo "::group::Response from HTTP server" - echo "$script_response" | jq + echo "$script_response" echo "::endgroup::" cd .. From 8150f2bcaf0483fe4c23e0cd21e16c297d814363 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:15:16 +1200 Subject: [PATCH 53/76] retry --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 08954d5..e557394 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,7 +76,7 @@ jobs: done } export -f ping - PING_RESP=$(timeout 7.5 bash -c "ping 0.5") || \ + PING_RESP=$(timeout 7.5 bash -c ping) || \ (echo "::error title=Timeout reached,file=server/src/main.ts::\ Timeout reached before the server is up." && exit 1) From 315a3158a954fa7424c2999808d8ab20a08c066d Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:23:04 +1200 Subject: [PATCH 54/76] debug --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e557394..5a50294 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,9 +71,10 @@ jobs: echo "Waiting for server to be up..." ping() { - until curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1; do + until FINAL_RESP=$(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1); do sleep ${1:-0.5} done + [ -n "$FINAL_RESP" ] && echo $FINAL_RESP || echo "failed to get ping response" } export -f ping PING_RESP=$(timeout 7.5 bash -c ping) || \ From c845dc472a47759a4a77f7f5f0b632656ebbec06 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:24:56 +1200 Subject: [PATCH 55/76] wrong var name --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a50294..bb869ad 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,10 +71,9 @@ jobs: echo "Waiting for server to be up..." ping() { - until FINAL_RESP=$(curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1); do + until curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1; do sleep ${1:-0.5} done - [ -n "$FINAL_RESP" ] && echo $FINAL_RESP || echo "failed to get ping response" } export -f ping PING_RESP=$(timeout 7.5 bash -c ping) || \ @@ -82,7 +81,7 @@ jobs: Timeout reached before the server is up." && exit 1) echo "::group::Response from HTTP server" - echo "$script_response" + echo "$PING_RESP" echo "::endgroup::" cd .. From 4feecbc277ee9dc97c9fa7d89beaf0cf123ab791 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:35:35 +1200 Subject: [PATCH 56/76] use jq to parse resp --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb869ad..509e509 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,7 +81,7 @@ jobs: Timeout reached before the server is up." && exit 1) echo "::group::Response from HTTP server" - echo "$PING_RESP" + echo "$PING_RESP" | jq echo "::endgroup::" cd .. From 714326ad011f411377f9929045694f623db65d57 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 16 Sep 2024 00:59:24 +1200 Subject: [PATCH 57/76] use a larger video --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 509e509..37d0354 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: - name: Test script method shell: bash run: | - script_response=$(./yt-dlp -vF --print-traffic --no-simulate BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" 2>&1) || \ + script_response=$(./yt-dlp -vF --print-traffic --no-simulate -f "b*" -S "filesize:10M" --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" dQw4w9WgXcQ 2>&1) || \ echo "::error title=Failed to run yt-dlp when testing script::\ yt-dlp returned $? exit status" @@ -85,7 +85,7 @@ jobs: echo "::endgroup::" cd .. - script_response=$(./yt-dlp -vF --print-traffic --no-simulate BaW_jenozKc 2>&1) || \ + script_response=$(./yt-dlp -vF --print-traffic --no-simulate -f "b*" -S "filesize:10M" dQw4w9WgXcQ 2>&1) || \ echo "::error title=Failed to run yt-dlp when testing HTTP server::\ yt-dlp returned $? exit status" From 0ca42213003c32166fce4af3eadd17a993dd4eb9 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 16 Sep 2024 01:02:40 +1200 Subject: [PATCH 58/76] Update .github/workflows/test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37d0354..614abd7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: - name: Test script method shell: bash run: | - script_response=$(./yt-dlp -vF --print-traffic --no-simulate -f "b*" -S "filesize:10M" --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" dQw4w9WgXcQ 2>&1) || \ + script_response=$(./yt-dlp -vF --print-traffic --no-simulate -f "b*" -S "filesize:10M" --exec "rm -f" --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" dQw4w9WgXcQ 2>&1) || \ echo "::error title=Failed to run yt-dlp when testing script::\ yt-dlp returned $? exit status" From be5e87a87edd83ebcfcfe72eeed491ad0ea4d189 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 16 Sep 2024 01:02:47 +1200 Subject: [PATCH 59/76] Update .github/workflows/test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 614abd7..204bbfc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,7 +85,7 @@ jobs: echo "::endgroup::" cd .. - script_response=$(./yt-dlp -vF --print-traffic --no-simulate -f "b*" -S "filesize:10M" dQw4w9WgXcQ 2>&1) || \ + script_response=$(./yt-dlp -vF --print-traffic --no-simulate -f "b*" -S "filesize:10M" --exec "rm -f" dQw4w9WgXcQ 2>&1) || \ echo "::error title=Failed to run yt-dlp when testing HTTP server::\ yt-dlp returned $? exit status" From b5521e511a1b77e9e3120d27b67c764f69d5e49b Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sun, 15 Sep 2024 12:02:17 -0700 Subject: [PATCH 60/76] Use docker for server method --- .github/workflows/test.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 204bbfc..768eb2b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,14 +59,19 @@ jobs: BgUtilScriptPot was not invoked" exit 1 fi + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: server/ + file: server/Dockerfile + push: false + tags: brainicism/bgutil-ytdlp-pot-provider:ci - name: Test server method timeout-minutes: 3 if: always() shell: bash run: | - cd server/ - SERVER_LOG_PATH=$(mktemp) - node build/main.js >$SERVER_LOG_PATH 2>&1 & + docker run --name bgutil-provider -d -p 4416:4416 brainicism/bgutil-ytdlp-pot-provider:ci NODE_PID=$! echo "Waiting for server to be up..." @@ -94,9 +99,8 @@ jobs: fi echo "::group::Logs from HTTP server" - cat "$SERVER_LOG_PATH" + docker logs bgutil-provider echo "::endgroup::" - rm -f $SERVER_LOG_PATH echo "::group::Logs from yt-dlp" printf "%s\n" "$script_response" From 14f4618c894de32feee6b4fea02c90d2983b3913 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sun, 15 Sep 2024 12:07:15 -0700 Subject: [PATCH 61/76] @commander-js/extra-typings as non-dev dependecy --- .github/workflows/test.yml | 2 +- server/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 768eb2b..eb01da4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,7 +59,7 @@ jobs: BgUtilScriptPot was not invoked" exit 1 fi - - name: Build and push + - name: Build Docker image uses: docker/build-push-action@v6 with: context: server/ diff --git a/server/package.json b/server/package.json index e67c0d6..186f6ae 100644 --- a/server/package.json +++ b/server/package.json @@ -18,6 +18,7 @@ "format": "npx prettier --write 'src/**/*.{js,ts}'" }, "dependencies": { + "@commander-js/extra-typings": "commander-js/extra-typings", "bgutils-js": "^1.1.0", "body-parser": "^1.20.2", "commander": "^12.1.0", @@ -26,7 +27,6 @@ "youtubei.js": "^10.4.0" }, "devDependencies": { - "@commander-js/extra-typings": "commander-js/extra-typings", "@eslint/js": "^9.10.0", "@types/express": "^4.17.21", "@types/jsdom": "^21.1.7", From 6d7e2eb976ddaf23322dff3293c128b8e641ee98 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sun, 15 Sep 2024 12:11:15 -0700 Subject: [PATCH 62/76] remove .. --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb01da4..20b3c38 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,7 +89,6 @@ jobs: echo "$PING_RESP" | jq echo "::endgroup::" - cd .. script_response=$(./yt-dlp -vF --print-traffic --no-simulate -f "b*" -S "filesize:10M" --exec "rm -f" dQw4w9WgXcQ 2>&1) || \ echo "::error title=Failed to run yt-dlp when testing HTTP server::\ yt-dlp returned $? exit status" From 5d4f212407fc2331db3cfa4fb7abb274f0237372 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sun, 15 Sep 2024 12:18:56 -0700 Subject: [PATCH 63/76] Seperate script/server method into different jobs --- .github/workflows/test.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 20b3c38..0596917 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: run: cd server && npx prettier --check 'src/**/*.{js,ts}' script-method: - name: Test plugin + name: Test plugin (script method) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -59,6 +59,18 @@ jobs: BgUtilScriptPot was not invoked" exit 1 fi + + server-method: + name: Test plugin (server method) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download yt-dlp + run: curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o yt-dlp && chmod +x ./yt-dlp + - name: Install plugin + run: | + mkdir ~/yt-dlp-plugins && curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o ~/yt-dlp-plugins/yt-dlp-get-pot.zip + cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ - name: Build Docker image uses: docker/build-push-action@v6 with: From e165688e3e8a006a3c1bd350946c6811d5c29cdd Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sun, 15 Sep 2024 12:21:30 -0700 Subject: [PATCH 64/76] Remove if always in server mode test --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0596917..46cc1d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -80,7 +80,6 @@ jobs: tags: brainicism/bgutil-ytdlp-pot-provider:ci - name: Test server method timeout-minutes: 3 - if: always() shell: bash run: | docker run --name bgutil-provider -d -p 4416:4416 brainicism/bgutil-ytdlp-pot-provider:ci From c4c9b9ab9866352a72ede5b008d91e9f24f388d3 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sun, 15 Sep 2024 12:28:23 -0700 Subject: [PATCH 65/76] Remove release.yml from pull requests --- .github/workflows/release.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0be793..fe343a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,6 @@ name: Create release on: workflow_dispatch: - pull_request: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -41,7 +40,7 @@ jobs: EOF echo "::endgroup::" - name: Bundle - if: github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref + if: format('refs/heads/{0}', github.event.repository.default_branch) == github.ref # only release on default branch id: bundle env: @@ -70,7 +69,7 @@ jobs: echo "RELEASE_BODY=$r" | tee -a $GITHUB_OUTPUT # <--- Set environment variable - name: Create Release on Github - if: github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref + if: format('refs/heads/{0}', github.event.repository.default_branch) == github.ref # only release on default branch uses: svenstaro/upload-release-action@v2 with: @@ -84,7 +83,7 @@ jobs: release_pypi: name: Release to PyPI - if: github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref + if: format('refs/heads/{0}', github.event.repository.default_branch) == github.ref # only release on default branch runs-on: ubuntu-latest permissions: @@ -152,7 +151,6 @@ jobs: type=ref,event=pr - name: Login to DockerHub - if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -166,21 +164,19 @@ jobs: with: context: server/ file: server/Dockerfile - platforms: ${{ github.event_name != 'pull_request' && 'linux/amd64,linux/arm64' || 'linux/amd64' }} - push: ${{ github.event_name != 'pull_request' }} + platforms: "linux/amd64,linux/arm64" + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} annotations: ${{ steps.meta.outputs.annotations }} - name: Add official repository link to README.md - if: github.event_name != 'pull_request' run: | printf '%s\n\n' \ "Official repository: <${{ github.server_url }}/${{ github.repository }}>" > ./README.md.new cat ./README.md >> ./README.md.new && mv -f ./README.md.new ./README.md - name: Update repo description - if: github.event_name != 'pull_request' uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} From 01843ccfbc93c1758451a9f75259b32dd7cd9d41 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sun, 15 Sep 2024 15:00:38 -0700 Subject: [PATCH 66/76] Docker stop instead of killing pid --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 46cc1d3..ba0cd70 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,7 +83,6 @@ jobs: shell: bash run: | docker run --name bgutil-provider -d -p 4416:4416 brainicism/bgutil-ytdlp-pot-provider:ci - NODE_PID=$! echo "Waiting for server to be up..." ping() { @@ -104,9 +103,7 @@ jobs: echo "::error title=Failed to run yt-dlp when testing HTTP server::\ yt-dlp returned $? exit status" - if ps -p $NODE_PID > /dev/null; then - kill $NODE_PID - fi + docker stop bgutil-provider echo "::group::Logs from HTTP server" docker logs bgutil-provider From c3fef694bc4ca0fba20d081af4c479becbe3a0c7 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sun, 15 Sep 2024 16:03:57 -0700 Subject: [PATCH 67/76] Code review changes --- .github/workflows/release.yml | 2 -- .github/workflows/test.yml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe343a1..bed48a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -142,8 +142,6 @@ jobs: tags: | type=raw,value=latest,enable={{is_default_branch}} # mark as latest only if built on default branch of repository - type=raw,value=ci,enable={{is_default_branch}} - # mark as ci only if built on default branch of repository type=raw,value=${{ needs.release.outputs.version }},enable={{is_default_branch}} # add the new git tag only if built on default branch of repository type=sha diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ba0cd70..c441a53 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,10 +83,10 @@ jobs: shell: bash run: | docker run --name bgutil-provider -d -p 4416:4416 brainicism/bgutil-ytdlp-pot-provider:ci - echo "Waiting for server to be up..." ping() { until curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1; do + echo "Waiting for server to be up..." sleep ${1:-0.5} done } From 52735465493856c14151f0eace301dc847dc1350 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sun, 15 Sep 2024 16:05:46 -0700 Subject: [PATCH 68/76] Load: true --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c441a53..0f85384 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,7 +76,7 @@ jobs: with: context: server/ file: server/Dockerfile - push: false + load: true tags: brainicism/bgutil-ytdlp-pot-provider:ci - name: Test server method timeout-minutes: 3 From 2c94d0c552afc5502bbef37cbb5d495d0aba2187 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:14:40 +1200 Subject: [PATCH 69/76] fiix jq error --- .github/workflows/test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f85384..7547402 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -82,15 +82,16 @@ jobs: timeout-minutes: 3 shell: bash run: | - docker run --name bgutil-provider -d -p 4416:4416 brainicism/bgutil-ytdlp-pot-provider:ci - ping() { until curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1; do - echo "Waiting for server to be up..." sleep ${1:-0.5} done } export -f ping + + docker run --name bgutil-provider -d -p 4416:4416 brainicism/bgutil-ytdlp-pot-provider:ci + + echo "Waiting for server to be up..." PING_RESP=$(timeout 7.5 bash -c ping) || \ (echo "::error title=Timeout reached,file=server/src/main.ts::\ Timeout reached before the server is up." && exit 1) @@ -105,7 +106,7 @@ jobs: docker stop bgutil-provider - echo "::group::Logs from HTTP server" + echo "::group::Logs from HTTP server container" docker logs bgutil-provider echo "::endgroup::" From 95659d5f6ceb2ee5d412fc6548ba65c9b7f49fb1 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:16:06 +1200 Subject: [PATCH 70/76] use colours in jq --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7547402..772f1b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,7 +97,7 @@ jobs: Timeout reached before the server is up." && exit 1) echo "::group::Response from HTTP server" - echo "$PING_RESP" | jq + echo "$PING_RESP" | jq -C echo "::endgroup::" script_response=$(./yt-dlp -vF --print-traffic --no-simulate -f "b*" -S "filesize:10M" --exec "rm -f" dQw4w9WgXcQ 2>&1) || \ From 0d14de1dda9b91c8a8aa440bcbd7a6e363fd7d6f Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:52:20 +1200 Subject: [PATCH 71/76] add colour to yt-dlp; use env; cleanup --- .github/workflows/test.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 772f1b7..51ec2a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,8 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +env: + TEST_ARGS: -vF --print-traffic --no-simulate --color always -f "b*" -S "filesize:10M" --exec "rm -f" jobs: lint-format: @@ -47,7 +49,7 @@ jobs: - name: Test script method shell: bash run: | - script_response=$(./yt-dlp -vF --print-traffic --no-simulate -f "b*" -S "filesize:10M" --exec "rm -f" --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" dQw4w9WgXcQ 2>&1) || \ + script_response=$(./yt-dlp ${{ env.TEST_ARGS }} --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js" dQw4w9WgXcQ 2>&1) || \ echo "::error title=Failed to run yt-dlp when testing script::\ yt-dlp returned $? exit status" @@ -63,14 +65,17 @@ jobs: server-method: name: Test plugin (server method) runs-on: ubuntu-latest + env: + PORT: 4426 steps: - uses: actions/checkout@v4 - name: Download yt-dlp run: curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o yt-dlp && chmod +x ./yt-dlp - name: Install plugin run: | - mkdir ~/yt-dlp-plugins && curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o ~/yt-dlp-plugins/yt-dlp-get-pot.zip - cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ + mkdir -p ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ && cd ~/yt-dlp-plugins/ + curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o yt-dlp-get-pot.zip + cp -r ${{ github.workspace }}/plugin/ ~/yt-dlp-plugins/ - name: Build Docker image uses: docker/build-push-action@v6 with: @@ -83,13 +88,13 @@ jobs: shell: bash run: | ping() { - until curl -o- --silent --fail http://127.0.0.1:4416/ping 2>&1; do + until curl -o- --silent --fail http://127.0.0.1:${{ env.PORT }}/ping 2>&1; do sleep ${1:-0.5} done } export -f ping - docker run --name bgutil-provider -d -p 4416:4416 brainicism/bgutil-ytdlp-pot-provider:ci + docker run --name bgutil-provider -d -p 4416:${{ env.PORT }} brainicism/bgutil-ytdlp-pot-provider:ci echo "Waiting for server to be up..." PING_RESP=$(timeout 7.5 bash -c ping) || \ @@ -100,7 +105,7 @@ jobs: echo "$PING_RESP" | jq -C echo "::endgroup::" - script_response=$(./yt-dlp -vF --print-traffic --no-simulate -f "b*" -S "filesize:10M" --exec "rm -f" dQw4w9WgXcQ 2>&1) || \ + script_response=$(./yt-dlp ${{ env.TEST_ARGS }} --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:${{ env.PORT }}" dQw4w9WgXcQ 2>&1) || \ echo "::error title=Failed to run yt-dlp when testing HTTP server::\ yt-dlp returned $? exit status" From 88072555e94eaf08e92b750350cad6fd4efd17a3 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:56:11 +1200 Subject: [PATCH 72/76] fix port --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 51ec2a6..a2fce61 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,7 +94,7 @@ jobs: } export -f ping - docker run --name bgutil-provider -d -p 4416:${{ env.PORT }} brainicism/bgutil-ytdlp-pot-provider:ci + docker run --name bgutil-provider -d -p ${{ env.PORT }}:4416 brainicism/bgutil-ytdlp-pot-provider:ci echo "Waiting for server to be up..." PING_RESP=$(timeout 7.5 bash -c ping) || \ From 08cd278b3ad46a5408492886c54ea64e87cd5141 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:01:36 +1200 Subject: [PATCH 73/76] use numbers in env --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a2fce61..54ddcf6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,7 +66,9 @@ jobs: name: Test plugin (server method) runs-on: ubuntu-latest env: - PORT: 4426 + PORT: ${{ 4426 }} + INTERVAL: ${{ 0.5 }} + TIMEOUT: ${{ 7.5 }} steps: - uses: actions/checkout@v4 - name: Download yt-dlp @@ -97,7 +99,7 @@ jobs: docker run --name bgutil-provider -d -p ${{ env.PORT }}:4416 brainicism/bgutil-ytdlp-pot-provider:ci echo "Waiting for server to be up..." - PING_RESP=$(timeout 7.5 bash -c ping) || \ + PING_RESP=$(timeout ${{ env.TIMEOUT }} bash -c ping ${{ env.INTERVAL }}) || \ (echo "::error title=Timeout reached,file=server/src/main.ts::\ Timeout reached before the server is up." && exit 1) From 5fd95f8469823982e3a5affdeaa2f832d6a99a01 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:10:58 +1200 Subject: [PATCH 74/76] separate lines in setup script; cleanup --- .github/workflows/test.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 54ddcf6..b6ca246 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test +name: Run tests on: workflow_dispatch: pull_request: @@ -6,6 +6,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true + env: TEST_ARGS: -vF --print-traffic --no-simulate --color always -f "b*" -S "filesize:10M" --exec "rm -f" @@ -44,8 +45,9 @@ jobs: run: cd server/ && yarn install --frozen-lockfile && npx tsc - name: Install plugin run: | - mkdir ~/yt-dlp-plugins && curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o ~/yt-dlp-plugins/yt-dlp-get-pot.zip - cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ + mkdir -p ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ + curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o ~/yt-dlp-plugins/yt-dlp-get-pot.zip + cp -r plugin/ ~/yt-dlp-plugins/ - name: Test script method shell: bash run: | @@ -67,7 +69,8 @@ jobs: runs-on: ubuntu-latest env: PORT: ${{ 4426 }} - INTERVAL: ${{ 0.5 }} + # Interval/Timeout in seconds to wait for the server to be up + INTERVAL: ${{ 0.3 }} TIMEOUT: ${{ 7.5 }} steps: - uses: actions/checkout@v4 @@ -75,9 +78,9 @@ jobs: run: curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o yt-dlp && chmod +x ./yt-dlp - name: Install plugin run: | - mkdir -p ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ && cd ~/yt-dlp-plugins/ - curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o yt-dlp-get-pot.zip - cp -r ${{ github.workspace }}/plugin/ ~/yt-dlp-plugins/ + mkdir -p ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/ + curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o ~/yt-dlp-plugins/yt-dlp-get-pot.zip + cp -r plugin/ ~/yt-dlp-plugins/ - name: Build Docker image uses: docker/build-push-action@v6 with: From cd49c8248f29fa7f64955f064442ecea0982bee3 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:14:18 +1200 Subject: [PATCH 75/76] quote args --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6ca246..c263639 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -102,7 +102,7 @@ jobs: docker run --name bgutil-provider -d -p ${{ env.PORT }}:4416 brainicism/bgutil-ytdlp-pot-provider:ci echo "Waiting for server to be up..." - PING_RESP=$(timeout ${{ env.TIMEOUT }} bash -c ping ${{ env.INTERVAL }}) || \ + PING_RESP=$(timeout ${{ env.TIMEOUT }} bash -c "ping ${{ env.INTERVAL }}") || \ (echo "::error title=Timeout reached,file=server/src/main.ts::\ Timeout reached before the server is up." && exit 1) From cb9405126dc7a78488e76f65ec8fdd80edafa3f4 Mon Sep 17 00:00:00 2001 From: N/Ame <173015200+grqz@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:16:03 +1200 Subject: [PATCH 76/76] use 0.4 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c263639..cad80eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,7 +70,7 @@ jobs: env: PORT: ${{ 4426 }} # Interval/Timeout in seconds to wait for the server to be up - INTERVAL: ${{ 0.3 }} + INTERVAL: ${{ 0.4 }} TIMEOUT: ${{ 7.5 }} steps: - uses: actions/checkout@v4