Repository: streamlink/streamlink

Issue:
ok.ru VODs
<!--
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 [ ] with [x] in order to check the box -->
- [x ] This is a plugin issue and I have read the contribution guidelines.


### Description
i enter link in #1884 but "https://raw.githubusercontent.com/back-to/plugins/master/plugins/ok_live.py" 404: Not Found. Thanks
<!-- Explain the plugin issue as thoroughly as you can. -->


### 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. D:\my\Streamlinkl\bin>streamlink -l debug "https://ok.ru/video/266205792931" best



### 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.
-->

```
[cli][debug] OS:         Windows 8.1
[cli][debug] Python:     3.5.2
[cli][debug] Streamlink: 0.14.2
[cli][debug] Requests(2.19.1), Socks(1.6.7), Websocket(0.48.0)
error: No plugin can handle URL: https://ok.ru/video/266205792931

```


### Additional comments, screenshots, etc.



[Love Streamlink? Please consider supporting our collective. Thanks!](https://opencollective.com/streamlink/donate)



Discussion:
> No plugin can handle URL

As already mentioned in #1884, Streamlink's ok.ru plugin doesn't support VODs.

> 404: Not Found

This was a link to a custom version of the plugin from an external repository maintained by @back-to, which is not (publicly) available anymore, hence the 404 error message. I don't know why, but he will have his reasons. I'll tag this thread as plugin enhancement request.
@bastimeyer 
Thanks for the support
So now what can I do to run the code without error?



Resolving patch:
diff --git a/src/streamlink/plugins/ok_live.py b/src/streamlink/plugins/ok_live.py
--- a/src/streamlink/plugins/ok_live.py
+++ b/src/streamlink/plugins/ok_live.py
@@ -5,7 +5,7 @@
 from streamlink.plugin.api import useragents
 from streamlink.stream import HLSStream
 
-_url_re = re.compile(r"https?://(www\.)?ok\.ru/live/\d+")
+_url_re = re.compile(r"https?://(www\.)?ok\.ru/(live|video)/\d+")
 _vod_re = re.compile(r";(?P<hlsurl>[^;]+video\.m3u8.+?)\\&quot;")
 
 _schema = validate.Schema(
@@ -21,7 +21,7 @@
 
 class OK_live(Plugin):
     """
-    Support for ok.ru live stream: http://www.ok.ru/live/
+    Support for ok.ru live stream: http://www.ok.ru/live/ and for ok.ru VoDs: http://www.ok.ru/video/
     """
     @classmethod
     def can_handle_url(cls, url):


Test patch:
diff --git a/tests/plugins/test_ok_live.py b/tests/plugins/test_ok_live.py
--- a/tests/plugins/test_ok_live.py
+++ b/tests/plugins/test_ok_live.py
@@ -9,6 +9,7 @@ def test_can_handle_url(self):
         self.assertTrue(OK_live.can_handle_url("https://ok.ru/live/12345"))
         self.assertTrue(OK_live.can_handle_url("http://ok.ru/live/12345"))
         self.assertTrue(OK_live.can_handle_url("http://www.ok.ru/live/12345"))
+        self.assertTrue(OK_live.can_handle_url("https://ok.ru/video/266205792931"))
 
         # shouldn't match
         self.assertFalse(OK_live.can_handle_url("http://www.tvcatchup.com/"))