From 0db7c5323356a064c4d6696d52644ee2632226e2 Mon Sep 17 00:00:00 2001
From: Aleksandr Statciuk <github@oiya.xyz>
Date: Mon, 21 Feb 2022 22:30:59 +0300
Subject: [PATCH 01/10] Update auto-update.yml

---
 .github/workflows/auto-update.yml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml
index 6d73a3297..da9d8b554 100644
--- a/.github/workflows/auto-update.yml
+++ b/.github/workflows/auto-update.yml
@@ -68,6 +68,8 @@ jobs:
     needs: load
     steps:
       - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
       - run: echo "::set-output name=branch_name::$(date +'bot/auto-update-%s')"
         id: create-branch-name
       - run: git config user.name 'iptv-bot[bot]'
@@ -136,6 +138,7 @@ jobs:
           git commit -m "[Bot] Update streams"
           git add README.md
           git commit -m "[Bot] Update README.md"
+          git push -u origin ${{ steps.create-branch-name.outputs.branch_name }}
       - uses: repo-sync/pull-request@v2
         if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
         id: pull-request

From 28661faccd7141a4044aa99dc3133ae1627a4f34 Mon Sep 17 00:00:00 2001
From: Aleksandr Statciuk <github@oiya.xyz>
Date: Tue, 22 Feb 2022 08:13:16 +0300
Subject: [PATCH 02/10] Update auto-update.yml

---
 .github/workflows/auto-update.yml | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml
index da9d8b554..805a64016 100644
--- a/.github/workflows/auto-update.yml
+++ b/.github/workflows/auto-update.yml
@@ -109,6 +109,16 @@ jobs:
         with:
           name: logs
           path: scripts/logs
+      - run: npm run readme:update
+      - name: Commit Changes
+        if: ${{ !env.ACT }}
+        run: |
+          git add streams/*
+          git commit -m "[Bot] Update streams"
+          git add README.md
+          git commit -m "[Bot] Update README.md"
+          git status
+          git push -u origin ${{ steps.create-branch-name.outputs.branch_name }}
       - uses: JamesIves/github-pages-deploy-action@4.1.1
         if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
         with:
@@ -118,6 +128,7 @@ jobs:
           git-config-name: iptv-bot[bot]
           git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
           commit-message: '[Bot] Generate playlists'
+          clean: false
       - run: npm run db:export
       - uses: JamesIves/github-pages-deploy-action@4.1.1
         if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
@@ -130,15 +141,6 @@ jobs:
           git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
           commit-message: '[Bot] Deploy to iptv-org/api'
           clean: false
-      - run: npm run readme:update
-      - name: Commit Changes
-        if: ${{ !env.ACT }}
-        run: |
-          git add streams/*
-          git commit -m "[Bot] Update streams"
-          git add README.md
-          git commit -m "[Bot] Update README.md"
-          git push -u origin ${{ steps.create-branch-name.outputs.branch_name }}
       - uses: repo-sync/pull-request@v2
         if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
         id: pull-request

From 8538e7997e783fb6c9f6cbbe99b32d65409cb70b Mon Sep 17 00:00:00 2001
From: Aleksandr Statciuk <github@oiya.xyz>
Date: Tue, 22 Feb 2022 08:15:09 +0300
Subject: [PATCH 03/10] Update auto-update.yml

for test only
---
 .github/workflows/auto-update.yml | 84 +++++++++++++++----------------
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml
index 805a64016..75b8fba19 100644
--- a/.github/workflows/auto-update.yml
+++ b/.github/workflows/auto-update.yml
@@ -43,9 +43,9 @@ jobs:
     continue-on-error: true
     strategy:
       fail-fast: false
-      matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
-      # matrix:
-      #   cluster_id: [1]
+      # matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
+      matrix:
+        cluster_id: [1]
     steps:
       - uses: actions/checkout@v2
       - uses: FedericoCarboni/setup-ffmpeg@v1
@@ -119,43 +119,43 @@ jobs:
           git commit -m "[Bot] Update README.md"
           git status
           git push -u origin ${{ steps.create-branch-name.outputs.branch_name }}
-      - uses: JamesIves/github-pages-deploy-action@4.1.1
-        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-        with:
-          branch: gh-pages
-          folder: .gh-pages
-          token: ${{ steps.create-app-token.outputs.token }}
-          git-config-name: iptv-bot[bot]
-          git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
-          commit-message: '[Bot] Generate playlists'
-          clean: false
-      - run: npm run db:export
-      - uses: JamesIves/github-pages-deploy-action@4.1.1
-        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-        with:
-          repository-name: iptv-org/api
-          branch: gh-pages
-          folder: .api
-          token: ${{ steps.create-app-token.outputs.token }}
-          git-config-name: iptv-bot[bot]
-          git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
-          commit-message: '[Bot] Deploy to iptv-org/api'
-          clean: false
-      - uses: repo-sync/pull-request@v2
-        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-        id: pull-request
-        with:
-          github_token: ${{ steps.create-app-token.outputs.token }}
-          source_branch: ${{ steps.create-branch-name.outputs.branch_name }}
-          destination_branch: 'master'
-          pr_title: '[Bot] Daily update'
-          pr_body: |
-            This pull request is created by [auto-update][1] workflow.
+      # - uses: JamesIves/github-pages-deploy-action@4.1.1
+      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+      #   with:
+      #     branch: gh-pages
+      #     folder: .gh-pages
+      #     token: ${{ steps.create-app-token.outputs.token }}
+      #     git-config-name: iptv-bot[bot]
+      #     git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
+      #     commit-message: '[Bot] Generate playlists'
+      #     clean: false
+      # - run: npm run db:export
+      # - uses: JamesIves/github-pages-deploy-action@4.1.1
+      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+      #   with:
+      #     repository-name: iptv-org/api
+      #     branch: gh-pages
+      #     folder: .api
+      #     token: ${{ steps.create-app-token.outputs.token }}
+      #     git-config-name: iptv-bot[bot]
+      #     git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
+      #     commit-message: '[Bot] Deploy to iptv-org/api'
+      #     clean: false
+      # - uses: repo-sync/pull-request@v2
+      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+      #   id: pull-request
+      #   with:
+      #     github_token: ${{ steps.create-app-token.outputs.token }}
+      #     source_branch: ${{ steps.create-branch-name.outputs.branch_name }}
+      #     destination_branch: 'master'
+      #     pr_title: '[Bot] Daily update'
+      #     pr_body: |
+      #       This pull request is created by [auto-update][1] workflow.
 
-            [1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
-      - uses: juliangruber/merge-pull-request-action@v1
-        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-        with:
-          github-token: ${{ secrets.PAT }}
-          number: ${{ steps.pull-request.outputs.pr_number }}
-          method: squash
+      #       [1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
+      # - uses: juliangruber/merge-pull-request-action@v1
+      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+      #   with:
+      #     github-token: ${{ secrets.PAT }}
+      #     number: ${{ steps.pull-request.outputs.pr_number }}
+      #     method: squash

From 036db575a93061675962ff1dda816bf2ab107eba Mon Sep 17 00:00:00 2001
From: Aleksandr Statciuk <github@oiya.xyz>
Date: Tue, 22 Feb 2022 08:20:29 +0300
Subject: [PATCH 04/10] Update auto-update.yml

speedup test
---
 .github/workflows/auto-update.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml
index 75b8fba19..6310e0f6c 100644
--- a/.github/workflows/auto-update.yml
+++ b/.github/workflows/auto-update.yml
@@ -28,7 +28,7 @@ jobs:
           name: data
           path: scripts/data
       - run: npm install
-      - run: npm run db:create
+      - run: npm run db:create -- --max-clusters=30000
       - uses: actions/upload-artifact@v2
         with:
           name: database

From 1593db379e8ce19c51dc4672d9e6c401c4869ecf Mon Sep 17 00:00:00 2001
From: Aleksandr Statciuk <github@oiya.xyz>
Date: Tue, 22 Feb 2022 08:27:08 +0300
Subject: [PATCH 05/10] Update auto-update.yml

---
 .github/workflows/auto-update.yml | 36 +++++++++++++++----------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml
index 6310e0f6c..4425ae873 100644
--- a/.github/workflows/auto-update.yml
+++ b/.github/workflows/auto-update.yml
@@ -119,6 +119,24 @@ jobs:
           git commit -m "[Bot] Update README.md"
           git status
           git push -u origin ${{ steps.create-branch-name.outputs.branch_name }}
+      - uses: repo-sync/pull-request@v2
+        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+        id: pull-request
+        with:
+          github_token: ${{ steps.create-app-token.outputs.token }}
+          source_branch: ${{ steps.create-branch-name.outputs.branch_name }}
+          destination_branch: 'master'
+          pr_title: '[Bot] Daily update'
+          pr_body: |
+            This pull request is created by [auto-update][1] workflow.
+
+            [1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
+      # - uses: juliangruber/merge-pull-request-action@v1
+      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+      #   with:
+      #     github-token: ${{ secrets.PAT }}
+      #     number: ${{ steps.pull-request.outputs.pr_number }}
+      #     method: squash
       # - uses: JamesIves/github-pages-deploy-action@4.1.1
       #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
       #   with:
@@ -141,21 +159,3 @@ jobs:
       #     git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
       #     commit-message: '[Bot] Deploy to iptv-org/api'
       #     clean: false
-      # - uses: repo-sync/pull-request@v2
-      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-      #   id: pull-request
-      #   with:
-      #     github_token: ${{ steps.create-app-token.outputs.token }}
-      #     source_branch: ${{ steps.create-branch-name.outputs.branch_name }}
-      #     destination_branch: 'master'
-      #     pr_title: '[Bot] Daily update'
-      #     pr_body: |
-      #       This pull request is created by [auto-update][1] workflow.
-
-      #       [1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
-      # - uses: juliangruber/merge-pull-request-action@v1
-      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-      #   with:
-      #     github-token: ${{ secrets.PAT }}
-      #     number: ${{ steps.pull-request.outputs.pr_number }}
-      #     method: squash

From 837c6c4e64d45f9cfe5f0fa4fff5d6f9a804f44d Mon Sep 17 00:00:00 2001
From: Aleksandr Statciuk <github@oiya.xyz>
Date: Tue, 22 Feb 2022 08:35:22 +0300
Subject: [PATCH 06/10] Update auto-update.yml

---
 .github/workflows/auto-update.yml | 66 +++++++++++++++----------------
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml
index 4425ae873..bc39e7bb0 100644
--- a/.github/workflows/auto-update.yml
+++ b/.github/workflows/auto-update.yml
@@ -28,7 +28,7 @@ jobs:
           name: data
           path: scripts/data
       - run: npm install
-      - run: npm run db:create -- --max-clusters=30000
+      - run: npm run db:create
       - uses: actions/upload-artifact@v2
         with:
           name: database
@@ -43,9 +43,9 @@ jobs:
     continue-on-error: true
     strategy:
       fail-fast: false
-      # matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
-      matrix:
-        cluster_id: [1]
+      matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
+      # matrix:
+      #   cluster_id: [1]
     steps:
       - uses: actions/checkout@v2
       - uses: FedericoCarboni/setup-ffmpeg@v1
@@ -105,11 +105,12 @@ jobs:
           path: scripts/database
       - run: npm run playlist:update
       - run: npm run playlist:generate
+      - run: npm run db:export
+      - run: npm run readme:update
       - uses: actions/upload-artifact@v2
         with:
           name: logs
           path: scripts/logs
-      - run: npm run readme:update
       - name: Commit Changes
         if: ${{ !env.ACT }}
         run: |
@@ -131,31 +132,30 @@ jobs:
             This pull request is created by [auto-update][1] workflow.
 
             [1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
-      # - uses: juliangruber/merge-pull-request-action@v1
-      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-      #   with:
-      #     github-token: ${{ secrets.PAT }}
-      #     number: ${{ steps.pull-request.outputs.pr_number }}
-      #     method: squash
-      # - uses: JamesIves/github-pages-deploy-action@4.1.1
-      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-      #   with:
-      #     branch: gh-pages
-      #     folder: .gh-pages
-      #     token: ${{ steps.create-app-token.outputs.token }}
-      #     git-config-name: iptv-bot[bot]
-      #     git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
-      #     commit-message: '[Bot] Generate playlists'
-      #     clean: false
-      # - run: npm run db:export
-      # - uses: JamesIves/github-pages-deploy-action@4.1.1
-      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-      #   with:
-      #     repository-name: iptv-org/api
-      #     branch: gh-pages
-      #     folder: .api
-      #     token: ${{ steps.create-app-token.outputs.token }}
-      #     git-config-name: iptv-bot[bot]
-      #     git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
-      #     commit-message: '[Bot] Deploy to iptv-org/api'
-      #     clean: false
+      - uses: JamesIves/github-pages-deploy-action@4.1.1
+        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+        with:
+          branch: gh-pages
+          folder: .gh-pages
+          token: ${{ steps.create-app-token.outputs.token }}
+          git-config-name: iptv-bot[bot]
+          git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
+          commit-message: '[Bot] Generate playlists'
+          clean: false
+      - uses: JamesIves/github-pages-deploy-action@4.1.1
+        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+        with:
+          repository-name: iptv-org/api
+          branch: gh-pages
+          folder: .api
+          token: ${{ steps.create-app-token.outputs.token }}
+          git-config-name: iptv-bot[bot]
+          git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
+          commit-message: '[Bot] Deploy to iptv-org/api'
+          clean: false
+      - uses: juliangruber/merge-pull-request-action@v1
+        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+        with:
+          github-token: ${{ secrets.PAT }}
+          number: ${{ steps.pull-request.outputs.pr_number }}
+          method: squash

From a3f84b00627610146a85fd333af0d4dc8b82aa8e Mon Sep 17 00:00:00 2001
From: Aleksandr Statciuk <github@oiya.xyz>
Date: Tue, 22 Feb 2022 08:36:40 +0300
Subject: [PATCH 07/10] Update auto-update.yml

test
---
 .github/workflows/auto-update.yml | 62 +++++++++++++++----------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml
index bc39e7bb0..e8bf2e8b3 100644
--- a/.github/workflows/auto-update.yml
+++ b/.github/workflows/auto-update.yml
@@ -28,7 +28,7 @@ jobs:
           name: data
           path: scripts/data
       - run: npm install
-      - run: npm run db:create
+      - run: npm run db:create -- --max-clusters=30000
       - uses: actions/upload-artifact@v2
         with:
           name: database
@@ -43,9 +43,9 @@ jobs:
     continue-on-error: true
     strategy:
       fail-fast: false
-      matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
-      # matrix:
-      #   cluster_id: [1]
+      # matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
+      matrix:
+        cluster_id: [1]
     steps:
       - uses: actions/checkout@v2
       - uses: FedericoCarboni/setup-ffmpeg@v1
@@ -132,30 +132,30 @@ jobs:
             This pull request is created by [auto-update][1] workflow.
 
             [1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
-      - uses: JamesIves/github-pages-deploy-action@4.1.1
-        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-        with:
-          branch: gh-pages
-          folder: .gh-pages
-          token: ${{ steps.create-app-token.outputs.token }}
-          git-config-name: iptv-bot[bot]
-          git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
-          commit-message: '[Bot] Generate playlists'
-          clean: false
-      - uses: JamesIves/github-pages-deploy-action@4.1.1
-        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-        with:
-          repository-name: iptv-org/api
-          branch: gh-pages
-          folder: .api
-          token: ${{ steps.create-app-token.outputs.token }}
-          git-config-name: iptv-bot[bot]
-          git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
-          commit-message: '[Bot] Deploy to iptv-org/api'
-          clean: false
-      - uses: juliangruber/merge-pull-request-action@v1
-        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-        with:
-          github-token: ${{ secrets.PAT }}
-          number: ${{ steps.pull-request.outputs.pr_number }}
-          method: squash
+      # - uses: JamesIves/github-pages-deploy-action@4.1.1
+      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+      #   with:
+      #     branch: gh-pages
+      #     folder: .gh-pages
+      #     token: ${{ steps.create-app-token.outputs.token }}
+      #     git-config-name: iptv-bot[bot]
+      #     git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
+      #     commit-message: '[Bot] Generate playlists'
+      #     clean: false
+      # - uses: JamesIves/github-pages-deploy-action@4.1.1
+      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+      #   with:
+      #     repository-name: iptv-org/api
+      #     branch: gh-pages
+      #     folder: .api
+      #     token: ${{ steps.create-app-token.outputs.token }}
+      #     git-config-name: iptv-bot[bot]
+      #     git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
+      #     commit-message: '[Bot] Deploy to iptv-org/api'
+      #     clean: false
+      # - uses: juliangruber/merge-pull-request-action@v1
+      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+      #   with:
+      #     github-token: ${{ secrets.PAT }}
+      #     number: ${{ steps.pull-request.outputs.pr_number }}
+      #     method: squash

From 82c50d90d12cf24115abcb58fd326841922b95b5 Mon Sep 17 00:00:00 2001
From: Aleksandr Statciuk <github@oiya.xyz>
Date: Tue, 22 Feb 2022 08:41:18 +0300
Subject: [PATCH 08/10] Update auto-update.yml

---
 .github/workflows/auto-update.yml | 62 +++++++++++++++----------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml
index e8bf2e8b3..bc39e7bb0 100644
--- a/.github/workflows/auto-update.yml
+++ b/.github/workflows/auto-update.yml
@@ -28,7 +28,7 @@ jobs:
           name: data
           path: scripts/data
       - run: npm install
-      - run: npm run db:create -- --max-clusters=30000
+      - run: npm run db:create
       - uses: actions/upload-artifact@v2
         with:
           name: database
@@ -43,9 +43,9 @@ jobs:
     continue-on-error: true
     strategy:
       fail-fast: false
-      # matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
-      matrix:
-        cluster_id: [1]
+      matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
+      # matrix:
+      #   cluster_id: [1]
     steps:
       - uses: actions/checkout@v2
       - uses: FedericoCarboni/setup-ffmpeg@v1
@@ -132,30 +132,30 @@ jobs:
             This pull request is created by [auto-update][1] workflow.
 
             [1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
-      # - uses: JamesIves/github-pages-deploy-action@4.1.1
-      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-      #   with:
-      #     branch: gh-pages
-      #     folder: .gh-pages
-      #     token: ${{ steps.create-app-token.outputs.token }}
-      #     git-config-name: iptv-bot[bot]
-      #     git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
-      #     commit-message: '[Bot] Generate playlists'
-      #     clean: false
-      # - uses: JamesIves/github-pages-deploy-action@4.1.1
-      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-      #   with:
-      #     repository-name: iptv-org/api
-      #     branch: gh-pages
-      #     folder: .api
-      #     token: ${{ steps.create-app-token.outputs.token }}
-      #     git-config-name: iptv-bot[bot]
-      #     git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
-      #     commit-message: '[Bot] Deploy to iptv-org/api'
-      #     clean: false
-      # - uses: juliangruber/merge-pull-request-action@v1
-      #   if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
-      #   with:
-      #     github-token: ${{ secrets.PAT }}
-      #     number: ${{ steps.pull-request.outputs.pr_number }}
-      #     method: squash
+      - uses: JamesIves/github-pages-deploy-action@4.1.1
+        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+        with:
+          branch: gh-pages
+          folder: .gh-pages
+          token: ${{ steps.create-app-token.outputs.token }}
+          git-config-name: iptv-bot[bot]
+          git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
+          commit-message: '[Bot] Generate playlists'
+          clean: false
+      - uses: JamesIves/github-pages-deploy-action@4.1.1
+        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+        with:
+          repository-name: iptv-org/api
+          branch: gh-pages
+          folder: .api
+          token: ${{ steps.create-app-token.outputs.token }}
+          git-config-name: iptv-bot[bot]
+          git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
+          commit-message: '[Bot] Deploy to iptv-org/api'
+          clean: false
+      - uses: juliangruber/merge-pull-request-action@v1
+        if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
+        with:
+          github-token: ${{ secrets.PAT }}
+          number: ${{ steps.pull-request.outputs.pr_number }}
+          method: squash

From 25af0bcecda866030866e80abc2b82353651e959 Mon Sep 17 00:00:00 2001
From: Aleksandr Statciuk <github@oiya.xyz>
Date: Tue, 22 Feb 2022 11:02:54 +0300
Subject: [PATCH 09/10] Adds missing user-agent & referrer attributes

---
 scripts/core/playlist.js                             | 10 +++++-----
 tests/__data__/expected/.api/streams.json            |  2 +-
 .../expected/.gh-pages/categories/undefined.m3u      |  4 +++-
 tests/__data__/expected/.gh-pages/countries/uk.m3u   |  4 +++-
 tests/__data__/expected/.gh-pages/index.category.m3u |  4 +++-
 tests/__data__/expected/.gh-pages/index.country.m3u  |  4 +++-
 tests/__data__/expected/.gh-pages/index.language.m3u |  4 +++-
 tests/__data__/expected/.gh-pages/index.m3u          |  4 +++-
 tests/__data__/expected/.gh-pages/index.nsfw.m3u     |  4 +++-
 tests/__data__/expected/.gh-pages/index.region.m3u   | 12 +++++++++---
 .../expected/.gh-pages/languages/undefined.m3u       |  4 +++-
 tests/__data__/expected/.gh-pages/regions/emea.m3u   |  4 +++-
 tests/__data__/expected/.gh-pages/regions/eur.m3u    |  4 +++-
 tests/__data__/expected/.gh-pages/regions/int.m3u    |  4 +++-
 .../__data__/expected/database/db_create.streams.db  |  2 +-
 tests/__data__/expected/streams/ad.m3u               |  4 +++-
 tests/__data__/input/database/db_export.streams.db   |  2 +-
 .../input/database/playlist_generate.streams.db      |  2 +-
 .../input/database/playlist_update.streams.db        |  2 +-
 tests/__data__/input/streams/ad.m3u                  |  4 +++-
 tests/commands/playlist/update.test.js               |  2 +-
 21 files changed, 59 insertions(+), 27 deletions(-)

diff --git a/scripts/core/playlist.js b/scripts/core/playlist.js
index 76287be58..fdf57aec9 100644
--- a/scripts/core/playlist.js
+++ b/scripts/core/playlist.js
@@ -24,20 +24,20 @@ class Playlist {
           'tvg-country': stream.get('tvg_country'),
           'tvg-language': stream.get('tvg_language'),
           'tvg-logo': stream.get('tvg_logo'),
-          'user-agent': stream.get('http.user-agent') || undefined,
-          'group-title': stream.get('group_title')
+          'group-title': stream.get('group_title'),
+          'user-agent': stream.get('user_agent') || undefined
         }
       } else {
         attrs = {
           'tvg-id': stream.get('tvg_id'),
           status: stream.get('status'),
-          'user-agent': stream.get('http.user-agent') || undefined
+          'user-agent': stream.get('user_agent') || undefined
         }
       }
 
       const vlcOpts = {
-        'http-referrer': stream.get('http.referrer') || undefined,
-        'http-user-agent': stream.get('http.user-agent') || undefined
+        'http-referrer': stream.get('http_referrer') || undefined,
+        'http-user-agent': stream.get('user_agent') || undefined
       }
 
       this.links.push({
diff --git a/tests/__data__/expected/.api/streams.json b/tests/__data__/expected/.api/streams.json
index 216a03eed..bf8b03b6b 100644
--- a/tests/__data__/expected/.api/streams.json
+++ b/tests/__data__/expected/.api/streams.json
@@ -1 +1 @@
-[{"channel":"AndorraTV.ad","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":null,"user_agent":null,"status":"error"},{"channel":"BBCNews.uk","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":null,"user_agent":null,"status":"blocked"},{"channel":"BBCNewsHD.ad","url":"https://master.starmena-cloud.com/hls/libyas.m3u8","http_referrer":null,"user_agent":null,"status":"online","width":1024,"height":576,"bitrate":0},{"channel":"KayhanTV.af","url":"http://208.93.117.113/live/Stream1/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"error"},{"channel":"LDPRTV.ru","url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"error"},{"channel":"Sharq.af","url":"https://forerunnerrtmp.livestreamingcdn.com/output18/output18.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"online","width":1280,"height":720,"bitrate":2226543}]
\ No newline at end of file
+[{"channel":"AndorraTV.ad","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":"http://imn.iq","user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148","status":"error"},{"channel":"BBCNews.uk","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":null,"user_agent":null,"status":"blocked"},{"channel":"BBCNewsHD.ad","url":"https://master.starmena-cloud.com/hls/libyas.m3u8","http_referrer":null,"user_agent":null,"status":"online","width":1024,"height":576,"bitrate":0},{"channel":"KayhanTV.af","url":"http://208.93.117.113/live/Stream1/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"error"},{"channel":"LDPRTV.ru","url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"error"},{"channel":"Sharq.af","url":"https://forerunnerrtmp.livestreamingcdn.com/output18/output18.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"online","width":1280,"height":720,"bitrate":2226543}]
\ No newline at end of file
diff --git a/tests/__data__/expected/.gh-pages/categories/undefined.m3u b/tests/__data__/expected/.gh-pages/categories/undefined.m3u
index 1433371ff..600720c52 100644
--- a/tests/__data__/expected/.gh-pages/categories/undefined.m3u
+++ b/tests/__data__/expected/.gh-pages/categories/undefined.m3u
@@ -1,5 +1,7 @@
 #EXTM3U x-tvg-url=""
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="" tvg-country="IN" tvg-language="" tvg-logo="" group-title="Undefined",Daawah TV
 http://51.15.246.58:8081/daawahtv/daawahtv2/playlist.m3u8
diff --git a/tests/__data__/expected/.gh-pages/countries/uk.m3u b/tests/__data__/expected/.gh-pages/countries/uk.m3u
index 0ee2e9d16..da3d43d77 100644
--- a/tests/__data__/expected/.gh-pages/countries/uk.m3u
+++ b/tests/__data__/expected/.gh-pages/countries/uk.m3u
@@ -1,5 +1,7 @@
 #EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/uk/ontvtonight.com.epg.xml"
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="INT" tvg-language="English" tvg-logo="https://raw.githubusercontent.com/Tapiosinn/tv-logos/master/countries/united-kingdom/bbc-news-uk.png" group-title="General;News",BBC News HD
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
diff --git a/tests/__data__/expected/.gh-pages/index.category.m3u b/tests/__data__/expected/.gh-pages/index.category.m3u
index 62bbe7332..d9c5117f9 100644
--- a/tests/__data__/expected/.gh-pages/index.category.m3u
+++ b/tests/__data__/expected/.gh-pages/index.category.m3u
@@ -7,7 +7,9 @@ http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
 #EXTINF:-1 tvg-id="MeteoMedia.ca" tvg-country="CA" tvg-language="French" tvg-logo="https://s1.twnmm.com/images/en_ca/mobile/logos/twn-mobile-logo.png" group-title="Weather",Meteomedia
 http://encodercdn1.frontline.ca/encoder181/output/Meteo_Media_720p/playlist.m3u8
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="" tvg-country="IN" tvg-language="" tvg-logo="" group-title="Undefined",Daawah TV
 http://51.15.246.58:8081/daawahtv/daawahtv2/playlist.m3u8
diff --git a/tests/__data__/expected/.gh-pages/index.country.m3u b/tests/__data__/expected/.gh-pages/index.country.m3u
index 3f8aa2213..651e2db9a 100644
--- a/tests/__data__/expected/.gh-pages/index.country.m3u
+++ b/tests/__data__/expected/.gh-pages/index.country.m3u
@@ -479,7 +479,9 @@ http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
 #EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="INT" tvg-language="English" tvg-logo="https://raw.githubusercontent.com/Tapiosinn/tv-logos/master/countries/united-kingdom/bbc-news-uk.png" group-title="United Arab Emirates",BBC News HD
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="United Kingdom",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="United Kingdom" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="INT" tvg-language="English" tvg-logo="https://raw.githubusercontent.com/Tapiosinn/tv-logos/master/countries/united-kingdom/bbc-news-uk.png" group-title="United Kingdom",BBC News HD
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
diff --git a/tests/__data__/expected/.gh-pages/index.language.m3u b/tests/__data__/expected/.gh-pages/index.language.m3u
index b44a2c337..c7bdeda35 100644
--- a/tests/__data__/expected/.gh-pages/index.language.m3u
+++ b/tests/__data__/expected/.gh-pages/index.language.m3u
@@ -5,7 +5,9 @@ http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
 http://encodercdn1.frontline.ca/encoder181/output/Meteo_Media_720p/playlist.m3u8
 #EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="Russian",ЛДПР ТВ (1080p)
 http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="" tvg-country="IN" tvg-language="" tvg-logo="" group-title="Undefined",Daawah TV
 http://51.15.246.58:8081/daawahtv/daawahtv2/playlist.m3u8
diff --git a/tests/__data__/expected/.gh-pages/index.m3u b/tests/__data__/expected/.gh-pages/index.m3u
index 766dcdcf2..7d6a9bb49 100644
--- a/tests/__data__/expected/.gh-pages/index.m3u
+++ b/tests/__data__/expected/.gh-pages/index.m3u
@@ -1,5 +1,7 @@
 #EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml,https://iptv-org.github.io/epg/guides/uk/ontvtonight.com.epg.xml"
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="INT" tvg-language="English" tvg-logo="https://raw.githubusercontent.com/Tapiosinn/tv-logos/master/countries/united-kingdom/bbc-news-uk.png" group-title="General;News",BBC News HD
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
diff --git a/tests/__data__/expected/.gh-pages/index.nsfw.m3u b/tests/__data__/expected/.gh-pages/index.nsfw.m3u
index 1b0b59f7c..eb2260db9 100644
--- a/tests/__data__/expected/.gh-pages/index.nsfw.m3u
+++ b/tests/__data__/expected/.gh-pages/index.nsfw.m3u
@@ -1,5 +1,7 @@
 #EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml,https://iptv-org.github.io/epg/guides/uk/ontvtonight.com.epg.xml"
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="INT" tvg-language="English" tvg-logo="https://raw.githubusercontent.com/Tapiosinn/tv-logos/master/countries/united-kingdom/bbc-news-uk.png" group-title="General;News",BBC News HD
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
diff --git a/tests/__data__/expected/.gh-pages/index.region.m3u b/tests/__data__/expected/.gh-pages/index.region.m3u
index 2b79bec3d..8432281a7 100644
--- a/tests/__data__/expected/.gh-pages/index.region.m3u
+++ b/tests/__data__/expected/.gh-pages/index.region.m3u
@@ -9,13 +9,17 @@ http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
 http://51.15.246.58:8081/daawahtv/daawahtv2/playlist.m3u8
 #EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="Commonwealth of Independent States",ЛДПР ТВ (1080p)
 http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Europe",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Europe" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="Zoo.ad" tvg-country="AD" tvg-language="" tvg-logo="" group-title="Europe",Zoo (720p)
 https://iptv-all.lanesh4d0w.repl.co/andorra/zoo
 #EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="Europe",ЛДПР ТВ (1080p)
 http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Europe, the Middle East and Africa",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Europe, the Middle East and Africa" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="Zoo.ad" tvg-country="AD" tvg-language="" tvg-logo="" group-title="Europe, the Middle East and Africa",Zoo (720p)
 https://iptv-all.lanesh4d0w.repl.co/andorra/zoo
@@ -27,7 +31,9 @@ http://encodercdn1.frontline.ca/encoder181/output/Meteo_Media_720p/playlist.m3u8
 http://encodercdn1.frontline.ca/encoder181/output/Meteo_Media_720p/playlist.m3u8
 #EXTINF:-1 tvg-id="" tvg-country="IN" tvg-language="" tvg-logo="" group-title="South Asia",Daawah TV
 http://51.15.246.58:8081/daawahtv/daawahtv2/playlist.m3u8
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Worldwide",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Worldwide" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="INT" tvg-language="English" tvg-logo="https://raw.githubusercontent.com/Tapiosinn/tv-logos/master/countries/united-kingdom/bbc-news-uk.png" group-title="Worldwide",BBC News HD
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
diff --git a/tests/__data__/expected/.gh-pages/languages/undefined.m3u b/tests/__data__/expected/.gh-pages/languages/undefined.m3u
index 1433371ff..600720c52 100644
--- a/tests/__data__/expected/.gh-pages/languages/undefined.m3u
+++ b/tests/__data__/expected/.gh-pages/languages/undefined.m3u
@@ -1,5 +1,7 @@
 #EXTM3U x-tvg-url=""
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="" tvg-country="IN" tvg-language="" tvg-logo="" group-title="Undefined",Daawah TV
 http://51.15.246.58:8081/daawahtv/daawahtv2/playlist.m3u8
diff --git a/tests/__data__/expected/.gh-pages/regions/emea.m3u b/tests/__data__/expected/.gh-pages/regions/emea.m3u
index 4a22fcabe..251f7ef42 100644
--- a/tests/__data__/expected/.gh-pages/regions/emea.m3u
+++ b/tests/__data__/expected/.gh-pages/regions/emea.m3u
@@ -1,5 +1,7 @@
 #EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="Zoo.ad" tvg-country="AD" tvg-language="" tvg-logo="" group-title="Undefined",Zoo (720p)
 https://iptv-all.lanesh4d0w.repl.co/andorra/zoo
diff --git a/tests/__data__/expected/.gh-pages/regions/eur.m3u b/tests/__data__/expected/.gh-pages/regions/eur.m3u
index 4a22fcabe..251f7ef42 100644
--- a/tests/__data__/expected/.gh-pages/regions/eur.m3u
+++ b/tests/__data__/expected/.gh-pages/regions/eur.m3u
@@ -1,5 +1,7 @@
 #EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="Zoo.ad" tvg-country="AD" tvg-language="" tvg-logo="" group-title="Undefined",Zoo (720p)
 https://iptv-all.lanesh4d0w.repl.co/andorra/zoo
diff --git a/tests/__data__/expected/.gh-pages/regions/int.m3u b/tests/__data__/expected/.gh-pages/regions/int.m3u
index 58ae9fccb..f43ae1ce9 100644
--- a/tests/__data__/expected/.gh-pages/regions/int.m3u
+++ b/tests/__data__/expected/.gh-pages/regions/int.m3u
@@ -1,5 +1,7 @@
 #EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml,https://iptv-org.github.io/epg/guides/uk/ontvtonight.com.epg.xml"
-#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined",Andorra TV (720p) [Not 24/7]
+#EXTINF:-1 tvg-id="" tvg-country="UK" tvg-language="" tvg-logo="" group-title="Undefined" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",Andorra TV (720p) [Not 24/7]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8
 #EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="INT" tvg-language="English" tvg-logo="https://raw.githubusercontent.com/Tapiosinn/tv-logos/master/countries/united-kingdom/bbc-news-uk.png" group-title="General;News",BBC News HD
 http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
diff --git a/tests/__data__/expected/database/db_create.streams.db b/tests/__data__/expected/database/db_create.streams.db
index 3eed2a5b7..03306c844 100644
--- a/tests/__data__/expected/database/db_create.streams.db
+++ b/tests/__data__/expected/database/db_create.streams.db
@@ -1,4 +1,4 @@
 {"channel":null,"title":"1A Network (720p)","filepath":"tests/__data__/input/streams/unsorted.m3u","url":"https://simultv.s.llnwi.net/n4s4/2ANetwork/interlink.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"ZJejfvbOVTyuf6Gk"}
 {"channel":null,"title":"Fox Sports 2 Asia (Thai) (720p)","filepath":"tests/__data__/input/streams/us_blocked.m3u","url":"https://example.com/playlist.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"gnjGLZU1CEz79gcp"}
-{"channel":"ATV.ad","title":"ATV (720p) [Offline]","filepath":"tests/__data__/input/streams/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"9r9qmYRa2kxiirl0"}
+{"channel":"ATV.ad","title":"ATV (720p) [Offline]","filepath":"tests/__data__/input/streams/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":"http://imn.iq","user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148","cluster_id":1,"_id":"9r9qmYRa2kxiirl0"}
 {"channel":null,"title":"ABC (720p)","filepath":"tests/__data__/input/streams/wrong_id.m3u","url":"https://example.com/playlist2.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"unOCFJtsDCbJupxR"}
diff --git a/tests/__data__/expected/streams/ad.m3u b/tests/__data__/expected/streams/ad.m3u
index 825c8e3b9..9c5d75dbe 100644
--- a/tests/__data__/expected/streams/ad.m3u
+++ b/tests/__data__/expected/streams/ad.m3u
@@ -1,3 +1,5 @@
 #EXTM3U
-#EXTINF:-1 tvg-id="AndorraTV.ad" status="timeout",ATV (720p) [Offline]
+#EXTINF:-1 tvg-id="AndorraTV.ad" status="timeout" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",ATV (720p) [Offline]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 https://iptv-all.lanesh4d0w.repl.co/andorra/atv
diff --git a/tests/__data__/input/database/db_export.streams.db b/tests/__data__/input/database/db_export.streams.db
index 18f362471..0ba48c9e2 100644
--- a/tests/__data__/input/database/db_export.streams.db
+++ b/tests/__data__/input/database/db_export.streams.db
@@ -1,6 +1,6 @@
 {"title":"ЛДПР ТВ","channel":"LDPRTV.ru","filepath":"tests/__data__/output/streams/ru.m3u","url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"2ST8btby3mmsgPF0","status":"error"}
 {"title":"BBC News HD","channel":"BBCNews.uk","filepath":"tests/__data__/output/streams/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":null,"user_agent":null,"cluster_id":3,"_id":"3TbieV1ptnZVCIdn","status":"blocked"}
-{"title":"ATV","channel":"AndorraTV.ad","filepath":"tests/__data__/output/streams/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"I6cjG2xCBRFFP4sz","status":"error"}
+{"title":"ATV","channel":"AndorraTV.ad","filepath":"tests/__data__/output/streams/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":"http://imn.iq","user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148","cluster_id":1,"_id":"I6cjG2xCBRFFP4sz","status":"error"}
 {"title":"BBC News HD","channel":"BBCNewsHD.ad","filepath":"tests/__data__/output/streams/uk.m3u","url":"https://master.starmena-cloud.com/hls/libyas.m3u8","http_referrer":null,"user_agent":null,"cluster_id":3,"_id":"WTbieV1ptnZVCIdn","status":"online","bitrate":0,"width":1024,"height":576}
 {"title":"Kayhan TV","channel":"KayhanTV.af","filepath":"channels/af.m3u","url":"http://208.93.117.113/live/Stream1/playlist.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"cFFpFVzSn6xFMUF3","status":"error"}
 {"title":"Sharq","channel":"Sharq.af","filepath":"channels/af.m3u","bitrate":2226543,"width":1280,"height":720,"url":"https://forerunnerrtmp.livestreamingcdn.com/output18/output18.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"u7iyA6cjtf1iWWAZ","status":"online"}
diff --git a/tests/__data__/input/database/playlist_generate.streams.db b/tests/__data__/input/database/playlist_generate.streams.db
index c90b9ee7c..12e3519a6 100644
--- a/tests/__data__/input/database/playlist_generate.streams.db
+++ b/tests/__data__/input/database/playlist_generate.streams.db
@@ -2,7 +2,7 @@
 {"title":"BBC News HD (720p) [Geo-blocked]","channel":"BBCNews.uk","filepath":"tests/__data__/output/streams/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/playlist.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"status":"online","cluster_id":3,"_id":"3TbieV1ptnZVCId5"}
 {"title":"BBC News HD","channel":"BBCNews.uk","filepath":"tests/__data__/output/streams/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"status":"online","cluster_id":3,"_id":"3TbieV1ptnZVCIdn"}
 {"title":"ATV","channel":"AndorraTV.ad","filepath":"tests/__data__/output/streams/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":null,"user_agent":null,"height":720,"width":1280,"status":"error","cluster_id":1,"_id":"I6cjG2xCBRFFP44z"}
-{"title":"Andorra TV (720p) [Not 24/7]","channel":"","filepath":"tests/__data__/output/streams/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"status":"online","cluster_id":3,"_id":"WTbieV1ptnZVCIdn"}
+{"title":"Andorra TV (720p) [Not 24/7]","channel":"","filepath":"tests/__data__/output/streams/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8","http_referrer":"http://imn.iq","user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148","height":720,"width":1280,"status":"online","cluster_id":3,"_id":"WTbieV1ptnZVCIdn"}
 {"title":"Visit-X TV","channel":"VisitXTV.nl","filepath":"tests/__data__/output/streams/nl.m3u","url":"https://stream.visit-x.tv/vxtv/ngrp:live_all/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"online","cluster_id":1,"_id":"2ST8btby3mmsgPF5"}
 {"title":"Tastemade","channel":"","filepath":"tests/__data__/output/streams/unsorted.m3u","url":"https://tastemade-freetv16min-plex.amagi.tv/hls/amagi_hls_data_tastemade-tastemadefreetv16-plex/CDN/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"online","cluster_id":1,"_id":"2ST8btby3mmsgPAB"}
 {"title":"Supra","channel":"","filepath":"tests/__data__/output/streams/unsorted.m3u","url":"https://www.youtube.com/watch?v=dzShOMiH1FY","http_referrer":null,"user_agent":null,"status":"error","cluster_id":1,"_id":"2ST8btby3mmsg5AB"}
diff --git a/tests/__data__/input/database/playlist_update.streams.db b/tests/__data__/input/database/playlist_update.streams.db
index 3fa913e3c..735f03103 100644
--- a/tests/__data__/input/database/playlist_update.streams.db
+++ b/tests/__data__/input/database/playlist_update.streams.db
@@ -1,6 +1,6 @@
 {"title":"ЛДПР ТВ (1080p)","channel":"LDPRTV.ru","filepath":"tests/__data__/output/streams/ru.m3u","url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"height":1080,"width":1920,"cluster_id":1,"status":"online","_id":"2ST8btby3mmsgPF0"}
 {"title":"BBC News HD (720p) [Not 24/7]","channel":"BBCNews.uk","filepath":"tests/__data__/output/streams/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"cluster_id":3,"status":"error","_id":"3TbieV1ptnZVCIdn"}
-{"title":"ATV (720p) [Offline]","channel":"AndorraTV.ad","filepath":"tests/__data__/output/streams/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":null,"user_agent":null,"height":720,"width":1280,"cluster_id":1,"status":"timeout","_id":"I6cjG2xCBRFFP4sz"}
+{"title":"ATV (720p) [Offline]","channel":"AndorraTV.ad","filepath":"tests/__data__/output/streams/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":"http://imn.iq","user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148","height":720,"width":1280,"cluster_id":1,"status":"timeout","_id":"I6cjG2xCBRFFP4sz"}
 {"title":"BBC News HD (480p) [Geo-blocked]","channel":"BBCNews.uk","filepath":"tests/__data__/output/streams/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/playlist.m3u8","http_referrer":null,"user_agent":null,"height":480,"width":640,"cluster_id":3,"status":"online","_id":"WTbieV1ptnZVCIdn"}
 {"title":"Kayhan TV","channel":"KayhanTV.af","filepath":"tests/__data__/output/streams/af.m3u","url":"http://208.93.117.113/live/Stream1/playlist.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"cluster_id":1,"status":"blocked","_id":"cFFpFVzSn6xFMUF3"}
 {"title":"Sharq","channel":"Sharq.af","filepath":"tests/__data__/output/streams/af.m3u","url":"http://51.210.199.50/hls/stream.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"cluster_id":1,"status":"online","_id":"u7iyA6cjtf1iWWAZ"}
diff --git a/tests/__data__/input/streams/ad.m3u b/tests/__data__/input/streams/ad.m3u
index 52612ebde..cbefdebac 100644
--- a/tests/__data__/input/streams/ad.m3u
+++ b/tests/__data__/input/streams/ad.m3u
@@ -1,3 +1,5 @@
 #EXTM3U
-#EXTINF:-1 tvg-id="ATV.ad" tvg-country="AD" tvg-language="Catalan" tvg-logo="https://i.imgur.com/kJCjeQ4.png" group-title="General",ATV (720p) [Offline]
+#EXTINF:-1 tvg-id="ATV.ad" tvg-country="AD" tvg-language="Catalan" tvg-logo="https://i.imgur.com/kJCjeQ4.png" group-title="General" user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",ATV (720p) [Offline]
+#EXTVLCOPT:http-referrer=http://imn.iq
+#EXTVLCOPT:http-user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
 https://iptv-all.lanesh4d0w.repl.co/andorra/atv
\ No newline at end of file
diff --git a/tests/commands/playlist/update.test.js b/tests/commands/playlist/update.test.js
index 65cd8d96b..d58374501 100644
--- a/tests/commands/playlist/update.test.js
+++ b/tests/commands/playlist/update.test.js
@@ -17,7 +17,7 @@ beforeEach(() => {
 
 it('can update playlists', () => {
   const files = glob
-    .sync('tests/__data__/expected/channels/*.m3u')
+    .sync('tests/__data__/expected/streams/*.m3u')
     .map(f => f.replace('tests/__data__/expected/', ''))
 
   files.forEach(filepath => {

From 62576d173989f6753a3973e13ffb2369b16a2e29 Mon Sep 17 00:00:00 2001
From: Aleksandr Statciuk <github@oiya.xyz>
Date: Tue, 22 Feb 2022 11:11:06 +0300
Subject: [PATCH 10/10] Update auto-update.yml

---
 .github/workflows/auto-update.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml
index bc39e7bb0..abe5baad2 100644
--- a/.github/workflows/auto-update.yml
+++ b/.github/workflows/auto-update.yml
@@ -132,7 +132,7 @@ jobs:
             This pull request is created by [auto-update][1] workflow.
 
             [1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
-      - uses: JamesIves/github-pages-deploy-action@4.1.1
+      - uses: JamesIves/github-pages-deploy-action@4.2.0
         if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
         with:
           branch: gh-pages
@@ -140,9 +140,9 @@ jobs:
           token: ${{ steps.create-app-token.outputs.token }}
           git-config-name: iptv-bot[bot]
           git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
-          commit-message: '[Bot] Generate playlists'
+          commit-message: '[Bot] Deploy to GitHub Pages'
           clean: false
-      - uses: JamesIves/github-pages-deploy-action@4.1.1
+      - uses: JamesIves/github-pages-deploy-action@4.2.0
         if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
         with:
           repository-name: iptv-org/api