Repository: streamlink/streamlink

Issue:
plugins.vidio: 403 Client Error on stream token acquirement
### 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

Unable to open URL: https://www.vidio.com/live/204/tokens (403 Client Error: Forbidden for url: https://www.vidio.com/live/204/tokens?type=hls)

### Description

The live stream:  https://www.vidio.com/live/204-sctv
the output: https://www.vidio.com/live/204/tokens (403 Client Error: Forbidden for url: https://www.vidio.com/live/204/tokens?type=hls)

It is missing sctv

### Debug log

```text
streamlink https://www.vidio.com/live/204-sctv best
[cli][info] Found matching plugin vidio for URL https://www.vidio.com/live/204-sctv
error: Unable to open URL: https://www.vidio.com/live/204/tokens (403 Client Error: Forbidden for url: https://www.vidio.com/live/204/tokens?type=hls)
```


Discussion:

Patch:
diff --git a/src/streamlink/plugins/vidio.py b/src/streamlink/plugins/vidio.py
index 50b05a46..11b8ced6 100644
--- a/src/streamlink/plugins/vidio.py
+++ b/src/streamlink/plugins/vidio.py
@@ -6,6 +6,7 @@ $type live, vod
 import logging
 import re
 from urllib.parse import urlsplit, urlunsplit
+from uuid import uuid4
 
 from streamlink.plugin import Plugin, pluginmatcher
 from streamlink.plugin.api import validate
@@ -17,7 +18,7 @@ log = logging.getLogger(__name__)
 
 
 @pluginmatcher(re.compile(
-    r"https?://(?:www\.)?vidio\.com/",
+    r"https?://(?:www\.)?vidio\.com/.+",
 ))
 class Vidio(Plugin):
     tokens_url = "https://www.vidio.com/live/{id}/tokens"
@@ -28,6 +29,10 @@ class Vidio(Plugin):
             self.tokens_url.format(id=stream_id),
             params={"type": stream_type},
             headers={"Referer": self.url},
+            cookies={
+                "ahoy_visit": str(uuid4()),
+                "ahoy_visitor": str(uuid4()),
+            },
             schema=validate.Schema(
                 validate.parse_json(),
                 {"token": str},


Test patch:
diff --git a/tests/plugins/test_vidio.py b/tests/plugins/test_vidio.py
index 970dd455..4fdf269c 100644
--- a/tests/plugins/test_vidio.py
+++ b/tests/plugins/test_vidio.py
@@ -12,6 +12,5 @@ class TestPluginCanHandleUrlVidio(PluginCanHandleUrl):
     ]
 
     should_not_match = [
-        "http://www.vidio.com",
-        "https://www.vidio.com",
+        "https://www.vidio.com/",
     ]