Repository: streamlink/streamlink

Issue:
plugins.goltelevision: error: Unable to open URL (500 Server Error: Internal Server Error for url...)
### Checklist

- [X] This is a plugin issue and not a different kind of issue
- [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

Latest stable release

### Description

Hi,
I´m using the latest version of [appimage ](https://github.com/streamlink/streamlink-appimage/releases)and I can´t get the url info for goltelevision.com

Feel free to ask me anything else to test from my side.
Thanks and best regards

### Debug log

```text
root@NUC:/home/nico/streamlink# ./streamlink --version
streamlink 3.1.1
root@NUC:/home/nico/streamlink# ./streamlink -l debug http://www.goltelevision.com/en-directo
[cli][info] streamlink is running as root! Be careful!
[cli][debug] OS:         Linux-5.13.0-30-generic-x86_64-with-glibc2.31
[cli][debug] Python:     3.10.1
[cli][debug] Streamlink: 3.1.1
[cli][debug] Requests(2.27.1), Socks(1.7.1), Websocket(1.2.3)
[cli][debug] Arguments:
[cli][debug]  url=http://www.goltelevision.com/en-directo
[cli][debug]  --loglevel=debug
[cli][info] Found matching plugin goltelevision for URL http://www.goltelevision.com/en-directo
[utils.l10n][debug] Language code: es_ES
error: Unable to open URL: https://www.goltelevision.com/api/stream/live.m3u8?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdHJlYW0iOiJsaXZlLm0zdTgiLCJpcCI6Ijg4LjAuMTkyLjIwNSIsImV4cGlyZXNJbiI6IjI4ODAwcyIsImlhdCI6MTY0NTkxNDQ1OCwiZXhwIjoxNjQ1OTQzMjU4fQ.5ji7bkZ1nUtAMzD1gZuy04-OZtCYvKfqNTOzxt1_r6Y (500 Server Error: Internal Server Error for url: https://www.goltelevision.com/api/stream/live.m3u8?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdHJlYW0iOiJsaXZlLm0zdTgiLCJpcCI6Ijg4LjAuMTkyLjIwNSIsImV4cGlyZXNJbiI6IjI4ODAwcyIsImlhdCI6MTY0NTkxNDQ1OCwiZXhwIjoxNjQ1OTQzMjU4fQ.5ji7bkZ1nUtAMzD1gZuy04-OZtCYvKfqNTOzxt1_r6Y)
```



Discussion:
The API URL where the HLS stream URL is retrieved from has been changed on their website, but the old one which Streamlink's plugin is using still exists and returns invalid stream URLs which lead to status code 500 server responses when trying to access the stream.

The new API URL is `https://play.goltelevision.com/api/stream/live`:
https://github.com/streamlink/streamlink/blob/3.1.1/src/streamlink/plugins/goltelevision.py

The custom `GOLTelevisionHLSStream` subclass of `HLSStream` can also be removed with the recent version bump of `charset_normalizer`, as it has fixed the encoding detection issues when there's no charset data in the server's content-type response header.

Let me open a PR real quick.

Resolving patch:
diff --git a/src/streamlink/plugins/goltelevision.py b/src/streamlink/plugins/goltelevision.py
--- a/src/streamlink/plugins/goltelevision.py
+++ b/src/streamlink/plugins/goltelevision.py
@@ -5,27 +5,20 @@
 from streamlink.stream.hls import HLSStream
 
 
-class GOLTelevisionHLSStream(HLSStream):
-    @classmethod
-    def _get_variant_playlist(cls, res):
-        res.encoding = "UTF-8"
-        return super()._get_variant_playlist(res)
-
-
 @pluginmatcher(re.compile(
     r"https?://(?:www\.)?goltelevision\.com/en-directo"
 ))
 class GOLTelevision(Plugin):
     def _get_streams(self):
         url = self.session.http.get(
-            "https://www.goltelevision.com/api/manifest/live",
+            "https://play.goltelevision.com/api/stream/live",
             schema=validate.Schema(
                 validate.parse_json(),
                 {"manifest": validate.url()},
                 validate.get("manifest")
             )
         )
-        return GOLTelevisionHLSStream.parse_variant_playlist(self.session, url)
+        return HLSStream.parse_variant_playlist(self.session, url)
 
 
 __plugin__ = GOLTelevision


Test patch: