Repository: streamlink/streamlink

Issue:
plugins.ard_live: Unable to parse MEDIAINFO
### 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

On streamlink 3.1.1 Linux:

```
[cli][info] Found matching plugin ard_live for URL https://live.daserste.de/
error: Unable to validate response text: Unable to parse MEDIAINFO: Expecting value: line 1 column 1 (char 0) ('<!DOCTYPE HTML>\n<html lang="de" i ...)
```

Streamlink 2.0.0 Windows works fine. Can't find a working 2.0.0 Linux build to verify.

3.1.1 seems to expect a player url at `https://live.daserste.de/live-de-102~playerJson.json` and 2.0.0 at `https://www.daserste.de/live/live-de-102~playerJson.json`.

Is there a commandline arg to override it?

### Debug log

```text
[cli][debug] OS:         Linux-5.15.2-arch1-1-x86_64-with-glibc2.35
[cli][debug] Python:     3.10.2
[cli][debug] Streamlink: 3.1.1
[cli][debug] Requests(2.27.0), Socks(1.7.1), Websocket(1.2.3)
[cli][debug] Arguments:
[cli][debug]  url=https://live.daserste.de/
[cli][debug]  --loglevel=debug
[cli][info] Found matching plugin ard_live for URL https://live.daserste.de/
[plugins.ard_live][debug] Player URL: 'https://live.daserste.de/live-de-102~playerJson.json'
error: Unable to validate response text: Unable to parse MEDIAINFO: Expecting value: line 1 column 1 (char 0) ('<!DOCTYPE HTML>\n<html lang="de" i ...)
```



Discussion:
https://live.daserste.de/
redirects to
https://www.daserste.de/live/index.html
which is working fine:

```
$ streamlink 'https://www.daserste.de/live/index.html' best -l debug
[cli][debug] OS:         Linux-5.16.10-1-git-x86_64-with-glibc2.35
[cli][debug] Python:     3.10.2
[cli][debug] Streamlink: 3.1.1+8.g3bae9af
[cli][debug] Requests(2.27.1), Socks(1.7.1), Websocket(1.2.3)
[cli][debug] Arguments:
[cli][debug]  url=https://www.daserste.de/live/index.html
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --player=mpv
[cli][info] Found matching plugin ard_live for URL https://www.daserste.de/live/index.html
[plugins.ard_live][debug] Player URL: 'https://www.daserste.de/live/live-de-102~playerJson.json'
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: 270p (worst), 360p, 540p, 720p, 1080p (best)
[cli][info] Opening stream: 1080p (hls)
```

The problem here is that the `data_url` is relative to the input URL, and the URL is invalid when using the `live.daserste.de` input.
https://github.com/streamlink/streamlink/blob/3.1.1/src/streamlink/plugins/ard_live.py#L39

Resolving patch:
diff --git a/src/streamlink/plugins/ard_live.py b/src/streamlink/plugins/ard_live.py
--- a/src/streamlink/plugins/ard_live.py
+++ b/src/streamlink/plugins/ard_live.py
@@ -14,6 +14,7 @@
     r"https?://((www|live)\.)?daserste\.de/"
 ))
 class ARDLive(Plugin):
+    _URL_DATA_BASE = "https://www.daserste.de/"
     _QUALITY_MAP = {
         4: "1080p",
         3: "720p",
@@ -36,7 +37,7 @@ def _get_streams(self):
         except PluginError:
             return
 
-        data_url = urljoin(self.url, data_url)
+        data_url = urljoin(self._URL_DATA_BASE, data_url)
         log.debug(f"Player URL: '{data_url}'")
 
         self.title, media = self.session.http.get(data_url, schema=validate.Schema(


Test patch: