Repository: streamlink/streamlink

Issue:
fix plugin tvtoya.py
<!--
Thanks for reporting a plugin issue!
USE THE TEMPLATE. Otherwise your plugin issue may be rejected.

First, see the contribution guidelines:
https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink

Also check the list of open and closed plugin issues:
https://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22plugin+issue%22

Please see the text preview to avoid unnecessary formatting errors.
-->


## Plugin Issue

<!-- Replace the space character between the square brackets with an x in order to check the boxes -->
- [ ] This is a plugin issue and I have read the contribution guidelines.
- [ ] I am using the latest development version from the master branch.


### Description

<!-- Explain the plugin issue as thoroughly as you can. -->

fix plugin tvtoya http://tvtoya.pl/live
streamlinksrv error No playable streams found on this URL: http://tvtoya.pl/live

### Reproduction steps / Explicit stream URLs to test

<!-- How can we reproduce this? Please note the exact steps below using the list format supplied. If you need more steps please add them. -->

1. ...
2. ...
3. ...


### Log output

<!--
TEXT LOG OUTPUT IS REQUIRED for a plugin issue!
Use the `--loglevel debug` parameter and avoid using parameters which suppress log output.
https://streamlink.github.io/cli.html#cmdoption-l

Make sure to **remove usernames and passwords**
You can copy the output to https://gist.github.com/ or paste it below.

Don't post screenshots of the log output and instead copy the text from your terminal application.
-->

```
REPLACE THIS TEXT WITH THE LOG OUTPUT
```


### Additional comments, etc.



[Love Streamlink? Please consider supporting our collective. Thanks!](https://opencollective.com/streamlink/donate)



Discussion:
**Feedback/answer (see ticked items):**

* As requested in the issue template:
* - [x] Does not meet requirements for issue or feature/plugin request [[1]] [[2]] [[3]]
* - [x] Description and/or reproduction steps are insufficiently detailed
* - [x] Streamlink version in use not specified
* - [x] Full ```--loglevel debug``` log output not provided
* - [ ] Research of prior issues/fixes appears to be insufficient [[4]]
* Other feedback:
* - [ ] Issue is out of scope and/or should be reported/help sought elsewhere
* - [ ] Issue appears to unnecessarily duplicate another issue that is open/closed
* - [ ] User appears to be using an outdated Streamlink version/plugin [[5]] [[6]]
* - [ ] Use of discussions more appropriate (admin can/will convert to discussion) [[7]]
* - [ ] Other (see below)
* Other: N/A

Please amend/close your issue accordingly and/or undertake the requested prior research before opening an issue in future.

[[1]] [Reporting issues][1]
[[2]] [Feature requests][2]
[[3]] [Plugin requests][3]
[[4]] [Search all open/closed issues/pull requests][4]
[[5]] [Install the most recent version of Streamlink][5]
[[6]] [Check the master branch for plugin updates][6]
[[7]] [Streamlink discussions][7]

[1]: https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#reporting-issues
[2]: https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#feature-requests
[3]: https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#plugin-requests
[4]: https://github.com/streamlink/streamlink/issues?q=
[5]: https://streamlink.github.io/install.html
[6]: https://github.com/streamlink/streamlink/tree/master/src/streamlink/plugins
[7]: https://github.com/streamlink/streamlink/discussions

Resolving patch:
diff --git a/src/streamlink/plugins/tvtoya.py b/src/streamlink/plugins/tvtoya.py
--- a/src/streamlink/plugins/tvtoya.py
+++ b/src/streamlink/plugins/tvtoya.py
@@ -2,7 +2,6 @@
 import re
 
 from streamlink.plugin import Plugin
-from streamlink.plugin.api import useragents
 from streamlink.stream import HLSStream
 from streamlink.utils import update_scheme
 
@@ -11,7 +10,7 @@
 
 class TVToya(Plugin):
     _url_re = re.compile(r"https?://tvtoya.pl/live")
-    _playlist_re = re.compile(r'data-stream="([^"]+)"')
+    _playlist_re = re.compile(r'<source src="([^"]+)" type="application/x-mpegURL">')
 
     @classmethod
     def can_handle_url(cls, url):
@@ -26,7 +25,6 @@ def _get_streams(self):
             return HLSStream.parse_variant_playlist(
                 self.session,
                 update_scheme(self.url, playlist_m.group(1)),
-                headers={'Referer': self.url, 'User-Agent': useragents.ANDROID}
             )
         else:
             log.debug("Could not find stream data")


Test patch: