Repository: streamlink/streamlink

Issue:
plugins.useetv: log if no link has been found
<!--
Thanks for opening a pull request!

Before you continue, please make sure that you have read and understood the contribution guidelines, otherwise your changes may be rejected:
https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink

If possible, run the tests, perform code linting and build the documentation locally on your system first to avoid unnecessary build failures:
https://streamlink.github.io/latest/developing.html#validating-changes

Also don't forget to add a meaningful description of your changes, so that the reviewing process is as simple as possible for the maintainers.

Thank you very much!
-->

**Why this PR ?**

This PR has been made to verify if no link has been found. Indeed, USeeTV doesn't provide all his channels worldwide. Some channels are blocked for Indonesian people only, and some others need a subscription to work (see beIN Asia as an example). Some channels like SeaToday would work, but channels like this one : 
![image](https://user-images.githubusercontent.com/30985701/170096616-4d22b9aa-9972-418e-8bc6-1c99be1c1e88.png)
will only show a Geo-restriction message above the player, telling the end-user he has no access to the stream. 

This also reflects inside the player, meaning no link can be scraped.



Discussion:
Thanks.  You'll also need to add the following if this is going to be merged:
```
log = logging.getLogger(__name__)
```
Add it after the imports with one blank line between and another two blank lines after to pass the linting check.

> Thanks. You'll also need to add the following if this is going to be merged:
> 
> ```
> log = logging.getLogger(__name__)
> ```
> 
> Add it after the imports with one blank line between and another two blank lines after to pass the linting check.

Sure, going to add it.

Resolving patch:
diff --git a/src/streamlink/plugins/useetv.py b/src/streamlink/plugins/useetv.py
--- a/src/streamlink/plugins/useetv.py
+++ b/src/streamlink/plugins/useetv.py
@@ -4,6 +4,7 @@
 $type live, vod
 """
 
+import logging
 import re
 
 from streamlink.plugin import Plugin, pluginmatcher
@@ -11,32 +12,46 @@
 from streamlink.stream.dash import DASHStream
 from streamlink.stream.hls import HLSStream
 
+log = logging.getLogger(__name__)
+
 
 @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)[^'"]+)['"]""")
+    def _get_streams(self):
+        root = self.session.http.get(self.url, schema=validate.Schema(validate.parse_html()))
+
+        for needle, errormsg in (
+            (
+                "This service is not available in your Country",
+                "The content is not available in your region",
+            ),
+            (
+                "Silahkan login Menggunakan akun MyIndihome dan berlangganan minipack",
+                "The content is not available without a subscription",
+            ),
+        ):
+            if validate.Schema(validate.xml_xpath(f""".//script[contains(text(), '"{needle}"')]""")).validate(root):
+                log.error(errormsg)
+                return
 
-        return self.session.http.get(self.url, schema=validate.Schema(
-            validate.parse_html(),
+        url = validate.Schema(
             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.transform(
+                        re.compile(r"""(?P<q>['"])(?P<url>https://.*?/(?:[Pp]laylist\.m3u8|manifest\.mpd).+?)(?P=q)""").search
+                    ),
+                    validate.any(None, validate.all(validate.get("url"), 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()
+            )
+        ).validate(root)
 
         if url and ".m3u8" in url:
             return HLSStream.parse_variant_playlist(self.session, url)


Test patch: