Repository: streamlink/streamlink

Issue:
FilmOn.py  No plugin can handle
## Error Report

- [x] This is a bug report and I have read the post guidelines.

### Description

On the homepage of Film On the UK channels are played without problem.
Unfortunately not with Streamlink. Here it fails with the transmitter Channel4 and Channel5

### Expected / actual behavior

I enter the address and there is no picture.

streamlink http://www.filmon.com/tv/channel-4 best

### Reproduction steps / Explicit stream URLs to test

1.https: //www.filmon.com/tv/channel-4
2.https: //www.filmon.com/tv/channel-5

### log output

Not Work with Channel4:
WINDOWS> streamlink http://www.filmon.com/tv/channel-4  best
error: No plugin can handle URL: http://www.filmon.com/tv/channel-4

Work with More4
WINDOWS> streamlink https://www.filmon.com/tv/more4 best
[cli][info] Found matching plugin filmon for URL https://www.filmon.com/tv/more4
[cli][info] Available streams: low (worst), high (best)
[cli][info] Opening stream: high (hls-filmon)
[cli][info] Starting player: "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...


### Additional comments, screenshots, etc.

https://i.ibb.co/FDs2QtX/film-on.jpg


Discussion:

Resolving patch:
diff --git a/src/streamlink/plugins/filmon.py b/src/streamlink/plugins/filmon.py
--- a/src/streamlink/plugins/filmon.py
+++ b/src/streamlink/plugins/filmon.py
@@ -164,7 +164,7 @@ class Filmon(Plugin):
             |
             (?:tv/)channel/(?:export\?)?
             |
-            tv/(?!channel)
+            tv/(?!channel/)
             |
             channel/
             |


Test patch:
diff --git a/tests/plugins/test_filmon.py b/tests/plugins/test_filmon.py
--- a/tests/plugins/test_filmon.py
+++ b/tests/plugins/test_filmon.py
@@ -10,24 +10,25 @@ def test_can_handle_url(self):
             'http://www.filmon.tv/index/popout?channel_id=5510&quality=low',
             'http://www.filmon.tv/tv/channel/export?channel_id=5510&autoPlay=1',
             'http://www.filmon.tv/tv/channel/grandstand-show',
+            'http://www.filmon.tv/tv/channel-4',
             'https://www.filmon.com/tv/bbc-news',
             'https://www.filmon.tv/tv/55',
             'http://www.filmon.tv/vod/view/10250-0-crime-boss',
             'http://www.filmon.tv/group/comedy',
         ]
         for url in should_match:
-            self.assertTrue(Filmon.can_handle_url(url))
+            self.assertTrue(Filmon.can_handle_url(url), url)
 
     def test_can_handle_url_negative(self):
         should_not_match = [
             'https://example.com/index.html',
         ]
         for url in should_not_match:
-            self.assertFalse(Filmon.can_handle_url(url))
+            self.assertFalse(Filmon.can_handle_url(url), url)
 
     def _test_regex(self, url, expected):
         m = Filmon.url_re.match(url)
-        self.assertIsNotNone(m)
+        self.assertIsNotNone(m, url)
         # expected must return [is_group, channel, vod_id]
         self.assertEqual(expected, list(m.groups()))
 
@@ -51,6 +52,10 @@ def test_regex_live_stream_tv(self):
         self._test_regex('https://www.filmon.com/tv/bbc-news',
                          [None, 'bbc-news', None])
 
+    def test_regex_live_stream_tv_with_channel_in_name(self):
+        self._test_regex('https://www.filmon.com/tv/channel-4',
+                         [None, 'channel-4', None])
+
     def test_regex_live_stream_tv_number(self):
         self._test_regex('https://www.filmon.tv/tv/55',
                          [None, '55', None])