Repository: streamlink/streamlink

Issue:
TV1 Plugin - new player being used

## Bug Report
- [x] This is a bug report and I have read the contribution guidelines.


### Description
 TV1 won't start, because they're using a different player now.


### Expected / Actual behavior

Should have worked?


### Reproduction steps / Explicit stream URLs to test


1. streamlink http://tv1channel.org/ best
2. ? ? ?
3. profit


Discussion:
static url

```
streamlink "https://stream.bittubeapp.com/bittubelive/tv1channebg/playlist.m3u8" best --http-no-ssl-verify
```

---

**EDIT**:

they changed their service again

Resolving patch:
diff --git a/src/streamlink/plugins/tv1channel.py b/src/streamlink/plugins/tv1channel.py
--- a/src/streamlink/plugins/tv1channel.py
+++ b/src/streamlink/plugins/tv1channel.py
@@ -1,25 +1,32 @@
 import re
 
 from streamlink.plugin import Plugin
-
-_url_re = re.compile(r'''https?://(www\.)?tv1channel\.org/''')
-_embed_re = re.compile(r'''<iframe.+src="([^"]+)"''')
+from streamlink.plugin.api import useragents
+from streamlink.plugin.api.utils import itertags
+from streamlink.stream import HLSStream
 
 
 class TV1Channel(Plugin):
+    _url_re = re.compile(r'https?://(?:www\.)?tv1channel\.org/(?!play/)(?:index\.php/livetv)?')
+
     @classmethod
     def can_handle_url(cls, url):
-        return _url_re.match(url)
+        return cls._url_re.match(url) is not None
 
     def _get_streams(self):
+        self.session.http.headers.update({'User-Agent': useragents.FIREFOX})
         res = self.session.http.get(self.url)
-        match = _embed_re.search(res.text)
+        for iframe in itertags(res.text, 'iframe'):
+            if 'cdn.netbadgers.com' not in iframe.attributes.get('src'):
+                continue
+
+            res = self.session.http.get(iframe.attributes.get('src'))
+            for source in itertags(res.text, 'source'):
+                if source.attributes.get('src') and source.attributes.get('src').endswith('.m3u8'):
+                    return HLSStream.parse_variant_playlist(self.session,
+                                                            source.attributes.get('src'))
 
-        if match:
-            url = match.group(1)
-            if url.startswith('//'):
-                url = 'https:{0}'.format(url)
-            return self.session.streams(url)
+            break
 
 
 __plugin__ = TV1Channel


Test patch:
diff --git a/tests/plugins/test_tv1channel.py b/tests/plugins/test_tv1channel.py
--- a/tests/plugins/test_tv1channel.py
+++ b/tests/plugins/test_tv1channel.py
@@ -8,8 +8,8 @@ def test_can_handle_url(self):
         # should match
         self.assertTrue(TV1Channel.can_handle_url("http://tv1channel.org/"))
         self.assertTrue(TV1Channel.can_handle_url("http://tv1channel.org/index.php/livetv"))
-        self.assertTrue(TV1Channel.can_handle_url("http://www.tv1channel.org/play/video.php?id=325"))
-        self.assertTrue(TV1Channel.can_handle_url("http://www.tv1channel.org/play/video.php?id=340"))
 
         # shouldn't match
         self.assertFalse(TV1Channel.can_handle_url("https://local.local"))
+        self.assertFalse(TV1Channel.can_handle_url("http://www.tv1channel.org/play/video.php?id=325"))
+        self.assertFalse(TV1Channel.can_handle_url("http://www.tv1channel.org/play/video.php?id=340"))