Repository: streamlink/streamlink

Issue:
https://www.useetv.com/
### Checklist

- [X] This is a plugin request 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 requests](https://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22plugin+request%22)

### Description

LIVETV OFFCIAL BY INDONESIA , GOT ALOT OF ENGLISH CHANNELS

### Input URLs

https://www.useetv.com/livetv/seatoday
https://cdn09jtedge.useetv.com/joss/133/seatoday/chunklist_w1268139421_b844100_sleng.m3u8?enc=9Q3OzUmDj1HhXf-juvVnLA&uid=&exp=1649876868


Discussion:
I don't know if this is worth writing a plugin for or not - the playlist URLs seem to be embedded in the JS of the page HTML and can easily be extracted by searching for `m3u8` and then played with the link copied out:
```
$ streamlink --http-no-ssl-verify 'https://streaming.useetv.com/joss/133/seatoday/playlist.m3u8?enc=x0KVJdJswyEo8fAVod3x1w&exp=1651028204&encp=__UhcXzshmaYYIPFuJ0KVw&expp=1651036904' 540p
[cli][info] Found matching plugin hls for URL https://streaming.useetv.com/joss/133/seatoday/playlist.m3u8?enc=x0KVJdJswyEo8fAVod3x1w&exp=1651028204&encp=__UhcXzshmaYYIPFuJ0KVw&expp=1651036904
[cli][info] Available streams: 270p (worst), 360p, 540p, 720p, 1080p (best)
[cli][info] Opening stream: 540p (hls)
[cli][info] Starting player: mpv
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...
```


Resolving patch:
diff --git a/src/streamlink/plugins/useetv.py b/src/streamlink/plugins/useetv.py
new file mode 100644
--- /dev/null
+++ b/src/streamlink/plugins/useetv.py
@@ -0,0 +1,47 @@
+"""
+$description Live TV channels and video on-demand service from UseeTV, owned by Telkom Indonesia.
+$url useetv.com
+$type live, vod
+"""
+
+import re
+
+from streamlink.plugin import Plugin, pluginmatcher
+from streamlink.plugin.api import validate
+from streamlink.stream.dash import DASHStream
+from streamlink.stream.hls import HLSStream
+
+
+@pluginmatcher(re.compile(r"https?://(?:www\.)?useetv\.com/"))
+class UseeTV(Plugin):
+    def find_url(self):
+        url_re = re.compile(r"""['"](https://.*?/(?:[Pp]laylist\.m3u8|manifest\.mpd)[^'"]+)['"]""")
+
+        return self.session.http.get(self.url, schema=validate.Schema(
+            validate.parse_html(),
+            validate.any(
+                validate.all(
+                    validate.xml_xpath_string("""
+                        .//script[contains(text(), 'laylist.m3u8') or contains(text(), 'manifest.mpd')][1]/text()
+                    """),
+                    str,
+                    validate.transform(url_re.search),
+                    validate.any(None, validate.all(validate.get(1), validate.url())),
+                ),
+                validate.all(
+                    validate.xml_xpath_string(".//video[@id='video-player']/source/@src"),
+                    validate.any(None, validate.url()),
+                ),
+            ),
+        ))
+
+    def _get_streams(self):
+        url = self.find_url()
+
+        if url and ".m3u8" in url:
+            return HLSStream.parse_variant_playlist(self.session, url)
+        elif url and ".mpd" in url:
+            return DASHStream.parse_manifest(self.session, url)
+
+
+__plugin__ = UseeTV


Test patch:
diff --git a/tests/plugins/test_useetv.py b/tests/plugins/test_useetv.py
new file mode 100644
--- /dev/null
+++ b/tests/plugins/test_useetv.py
@@ -0,0 +1,17 @@
+from streamlink.plugins.useetv import UseeTV
+from tests.plugins import PluginCanHandleUrl
+
+
+class TestPluginCanHandleUrlUseeTV(PluginCanHandleUrl):
+    __plugin__ = UseeTV
+
+    should_match = [
+        "http://useetv.com/any",
+        "http://useetv.com/any/path",
+        "http://www.useetv.com/any",
+        "http://www.useetv.com/any/path",
+        "https://useetv.com/any",
+        "https://useetv.com/any/path",
+        "https://www.useetv.com/any",
+        "https://www.useetv.com/any/path",
+    ]