Repository: streamlink/streamlink

Issue:
plugins.euronews: www.euronews.com and ru.euronews.com provide different APIs
### 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

The main Euronews site has started using the new API some time ago, and the current streamlink's plugin, euronews.py, indeed works correctly with the main site. However, some (?) language specific subdomains, like https://ru.euronews.com/, still use the old API (compare, e.g., the following responses: https://www.euronews.com/api/watchlive.json vs. https://ru.euronews.com/api/watchlive.json).

[This previous version of euronews.py](https://github.com/streamlink/streamlink/blob/fcda5b681422718cc0a95b3de45d3fe2698d8e29/src/streamlink/plugins/euronews.py) works fine with the old API but obviously doesn't support the new one. Would be great if the plugin could support both versions.

### Debug log

```text
[cli][info] Found matching plugin euronews for URL https://ru.euronews.com/live
error: No playable streams found on this URL: https://ru.euronews.com/live
```



Discussion:

Resolving patch:
diff --git a/src/streamlink/plugins/euronews.py b/src/streamlink/plugins/euronews.py
--- a/src/streamlink/plugins/euronews.py
+++ b/src/streamlink/plugins/euronews.py
@@ -3,14 +3,17 @@
 
 from streamlink.plugin import Plugin, pluginmatcher
 from streamlink.plugin.api import validate
-from streamlink.plugin.api.utils import itertags
-from streamlink.stream import HTTPStream
+from streamlink.plugin.api.utils import itertags, parse_json
+from streamlink.stream import HLSStream, HTTPStream
+from streamlink.utils import update_scheme
 
 
 @pluginmatcher(re.compile(
-    r'https?://(?:\w+\.)*euronews\.com/'
+    r'https?://(?:(?P<subdomain>\w+)\.)?euronews\.com/'
 ))
 class Euronews(Plugin):
+    API_URL = "https://{subdomain}.euronews.com/api/watchlive.json"
+
     def _get_vod_stream(self):
         def find_video_url(content):
             for elem in itertags(content, "meta"):
@@ -39,6 +42,24 @@ def find_video_id(content):
         if video_id is not None:
             return self.session.streams(f"https://www.youtube.com/watch?v={video_id}")
 
+        info_url = self.session.http.get(self.API_URL.format(subdomain=self.match.group("subdomain")), schema=validate.Schema(
+            validate.transform(parse_json),
+            {"url": validate.url()},
+            validate.get("url"),
+            validate.transform(lambda url: update_scheme("https://", url))
+        ))
+        hls_url = self.session.http.get(info_url, schema=validate.Schema(
+            validate.transform(parse_json),
+            {
+                "status": "ok",
+                "protocol": "hls",
+                "primary": validate.url()
+            },
+            validate.get("primary")
+        ))
+
+        return HLSStream.parse_variant_playlist(self.session, hls_url)
+
     def _get_streams(self):
         parsed = urlparse(self.url)
 


Test patch: