prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  TVCatchup plugin is not working - "This service is ending soon"
  ### Checklist
  
  - [x] This is a bug report.
  - [ ] This is a feature request.
  - [x] This is a plugin (improvement) request.
  - [ ] I have read the contribution guidelines.
  
  ### Description
  
  TVCatchup plugin is not working for some time. The problem is that plugin is able to connect to a stream without any errors but the stream is different comparing to the TVCatchup website's stream. It looks like streamlink gets a different type of stream deliberately prepared by the service provider to send the message: "This service is ending soon. Please download TVCatchup from the app store". Assuming that there is a real stream available on the website and mobile app, is it still possible to open it by streamlink?
  
  Current stream for all of the channels:
  
  ![image](https://user-images.githubusercontent.com/12859955/31864398-f6226d86-b75c-11e7-84fe-b633eaef66e8.png)
  
  Thanks
  
  
  ### Reproduction steps / Explicit stream URLs to test
  
  streamlink http://tvcatchup.com/watch/bbctwo best
  
  ### Environment details
  
  Operating system and version: Windows/Linux
  Streamlink and Python version: Streamlink 0.8.1
  
  [Love Streamlink? Please consider supporting our collective. Thanks!](https://opencollective.com/streamlink/donate)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/streamlink/plugins/tvcatchup.py`
  Content:
  ```
  1 import re
  2 
  3 from streamlink.plugin import Plugin
  4 from streamlink.plugin.api import http
  5 from streamlink.stream import HLSStream
  6 
  7 USER_AGENT = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
  8 _url_re = re.compile(r"http://(?:www\.)?tvcatchup.com/watch/\w+")
  9 _stream_re = re.compile(r'''(?P<q>["'])(?P<stream_url>https?://.*m3u8\?.*clientKey=.*?)(?P=q)''')
  10 
  11 
  12 class TVCatchup(Plugin):
  13     @classmethod
  14     def can_handle_url(cls, url):
  15         return _url_re.match(url)
  16 
  17     def _get_streams(self):
  18         """
  19         Finds the streams from tvcatchup.com.
  20         """
  21         http.headers.update({"User-Agent": USER_AGENT})
  22         res = http.get(self.url)
  23 
  24         match = _stream_re.search(res.text, re.IGNORECASE | re.MULTILINE)
  25 
  26         if match:
  27             stream_url = match.group("stream_url")
  28 
  29             if stream_url:
  30                 if "_adp" in stream_url:
  31                     return HLSStream.parse_variant_playlist(self.session, stream_url)
  32                 else:
  33                     return {'576p': HLSStream(self.session, stream_url)}
  34 
  35 
  36 __plugin__ = TVCatchup
  37
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/src/streamlink/plugins/tvcatchup.py b/src/streamlink/plugins/tvcatchup.py
  --- a/src/streamlink/plugins/tvcatchup.py
  +++ b/src/streamlink/plugins/tvcatchup.py
  @@ -6,7 +6,7 @@
   
   USER_AGENT = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
   _url_re = re.compile(r"http://(?:www\.)?tvcatchup.com/watch/\w+")
  -_stream_re = re.compile(r'''(?P<q>["'])(?P<stream_url>https?://.*m3u8\?.*clientKey=.*?)(?P=q)''')
  +_stream_re = re.compile(r'''source.*?(?P<q>["'])(?P<stream_url>https?://.*m3u8\?.*clientKey=.*?)(?P=q)''')
   
   
   class TVCatchup(Plugin):
  
verification_info: {"golden_diff": "diff --git a/src/streamlink/plugins/tvcatchup.py b/src/streamlink/plugins/tvcatchup.py\n--- a/src/streamlink/plugins/tvcatchup.py\n+++ b/src/streamlink/plugins/tvcatchup.py\n@@ -6,7 +6,7 @@\n \n USER_AGENT = \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36\"\n _url_re = re.compile(r\"http://(?:www\\.)?tvcatchup.com/watch/\\w+\")\n-_stream_re = re.compile(r'''(?P<q>[\"'])(?P<stream_url>https?://.*m3u8\\?.*clientKey=.*?)(?P=q)''')\n+_stream_re = re.compile(r'''source.*?(?P<q>[\"'])(?P<stream_url>https?://.*m3u8\\?.*clientKey=.*?)(?P=q)''')\n \n \n class TVCatchup(Plugin):\n", "issue": "TVCatchup plugin is not working - \"This service is ending soon\"\n### Checklist\r\n\r\n- [x] This is a bug report.\r\n- [ ] This is a feature request.\r\n- [x] This is a plugin (improvement) request.\r\n- [ ] I have read the contribution guidelines.\r\n\r\n### Description\r\n\r\nTVCatchup plugin is not working for some time. The problem is that plugin is able to connect to a stream without any errors but the stream is different comparing to the TVCatchup website's stream. It looks like streamlink gets a different type of stream deliberately prepared by the service provider to send the message: \"This service is ending soon. Please download TVCatchup from the app store\". Assuming that there is a real stream available on the website and mobile app, is it still possible to open it by streamlink?\r\n\r\nCurrent stream for all of the channels:\r\n\r\n![image](https://user-images.githubusercontent.com/12859955/31864398-f6226d86-b75c-11e7-84fe-b633eaef66e8.png)\r\n\r\nThanks\r\n\r\n\r\n### Reproduction steps / Explicit stream URLs to test\r\n\r\nstreamlink http://tvcatchup.com/watch/bbctwo best\r\n\r\n### Environment details\r\n\r\nOperating system and version: Windows/Linux\r\nStreamlink and Python version: Streamlink 0.8.1\r\n\r\n[Love Streamlink? Please consider supporting our collective. Thanks!](https://opencollective.com/streamlink/donate)\r\n\n", "before_files": [{"content": "import re\n\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugin.api import http\nfrom streamlink.stream import HLSStream\n\nUSER_AGENT = \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36\"\n_url_re = re.compile(r\"http://(?:www\\.)?tvcatchup.com/watch/\\w+\")\n_stream_re = re.compile(r'''(?P<q>[\"'])(?P<stream_url>https?://.*m3u8\\?.*clientKey=.*?)(?P=q)''')\n\n\nclass TVCatchup(Plugin):\n    @classmethod\n    def can_handle_url(cls, url):\n        return _url_re.match(url)\n\n    def _get_streams(self):\n        \"\"\"\n        Finds the streams from tvcatchup.com.\n        \"\"\"\n        http.headers.update({\"User-Agent\": USER_AGENT})\n        res = http.get(self.url)\n\n        match = _stream_re.search(res.text, re.IGNORECASE | re.MULTILINE)\n\n        if match:\n            stream_url = match.group(\"stream_url\")\n\n            if stream_url:\n                if \"_adp\" in stream_url:\n                    return HLSStream.parse_variant_playlist(self.session, stream_url)\n                else:\n                    return {'576p': HLSStream(self.session, stream_url)}\n\n\n__plugin__ = TVCatchup\n", "path": "src/streamlink/plugins/tvcatchup.py"}], "after_files": [{"content": "import re\n\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugin.api import http\nfrom streamlink.stream import HLSStream\n\nUSER_AGENT = \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36\"\n_url_re = re.compile(r\"http://(?:www\\.)?tvcatchup.com/watch/\\w+\")\n_stream_re = re.compile(r'''source.*?(?P<q>[\"'])(?P<stream_url>https?://.*m3u8\\?.*clientKey=.*?)(?P=q)''')\n\n\nclass TVCatchup(Plugin):\n    @classmethod\n    def can_handle_url(cls, url):\n        return _url_re.match(url)\n\n    def _get_streams(self):\n        \"\"\"\n        Finds the streams from tvcatchup.com.\n        \"\"\"\n        http.headers.update({\"User-Agent\": USER_AGENT})\n        res = http.get(self.url)\n\n        match = _stream_re.search(res.text, re.IGNORECASE | re.MULTILINE)\n\n        if match:\n            stream_url = match.group(\"stream_url\")\n\n            if stream_url:\n                if \"_adp\" in stream_url:\n                    return HLSStream.parse_variant_playlist(self.session, stream_url)\n                else:\n                    return {'576p': HLSStream(self.session, stream_url)}\n\n\n__plugin__ = TVCatchup\n", "path": "src/streamlink/plugins/tvcatchup.py"}]}