Repository: streamlink/streamlink

Issue:
plugins.ustreamtv: [plugin.api.websocket][error] EOF occurred in violation of protocol (_ssl.c:1129)
### Checklist

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

Installed the latest stable build on Windows 11 and the command fails every time with 

> **[plugin.api.websocket][error] [Errno 2] No such file or directory**

this command line 
`streamlink --loglevel debug https://video.ibm.com/nasahdtv`

See the debug info for the result.  Note - although the debug log says I am running windows 10 - it is most definitely windows 11 (via winver). This is a new laptop (DELL) that came pre-installed with Windows 11

I didn't see any reference to this issue - but perhaps I have missed something.  

Thanks for any tips.  


### Debug log

```text
C:\Users\liamk>streamlink --loglevel debug https://video.ibm.com/nasahdtv
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.9.8
[cli][debug] Streamlink: 3.0.3
[cli][debug] Requests(2.26.0), Socks(1.7.1), Websocket(1.2.1)
[cli][debug] Arguments:
[cli][debug]  url=https://video.ibm.com/nasahdtv
[cli][debug]  --loglevel=debug
[cli][debug]  --ffmpeg-ffmpeg=C:\Program Files (x86)\Streamlink\ffmpeg\ffmpeg.exe
[cli][info] Found matching plugin ustreamtv for URL https://video.ibm.com/nasahdtv
[plugins.ustreamtv][debug] Connecting to UStream API: media_id=6540154, application=channel, referrer=https://video.ibm.com/nasahdtv, cluster=live
[plugin.api.websocket][debug] Connecting to: wss://r2935561-1-6540154-channel-ws-live.ums.ustream.tv:1935/1/ustream
[plugins.ustreamtv][debug] Waiting for stream data (for at most 15 seconds)...
[plugin.api.websocket][error] [Errno 2] No such file or directory
[plugin.api.websocket][debug] Closed: wss://r2935561-1-6540154-channel-ws-live.ums.ustream.tv:1935/1/ustream
[plugins.ustreamtv][error] Waiting for stream data timed out.
error: No playable streams found on this URL: https://video.ibm.com/nasahdtv
```



Discussion:
```
$ streamlink -l debug 'https://video.ibm.com/nasahdtv' best
[cli][debug] OS:         Linux-5.15.5-2-git-x86_64-with-glibc2.33
[cli][debug] Python:     3.9.9
[cli][debug] Streamlink: 3.0.3+4.gdd63e63
[cli][debug] Requests(2.26.0), Socks(1.7.1), Websocket(1.2.1)
[cli][debug] Arguments:
[cli][debug]  url=https://video.ibm.com/nasahdtv
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --player=mpv
[cli][info] Found matching plugin ustreamtv for URL https://video.ibm.com/nasahdtv
[plugins.ustreamtv][debug] Connecting to UStream API: media_id=6540154, application=channel, referrer=https://video.ibm.com/nasahdtv, cluster=live
[plugin.api.websocket][debug] Connecting to: wss://r2727247-1-6540154-channel-ws-live.ums.ustream.tv:1935/1/ustream
[plugins.ustreamtv][debug] Waiting for stream data (for at most 15 seconds)...
[plugin.api.websocket][error] EOF occurred in violation of protocol (_ssl.c:1129)
[plugin.api.websocket][debug] Closed: wss://r2727247-1-6540154-channel-ws-live.ums.ustream.tv:1935/1/ustream
[plugins.ustreamtv][error] Waiting for stream data timed out.
error: No playable streams found on this URL: https://video.ibm.com/nasahdtv
```

> [plugin.api.websocket][error] EOF occurred in violation of protocol (_ssl.c:1129)

Not sure yet what this is about...
By the way, I'm running streamlink version 2.2.0 on a windows 10 box - and that is working just fine.  
> [plugin.api.websocket][error] EOF occurred in violation of protocol (_ssl.c:1129)

`API_URL = "wss://r{0}-1-{1}-{2}-ws-{3}.ums.services.video.ibm.com/1/ustream"`

would fix this for Linux, can't test it on Win10 right now. 

> By the way, I'm running streamlink version 2.2.0 on a windows 10 box - and that is working just fine.

because it is just `ws://`, it would also work on Linux

`API_URL = "ws://r{0}-1-{1}-{2}-ws-{3}.ums.ustream.tv:1935/1/ustream"`

https://github.com/streamlink/streamlink/blob/2.2.0/src/streamlink/plugins/ustreamtv.py#L39
> > [plugin.api.websocket][error] EOF occurred in violation of protocol (_ssl.c:1129)
> 
> `API_URL = "wss://r{0}-1-{1}-{2}-ws-{3}.ums.services.video.ibm.com/1/ustream"`
> 
> would fix this for Linux, can't test it on Win10 right now.
> 
Thank you, it fixes the problem on macOS 11.6.1, Streamlink: 3.0.3.



Resolving patch:
diff --git a/src/streamlink/plugins/ustreamtv.py b/src/streamlink/plugins/ustreamtv.py
--- a/src/streamlink/plugins/ustreamtv.py
+++ b/src/streamlink/plugins/ustreamtv.py
@@ -57,7 +57,7 @@ def url(self, base: str, template: str) -> str:
 
 
 class UStreamTVWsClient(WebsocketClient):
-    API_URL = "wss://r{0}-1-{1}-{2}-ws-{3}.ums.ustream.tv:1935/1/ustream"
+    API_URL = "wss://r{0}-1-{1}-{2}-ws-{3}.ums.services.video.ibm.com/1/ustream"
     APP_ID = 3
     APP_VERSION = 2
 


Test patch: