diff --git a/docs/plugin_matrix.rst b/docs/plugin_matrix.rst index 2e96579255e..b2cb007a8af 100644 --- a/docs/plugin_matrix.rst +++ b/docs/plugin_matrix.rst @@ -97,8 +97,6 @@ kugou fanxing.kugou.com Yes -- latina latina.pe Yes No Streams may be geo-restricted to Peru. linelive live.line.me Yes Yes live_russia_tv live.russia.tv Yes -- -liveedu - liveedu.tv Yes -- Some streams require a login. - - livecoding.tv liveme liveme.com Yes -- livespotting livespotting.tv Yes No livestream livestream.com Yes -- diff --git a/src/streamlink/plugins/.removed b/src/streamlink/plugins/.removed index 36f79ec8cb5..efd4e295eec 100644 --- a/src/streamlink/plugins/.removed +++ b/src/streamlink/plugins/.removed @@ -55,6 +55,7 @@ kingkong kralmuzik letontv livecodingtv +liveedu livestation looch media_ccc_de diff --git a/src/streamlink/plugins/liveedu.py b/src/streamlink/plugins/liveedu.py deleted file mode 100644 index 149a7f83851..00000000000 --- a/src/streamlink/plugins/liveedu.py +++ /dev/null @@ -1,129 +0,0 @@ -import logging -import re - -from streamlink.compat import urljoin -from streamlink.plugin import Plugin, PluginArgument, PluginArguments, PluginError, pluginmatcher -from streamlink.plugin.api import validate -from streamlink.stream import HLSStream, RTMPStream - -log = logging.getLogger(__name__) - - -@pluginmatcher(re.compile( - r"https?://(?:\w+\.)?(?:livecoding|liveedu)\.tv/" -)) -class LiveEdu(Plugin): - login_url = "https://www.liveedu.tv/accounts/login/" - config_re = re.compile(r"""\Wconfig.(?P\w+)\s*=\s*(?P['"])(?P.*?)(?P=q);""") - csrf_re = re.compile(r'''"csrfToken"\s*:\s*"(\w+)"''') - api_schema = validate.Schema({ - "viewing_urls": { - validate.optional("error"): validate.text, - validate.optional("urls"): [{ - "src": validate.url(), - "type": validate.text, - validate.optional("res"): int, - validate.optional("label"): validate.text, - }] - } - }) - config_schema = validate.Schema({ - "selectedVideoHID": validate.text, - "livestreamURL": validate.text, - "videosURL": validate.text - }) - - arguments = PluginArguments( - PluginArgument( - "email", - requires=["password"], - metavar="EMAIL", - help="The email address used to register with liveedu.tv." - ), - PluginArgument( - "password", - sensitive=True, - metavar="PASSWORD", - help="A LiveEdu account password to use with --liveedu-email." - ) - ) - - def login(self): - """ - Attempt a login to LiveEdu.tv - """ - email = self.get_option("email") - password = self.get_option("password") - - if email and password: - res = self.session.http.get(self.login_url) - csrf_match = self.csrf_re.search(res.text) - token = csrf_match and csrf_match.group(1) - log.debug("Attempting login as {0} (token={1})".format(email, token)) - - res = self.session.http.post( - self.login_url, - data=dict(login=email, password=password, csrfmiddlewaretoken=token), - allow_redirects=False, - raise_for_status=False, - headers={"Referer": self.login_url} - ) - - if res.status_code != 302: - log.error("Failed to login to LiveEdu account: {0}".format(email)) - - def _get_streams(self): - """ - Get the config object from the page source and call the - API to get the list of streams - :return: - """ - # attempt a login - self.login() - - res = self.session.http.get(self.url) - # decode the config for the page - matches = self.config_re.finditer(res.text) - try: - config = self.config_schema.validate(dict( - [m.group("key", "value") for m in matches] - )) - except PluginError: - return - - if config["selectedVideoHID"]: - log.debug("Found video hash ID: {0}".format(config["selectedVideoHID"])) - api_url = urljoin(self.url, urljoin(config["videosURL"], config["selectedVideoHID"])) - elif config["livestreamURL"]: - log.debug("Found live stream URL: {0}".format(config["livestreamURL"])) - api_url = urljoin(self.url, config["livestreamURL"]) - else: - return - - ares = self.session.http.get(api_url) - data = self.session.http.json(ares, schema=self.api_schema) - viewing_urls = data["viewing_urls"] - - if "error" in viewing_urls: - log.error("Failed to load streams: {0}".format(viewing_urls["error"])) - else: - for url in viewing_urls["urls"]: - try: - label = "{0}p".format(url.get("res", url["label"])) - except KeyError: - label = "live" - - if url["type"] == "rtmp/mp4" and RTMPStream.is_usable(self.session): - params = { - "rtmp": url["src"], - "pageUrl": self.url, - "live": True, - } - yield label, RTMPStream(self.session, params) - - elif url["type"] == "application/x-mpegURL": - for s in HLSStream.parse_variant_playlist(self.session, url["src"]).items(): - yield s - - -__plugin__ = LiveEdu diff --git a/tests/plugins/test_liveedu.py b/tests/plugins/test_liveedu.py deleted file mode 100644 index f0eea944bf5..00000000000 --- a/tests/plugins/test_liveedu.py +++ /dev/null @@ -1,10 +0,0 @@ -from streamlink.plugins.liveedu import LiveEdu -from tests.plugins import PluginCanHandleUrl - - -class TestPluginCanHandleUrlLiveEdu(PluginCanHandleUrl): - __plugin__ = LiveEdu - - should_match = [ - 'https://www.liveedu.tv/', - ]