Repository: streamlink/streamlink

Issue:
bigoweb.co / bigolive.tv plugin no longer works


----

### Checklist

- [x] This is a bug report.
- [ ] This is a plugin request.
- [ ] This is a feature request.
- [ ] I used the search function to find already opened/closed issues or pull requests.

### Description
error: No plugin can handle bigoweb.co addressess as of 10 minutes ago

### Expected / Actual behavior

10 minutes ago it worked fine and now it gives an error.
...

### Reproduction steps / Stream URLs to test

1. ...http://www.bigoweb.co/ (any stream)
2. ...
3. ...

### Environment details (operating system, python version, etc.)

...

### Comments, logs, screenshots, etc.

...


Discussion:

Patch:
diff --git a/src/streamlink/plugins/bigo.py b/src/streamlink/plugins/bigo.py
index 98101c78..365d38cd 100644
--- a/src/streamlink/plugins/bigo.py
+++ b/src/streamlink/plugins/bigo.py
@@ -47,7 +47,7 @@ class BigoStream(Stream):
 
 
 class Bigo(Plugin):
-    _url_re = re.compile(r"https?://(live.bigo.tv/\d+|bigoweb.co/show/\d+)")
+    _url_re = re.compile(r"https?://(?:www\.)?(bigo\.tv/\d+|bigoweb\.co/show/\d+)")
     _flashvars_re = flashvars = re.compile(
         r'''^\s*(?<!<!--)<param.*value="tmp=(\d+)&channel=(\d+)&srv=(\d+\.\d+\.\d+\.\d+)&port=(\d+)"''',
         re.M)


Test patch:
diff --git a/tests/test_plugin_bigo.py b/tests/test_plugin_bigo.py
new file mode 100644
index 00000000..99bd4e17
--- /dev/null
+++ b/tests/test_plugin_bigo.py
@@ -0,0 +1,31 @@
+import unittest
+
+from streamlink.plugins.bigo import Bigo
+
+
+class TestPluginBongacams(unittest.TestCase):
+    def test_can_handle_url(self):
+        # Correct urls
+        self.assertTrue(Bigo.can_handle_url("http://www.bigoweb.co/show/00000000"))
+        self.assertTrue(Bigo.can_handle_url("https://www.bigoweb.co/show/00000000"))
+        self.assertTrue(Bigo.can_handle_url("http://bigoweb.co/show/00000000"))
+        self.assertTrue(Bigo.can_handle_url("https://bigoweb.co/show/00000000"))
+        self.assertTrue(Bigo.can_handle_url("http://bigo.tv/00000000"))
+        self.assertTrue(Bigo.can_handle_url("https://bigo.tv/00000000"))
+        self.assertTrue(Bigo.can_handle_url("https://www.bigo.tv/00000000"))
+        self.assertTrue(Bigo.can_handle_url("http://www.bigo.tv/00000000"))
+
+        # Old URLs don't work anymore
+        self.assertFalse(Bigo.can_handle_url("http://live.bigo.tv/00000000"))
+        self.assertFalse(Bigo.can_handle_url("https://live.bigo.tv/00000000"))
+
+        # Wrong URL structure
+        self.assertFalse(Bigo.can_handle_url("ftp://www.bigo.tv/00000000"))
+        self.assertFalse(Bigo.can_handle_url("https://www.bigo.tv/show/00000000"))
+        self.assertFalse(Bigo.can_handle_url("http://www.bigo.tv/show/00000000"))
+        self.assertFalse(Bigo.can_handle_url("http://bigo.tv/show/00000000"))
+        self.assertFalse(Bigo.can_handle_url("https://bigo.tv/show/00000000"))
+
+
+if __name__ == "__main__":
+    unittest.main()