prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  plugins.atresplayer: Error -3 while decompressing data: incorrect header check
  ### Checklist
  
  - [X] This is a [plugin issue](https://streamlink.github.io/plugins.html) and not [a different kind of issue](https://github.com/streamlink/streamlink/issues/new/choose)
  - [X] [I have read the contribution guidelines](https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink)
  - [X] [I have checked the list of open and recently closed plugin issues](https://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22plugin+issue%22)
  - [X] [I have checked the commit log of the master branch](https://github.com/streamlink/streamlink/commits/master)
  
  ### Streamlink version
  
  streamlink 6.4.2
  
  ### Description
  
  Possible change in link decoding.
  
  ### Debug log
  
  ```text
  [cli][debug] OS:         Windows 10
  [cli][debug] Python:     3.11.6
  [cli][debug] OpenSSL:    OpenSSL 3.0.11 19 Sep 2023
  [cli][debug] Streamlink: 6.4.2
  [cli][debug] Dependencies:
  [cli][debug]  certifi: 2023.11.17
  [cli][debug]  isodate: 0.6.1
  [cli][debug]  lxml: 4.9.3
  [cli][debug]  pycountry: 22.3.5
  [cli][debug]  pycryptodome: 3.19.0
  [cli][debug]  PySocks: 1.7.1
  [cli][debug]  requests: 2.31.0
  [cli][debug]  trio: 0.23.1
  [cli][debug]  trio-websocket: 0.11.1
  [cli][debug]  typing-extensions: 4.8.0
  [cli][debug]  urllib3: 2.1.0
  [cli][debug]  websocket-client: 1.6.4
  [cli][debug] Arguments:
  [cli][debug]  url=https://www.atresplayer.com/directos/antena3/
  [cli][debug]  stream=['best']
  [cli][debug]  --loglevel=debug
  [cli][debug]  --ffmpeg-ffmpeg=C:\Program Files\Streamlink\ffmpeg\ffmpeg.exe
  [cli][info] Found matching plugin atresplayer for URL https://www.atresplayer.com/directos/antena3/
  [plugins.atresplayer][debug] Player API URL: https://api.atresplayer.com/player/v1/live/5a6a165a7ed1a834493ebf6a
  [plugins.atresplayer][debug] Stream source: https://directo.atresmedia.com/49aa0979c14a4113668984aa8f6f7a43dd3a624a_1701338572/antena3/master.m3u8 (application/vnd.apple.mpegurl)
  [utils.l10n][debug] Language code: es_ES
  error: Unable to open URL: https://directo.atresmedia.com/49aa0979c14a4113668984aa8f6f7a43dd3a624a_1701338572/antena3/master.m3u8 (('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check')))
  ```
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/streamlink/plugins/atresplayer.py`
  Content:
  ```
  1 """
  2 $description Spanish live TV channels from Atresmedia Television, including Antena 3 and laSexta.
  3 $url atresplayer.com
  4 $type live
  5 $region Spain
  6 """
  7 
  8 import logging
  9 import re
  10 
  11 from streamlink.plugin import Plugin, pluginmatcher
  12 from streamlink.plugin.api import validate
  13 from streamlink.stream.dash import DASHStream
  14 from streamlink.stream.hls import HLSStream
  15 from streamlink.utils.url import update_scheme
  16 
  17 
  18 log = logging.getLogger(__name__)
  19 
  20 
  21 @pluginmatcher(re.compile(
  22     r"https?://(?:www\.)?atresplayer\.com/directos/.+",
  23 ))
  24 class AtresPlayer(Plugin):
  25     _channels_api_url = "https://api.atresplayer.com/client/v1/info/channels"
  26     _player_api_url = "https://api.atresplayer.com/player/v1/live/{channel_id}"
  27 
  28     def __init__(self, *args, **kwargs):
  29         super().__init__(*args, **kwargs)
  30         self.url = update_scheme("https://", f"{self.url.rstrip('/')}/")
  31 
  32     def _get_streams(self):
  33         channel_path = f"/{self.url.split('/')[-2]}/"
  34         channel_data = self.session.http.get(self._channels_api_url, schema=validate.Schema(
  35             validate.parse_json(),
  36             [{
  37                 "id": str,
  38                 "link": {"url": str},
  39             }],
  40             validate.filter(lambda item: item["link"]["url"] == channel_path),
  41         ))
  42         if not channel_data:
  43             return
  44         channel_id = channel_data[0]["id"]
  45 
  46         player_api_url = self._player_api_url.format(channel_id=channel_id)
  47         log.debug(f"Player API URL: {player_api_url}")
  48 
  49         sources = self.session.http.get(player_api_url, acceptable_status=(200, 403), schema=validate.Schema(
  50             validate.parse_json(),
  51             validate.any(
  52                 {
  53                     "error": str,
  54                     "error_description": str,
  55                 },
  56                 {
  57                     "sources": [
  58                         validate.all(
  59                             {
  60                                 "src": validate.url(),
  61                                 validate.optional("type"): str,
  62                             },
  63                             validate.union_get("type", "src"),
  64                         ),
  65                     ],
  66                 },
  67             ),
  68         ))
  69         if "error" in sources:
  70             log.error(f"Player API error: {sources['error']} - {sources['error_description']}")
  71             return
  72 
  73         for streamtype, streamsrc in sources.get("sources"):
  74             log.debug(f"Stream source: {streamsrc} ({streamtype or 'n/a'})")
  75 
  76             if streamtype == "application/vnd.apple.mpegurl":
  77                 streams = HLSStream.parse_variant_playlist(self.session, streamsrc)
  78                 if not streams:
  79                     yield "live", HLSStream(self.session, streamsrc)
  80                 else:
  81                     yield from streams.items()
  82             elif streamtype == "application/dash+xml":
  83                 yield from DASHStream.parse_manifest(self.session, streamsrc).items()
  84 
  85 
  86 __plugin__ = AtresPlayer
  87
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/src/streamlink/plugins/atresplayer.py b/src/streamlink/plugins/atresplayer.py
  --- a/src/streamlink/plugins/atresplayer.py
  +++ b/src/streamlink/plugins/atresplayer.py
  @@ -23,7 +23,7 @@
   ))
   class AtresPlayer(Plugin):
       _channels_api_url = "https://api.atresplayer.com/client/v1/info/channels"
  -    _player_api_url = "https://api.atresplayer.com/player/v1/live/{channel_id}"
  +    _player_api_url = "https://api.atresplayer.com/player/v1/live/{channel_id}?NODRM=true"
   
       def __init__(self, *args, **kwargs):
           super().__init__(*args, **kwargs)
  @@ -54,7 +54,7 @@
                       "error_description": str,
                   },
                   {
  -                    "sources": [
  +                    "sourcesLive": [
                           validate.all(
                               {
                                   "src": validate.url(),
  @@ -70,7 +70,7 @@
               log.error(f"Player API error: {sources['error']} - {sources['error_description']}")
               return
   
  -        for streamtype, streamsrc in sources.get("sources"):
  +        for streamtype, streamsrc in sources.get("sourcesLive"):
               log.debug(f"Stream source: {streamsrc} ({streamtype or 'n/a'})")
   
               if streamtype == "application/vnd.apple.mpegurl":
  
verification_info: {"golden_diff": "diff --git a/src/streamlink/plugins/atresplayer.py b/src/streamlink/plugins/atresplayer.py\n--- a/src/streamlink/plugins/atresplayer.py\n+++ b/src/streamlink/plugins/atresplayer.py\n@@ -23,7 +23,7 @@\n ))\n class AtresPlayer(Plugin):\n     _channels_api_url = \"https://api.atresplayer.com/client/v1/info/channels\"\n-    _player_api_url = \"https://api.atresplayer.com/player/v1/live/{channel_id}\"\n+    _player_api_url = \"https://api.atresplayer.com/player/v1/live/{channel_id}?NODRM=true\"\n \n     def __init__(self, *args, **kwargs):\n         super().__init__(*args, **kwargs)\n@@ -54,7 +54,7 @@\n                     \"error_description\": str,\n                 },\n                 {\n-                    \"sources\": [\n+                    \"sourcesLive\": [\n                         validate.all(\n                             {\n                                 \"src\": validate.url(),\n@@ -70,7 +70,7 @@\n             log.error(f\"Player API error: {sources['error']} - {sources['error_description']}\")\n             return\n \n-        for streamtype, streamsrc in sources.get(\"sources\"):\n+        for streamtype, streamsrc in sources.get(\"sourcesLive\"):\n             log.debug(f\"Stream source: {streamsrc} ({streamtype or 'n/a'})\")\n \n             if streamtype == \"application/vnd.apple.mpegurl\":\n", "issue": "plugins.atresplayer: Error -3 while decompressing data: incorrect header check\n### Checklist\n\n- [X] This is a [plugin issue](https://streamlink.github.io/plugins.html) and not [a different kind of issue](https://github.com/streamlink/streamlink/issues/new/choose)\n- [X] [I have read the contribution guidelines](https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink)\n- [X] [I have checked the list of open and recently closed plugin issues](https://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22plugin+issue%22)\n- [X] [I have checked the commit log of the master branch](https://github.com/streamlink/streamlink/commits/master)\n\n### Streamlink version\n\nstreamlink 6.4.2\n\n### Description\n\nPossible change in link decoding.\n\n### Debug log\n\n```text\n[cli][debug] OS:         Windows 10\r\n[cli][debug] Python:     3.11.6\r\n[cli][debug] OpenSSL:    OpenSSL 3.0.11 19 Sep 2023\r\n[cli][debug] Streamlink: 6.4.2\r\n[cli][debug] Dependencies:\r\n[cli][debug]  certifi: 2023.11.17\r\n[cli][debug]  isodate: 0.6.1\r\n[cli][debug]  lxml: 4.9.3\r\n[cli][debug]  pycountry: 22.3.5\r\n[cli][debug]  pycryptodome: 3.19.0\r\n[cli][debug]  PySocks: 1.7.1\r\n[cli][debug]  requests: 2.31.0\r\n[cli][debug]  trio: 0.23.1\r\n[cli][debug]  trio-websocket: 0.11.1\r\n[cli][debug]  typing-extensions: 4.8.0\r\n[cli][debug]  urllib3: 2.1.0\r\n[cli][debug]  websocket-client: 1.6.4\r\n[cli][debug] Arguments:\r\n[cli][debug]  url=https://www.atresplayer.com/directos/antena3/\r\n[cli][debug]  stream=['best']\r\n[cli][debug]  --loglevel=debug\r\n[cli][debug]  --ffmpeg-ffmpeg=C:\\Program Files\\Streamlink\\ffmpeg\\ffmpeg.exe\r\n[cli][info] Found matching plugin atresplayer for URL https://www.atresplayer.com/directos/antena3/\r\n[plugins.atresplayer][debug] Player API URL: https://api.atresplayer.com/player/v1/live/5a6a165a7ed1a834493ebf6a\r\n[plugins.atresplayer][debug] Stream source: https://directo.atresmedia.com/49aa0979c14a4113668984aa8f6f7a43dd3a624a_1701338572/antena3/master.m3u8 (application/vnd.apple.mpegurl)\r\n[utils.l10n][debug] Language code: es_ES\r\nerror: Unable to open URL: https://directo.atresmedia.com/49aa0979c14a4113668984aa8f6f7a43dd3a624a_1701338572/antena3/master.m3u8 (('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check')))\n```\n\n", "before_files": [{"content": "\"\"\"\n$description Spanish live TV channels from Atresmedia Television, including Antena 3 and laSexta.\n$url atresplayer.com\n$type live\n$region Spain\n\"\"\"\n\nimport logging\nimport re\n\nfrom streamlink.plugin import Plugin, pluginmatcher\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream.dash import DASHStream\nfrom streamlink.stream.hls import HLSStream\nfrom streamlink.utils.url import update_scheme\n\n\nlog = logging.getLogger(__name__)\n\n\n@pluginmatcher(re.compile(\n    r\"https?://(?:www\\.)?atresplayer\\.com/directos/.+\",\n))\nclass AtresPlayer(Plugin):\n    _channels_api_url = \"https://api.atresplayer.com/client/v1/info/channels\"\n    _player_api_url = \"https://api.atresplayer.com/player/v1/live/{channel_id}\"\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.url = update_scheme(\"https://\", f\"{self.url.rstrip('/')}/\")\n\n    def _get_streams(self):\n        channel_path = f\"/{self.url.split('/')[-2]}/\"\n        channel_data = self.session.http.get(self._channels_api_url, schema=validate.Schema(\n            validate.parse_json(),\n            [{\n                \"id\": str,\n                \"link\": {\"url\": str},\n            }],\n            validate.filter(lambda item: item[\"link\"][\"url\"] == channel_path),\n        ))\n        if not channel_data:\n            return\n        channel_id = channel_data[0][\"id\"]\n\n        player_api_url = self._player_api_url.format(channel_id=channel_id)\n        log.debug(f\"Player API URL: {player_api_url}\")\n\n        sources = self.session.http.get(player_api_url, acceptable_status=(200, 403), schema=validate.Schema(\n            validate.parse_json(),\n            validate.any(\n                {\n                    \"error\": str,\n                    \"error_description\": str,\n                },\n                {\n                    \"sources\": [\n                        validate.all(\n                            {\n                                \"src\": validate.url(),\n                                validate.optional(\"type\"): str,\n                            },\n                            validate.union_get(\"type\", \"src\"),\n                        ),\n                    ],\n                },\n            ),\n        ))\n        if \"error\" in sources:\n            log.error(f\"Player API error: {sources['error']} - {sources['error_description']}\")\n            return\n\n        for streamtype, streamsrc in sources.get(\"sources\"):\n            log.debug(f\"Stream source: {streamsrc} ({streamtype or 'n/a'})\")\n\n            if streamtype == \"application/vnd.apple.mpegurl\":\n                streams = HLSStream.parse_variant_playlist(self.session, streamsrc)\n                if not streams:\n                    yield \"live\", HLSStream(self.session, streamsrc)\n                else:\n                    yield from streams.items()\n            elif streamtype == \"application/dash+xml\":\n                yield from DASHStream.parse_manifest(self.session, streamsrc).items()\n\n\n__plugin__ = AtresPlayer\n", "path": "src/streamlink/plugins/atresplayer.py"}], "after_files": [{"content": "\"\"\"\n$description Spanish live TV channels from Atresmedia Television, including Antena 3 and laSexta.\n$url atresplayer.com\n$type live\n$region Spain\n\"\"\"\n\nimport logging\nimport re\n\nfrom streamlink.plugin import Plugin, pluginmatcher\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream.dash import DASHStream\nfrom streamlink.stream.hls import HLSStream\nfrom streamlink.utils.url import update_scheme\n\n\nlog = logging.getLogger(__name__)\n\n\n@pluginmatcher(re.compile(\n    r\"https?://(?:www\\.)?atresplayer\\.com/directos/.+\",\n))\nclass AtresPlayer(Plugin):\n    _channels_api_url = \"https://api.atresplayer.com/client/v1/info/channels\"\n    _player_api_url = \"https://api.atresplayer.com/player/v1/live/{channel_id}?NODRM=true\"\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.url = update_scheme(\"https://\", f\"{self.url.rstrip('/')}/\")\n\n    def _get_streams(self):\n        channel_path = f\"/{self.url.split('/')[-2]}/\"\n        channel_data = self.session.http.get(self._channels_api_url, schema=validate.Schema(\n            validate.parse_json(),\n            [{\n                \"id\": str,\n                \"link\": {\"url\": str},\n            }],\n            validate.filter(lambda item: item[\"link\"][\"url\"] == channel_path),\n        ))\n        if not channel_data:\n            return\n        channel_id = channel_data[0][\"id\"]\n\n        player_api_url = self._player_api_url.format(channel_id=channel_id)\n        log.debug(f\"Player API URL: {player_api_url}\")\n\n        sources = self.session.http.get(player_api_url, acceptable_status=(200, 403), schema=validate.Schema(\n            validate.parse_json(),\n            validate.any(\n                {\n                    \"error\": str,\n                    \"error_description\": str,\n                },\n                {\n                    \"sourcesLive\": [\n                        validate.all(\n                            {\n                                \"src\": validate.url(),\n                                validate.optional(\"type\"): str,\n                            },\n                            validate.union_get(\"type\", \"src\"),\n                        ),\n                    ],\n                },\n            ),\n        ))\n        if \"error\" in sources:\n            log.error(f\"Player API error: {sources['error']} - {sources['error_description']}\")\n            return\n\n        for streamtype, streamsrc in sources.get(\"sourcesLive\"):\n            log.debug(f\"Stream source: {streamsrc} ({streamtype or 'n/a'})\")\n\n            if streamtype == \"application/vnd.apple.mpegurl\":\n                streams = HLSStream.parse_variant_playlist(self.session, streamsrc)\n                if not streams:\n                    yield \"live\", HLSStream(self.session, streamsrc)\n                else:\n                    yield from streams.items()\n            elif streamtype == \"application/dash+xml\":\n                yield from DASHStream.parse_manifest(self.session, streamsrc).items()\n\n\n__plugin__ = AtresPlayer\n", "path": "src/streamlink/plugins/atresplayer.py"}]}