prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Remove 9anime.to
  As discussed over here: https://github.com/streamlink/streamlink/issues/1110#issuecomment-400687075 9anime.to isn't worth supporting at this point and is broken so I'm proposing we remove it.
  
  
  --- 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/nineanime.py`
  Content:
  ```
  1 import re
  2 from streamlink.plugin import Plugin
  3 from streamlink.plugin.api import http
  4 from streamlink.plugin.api import useragents
  5 from streamlink.plugin.api import validate
  6 from streamlink.stream import HTTPStream
  7 from streamlink.compat import urlparse
  8 
  9 
  10 class NineAnime(Plugin):
  11     _episode_info_url = "//9anime.to/ajax/episode/info"
  12 
  13     _info_schema = validate.Schema({
  14         "grabber": validate.url(),
  15         "params": {
  16             "id": validate.text,
  17             "token": validate.text,
  18             "options": validate.text,
  19         }
  20     })
  21 
  22     _streams_schema = validate.Schema({
  23         "token": validate.text,
  24         "error": None,
  25         "data": [{
  26             "label": validate.text,
  27             "file": validate.url(),
  28             "type": "mp4"
  29         }]
  30     })
  31 
  32     _url_re = re.compile(r"https?://9anime.to/watch/(?:[^.]+?\.)(\w+)/(\w+)")
  33 
  34     @classmethod
  35     def can_handle_url(cls, url):
  36         return cls._url_re.match(url) is not None
  37 
  38     def add_scheme(self, url):
  39         # update the scheme for the grabber url if required
  40         if url.startswith("//"):
  41             url = "{0}:{1}".format(urlparse(self.url).scheme, url)
  42         return url
  43 
  44     @Plugin.broken(1110)
  45     def _get_streams(self):
  46         match = self._url_re.match(self.url)
  47         film_id, episode_id = match.groups()
  48 
  49         headers = {
  50             "Referer": self.url,
  51             "User-Agent": useragents.FIREFOX
  52         }
  53 
  54         # Get the info about the Episode, including the Grabber API URL
  55         info_res = http.get(self.add_scheme(self._episode_info_url),
  56                             params=dict(update=0, film=film_id, id=episode_id),
  57                             headers=headers)
  58         info = http.json(info_res, schema=self._info_schema)
  59 
  60         # Get the data about the streams from the Grabber API
  61         grabber_url = self.add_scheme(info["grabber"])
  62         stream_list_res = http.get(grabber_url, params=info["params"], headers=headers)
  63         stream_data = http.json(stream_list_res, schema=self._streams_schema)
  64 
  65         for stream in stream_data["data"]:
  66             yield stream["label"], HTTPStream(self.session, stream["file"])
  67 
  68 
  69 __plugin__ = NineAnime
  70
  ```
  --- 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/nineanime.py b/src/streamlink/plugins/nineanime.py
  --- a/src/streamlink/plugins/nineanime.py
  +++ b/src/streamlink/plugins/nineanime.py
  @@ -1,69 +1 @@
  -import re
  -from streamlink.plugin import Plugin
  -from streamlink.plugin.api import http
  -from streamlink.plugin.api import useragents
  -from streamlink.plugin.api import validate
  -from streamlink.stream import HTTPStream
  -from streamlink.compat import urlparse
  -
  -
  -class NineAnime(Plugin):
  -    _episode_info_url = "//9anime.to/ajax/episode/info"
  -
  -    _info_schema = validate.Schema({
  -        "grabber": validate.url(),
  -        "params": {
  -            "id": validate.text,
  -            "token": validate.text,
  -            "options": validate.text,
  -        }
  -    })
  -
  -    _streams_schema = validate.Schema({
  -        "token": validate.text,
  -        "error": None,
  -        "data": [{
  -            "label": validate.text,
  -            "file": validate.url(),
  -            "type": "mp4"
  -        }]
  -    })
  -
  -    _url_re = re.compile(r"https?://9anime.to/watch/(?:[^.]+?\.)(\w+)/(\w+)")
  -
  -    @classmethod
  -    def can_handle_url(cls, url):
  -        return cls._url_re.match(url) is not None
  -
  -    def add_scheme(self, url):
  -        # update the scheme for the grabber url if required
  -        if url.startswith("//"):
  -            url = "{0}:{1}".format(urlparse(self.url).scheme, url)
  -        return url
  -
  -    @Plugin.broken(1110)
  -    def _get_streams(self):
  -        match = self._url_re.match(self.url)
  -        film_id, episode_id = match.groups()
  -
  -        headers = {
  -            "Referer": self.url,
  -            "User-Agent": useragents.FIREFOX
  -        }
  -
  -        # Get the info about the Episode, including the Grabber API URL
  -        info_res = http.get(self.add_scheme(self._episode_info_url),
  -                            params=dict(update=0, film=film_id, id=episode_id),
  -                            headers=headers)
  -        info = http.json(info_res, schema=self._info_schema)
  -
  -        # Get the data about the streams from the Grabber API
  -        grabber_url = self.add_scheme(info["grabber"])
  -        stream_list_res = http.get(grabber_url, params=info["params"], headers=headers)
  -        stream_data = http.json(stream_list_res, schema=self._streams_schema)
  -
  -        for stream in stream_data["data"]:
  -            yield stream["label"], HTTPStream(self.session, stream["file"])
  -
  -
  -__plugin__ = NineAnime
  +# Plugin removed - https://github.com/streamlink/streamlink/issues/1862
  
verification_info: {"golden_diff": "diff --git a/src/streamlink/plugins/nineanime.py b/src/streamlink/plugins/nineanime.py\n--- a/src/streamlink/plugins/nineanime.py\n+++ b/src/streamlink/plugins/nineanime.py\n@@ -1,69 +1 @@\n-import re\n-from streamlink.plugin import Plugin\n-from streamlink.plugin.api import http\n-from streamlink.plugin.api import useragents\n-from streamlink.plugin.api import validate\n-from streamlink.stream import HTTPStream\n-from streamlink.compat import urlparse\n-\n-\n-class NineAnime(Plugin):\n-    _episode_info_url = \"//9anime.to/ajax/episode/info\"\n-\n-    _info_schema = validate.Schema({\n-        \"grabber\": validate.url(),\n-        \"params\": {\n-            \"id\": validate.text,\n-            \"token\": validate.text,\n-            \"options\": validate.text,\n-        }\n-    })\n-\n-    _streams_schema = validate.Schema({\n-        \"token\": validate.text,\n-        \"error\": None,\n-        \"data\": [{\n-            \"label\": validate.text,\n-            \"file\": validate.url(),\n-            \"type\": \"mp4\"\n-        }]\n-    })\n-\n-    _url_re = re.compile(r\"https?://9anime.to/watch/(?:[^.]+?\\.)(\\w+)/(\\w+)\")\n-\n-    @classmethod\n-    def can_handle_url(cls, url):\n-        return cls._url_re.match(url) is not None\n-\n-    def add_scheme(self, url):\n-        # update the scheme for the grabber url if required\n-        if url.startswith(\"//\"):\n-            url = \"{0}:{1}\".format(urlparse(self.url).scheme, url)\n-        return url\n-\n-    @Plugin.broken(1110)\n-    def _get_streams(self):\n-        match = self._url_re.match(self.url)\n-        film_id, episode_id = match.groups()\n-\n-        headers = {\n-            \"Referer\": self.url,\n-            \"User-Agent\": useragents.FIREFOX\n-        }\n-\n-        # Get the info about the Episode, including the Grabber API URL\n-        info_res = http.get(self.add_scheme(self._episode_info_url),\n-                            params=dict(update=0, film=film_id, id=episode_id),\n-                            headers=headers)\n-        info = http.json(info_res, schema=self._info_schema)\n-\n-        # Get the data about the streams from the Grabber API\n-        grabber_url = self.add_scheme(info[\"grabber\"])\n-        stream_list_res = http.get(grabber_url, params=info[\"params\"], headers=headers)\n-        stream_data = http.json(stream_list_res, schema=self._streams_schema)\n-\n-        for stream in stream_data[\"data\"]:\n-            yield stream[\"label\"], HTTPStream(self.session, stream[\"file\"])\n-\n-\n-__plugin__ = NineAnime\n+# Plugin removed - https://github.com/streamlink/streamlink/issues/1862\n", "issue": "Remove 9anime.to\nAs discussed over here: https://github.com/streamlink/streamlink/issues/1110#issuecomment-400687075 9anime.to isn't worth supporting at this point and is broken so I'm proposing we remove it.\r\n\n", "before_files": [{"content": "import re\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugin.api import http\nfrom streamlink.plugin.api import useragents\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream import HTTPStream\nfrom streamlink.compat import urlparse\n\n\nclass NineAnime(Plugin):\n    _episode_info_url = \"//9anime.to/ajax/episode/info\"\n\n    _info_schema = validate.Schema({\n        \"grabber\": validate.url(),\n        \"params\": {\n            \"id\": validate.text,\n            \"token\": validate.text,\n            \"options\": validate.text,\n        }\n    })\n\n    _streams_schema = validate.Schema({\n        \"token\": validate.text,\n        \"error\": None,\n        \"data\": [{\n            \"label\": validate.text,\n            \"file\": validate.url(),\n            \"type\": \"mp4\"\n        }]\n    })\n\n    _url_re = re.compile(r\"https?://9anime.to/watch/(?:[^.]+?\\.)(\\w+)/(\\w+)\")\n\n    @classmethod\n    def can_handle_url(cls, url):\n        return cls._url_re.match(url) is not None\n\n    def add_scheme(self, url):\n        # update the scheme for the grabber url if required\n        if url.startswith(\"//\"):\n            url = \"{0}:{1}\".format(urlparse(self.url).scheme, url)\n        return url\n\n    @Plugin.broken(1110)\n    def _get_streams(self):\n        match = self._url_re.match(self.url)\n        film_id, episode_id = match.groups()\n\n        headers = {\n            \"Referer\": self.url,\n            \"User-Agent\": useragents.FIREFOX\n        }\n\n        # Get the info about the Episode, including the Grabber API URL\n        info_res = http.get(self.add_scheme(self._episode_info_url),\n                            params=dict(update=0, film=film_id, id=episode_id),\n                            headers=headers)\n        info = http.json(info_res, schema=self._info_schema)\n\n        # Get the data about the streams from the Grabber API\n        grabber_url = self.add_scheme(info[\"grabber\"])\n        stream_list_res = http.get(grabber_url, params=info[\"params\"], headers=headers)\n        stream_data = http.json(stream_list_res, schema=self._streams_schema)\n\n        for stream in stream_data[\"data\"]:\n            yield stream[\"label\"], HTTPStream(self.session, stream[\"file\"])\n\n\n__plugin__ = NineAnime\n", "path": "src/streamlink/plugins/nineanime.py"}], "after_files": [{"content": "# Plugin removed - https://github.com/streamlink/streamlink/issues/1862\n", "path": "src/streamlink/plugins/nineanime.py"}]}