How to use the streamlink.plugin.PluginArgument function in streamlink

To help you get started, we’ve selected a few streamlink examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github streamlink / streamlink / src / streamlink / plugins / npo.py View on Github external
"items": [
            [{
                "label": validate.text,
                "contentType": validate.text,
                "url": validate.url(),
                "format": validate.text
            }]
        ]
    }, validate.get("items"), validate.get(0))
    stream_info_schema = validate.Schema(validate.any(
        validate.url(),
        validate.all({"errorcode": 0, "url": validate.url()},
                     validate.get("url"))
    ))
    arguments = PluginArguments(
        PluginArgument(
            "subtitles",
            action="store_true",
            help="""
        Include subtitles for the deaf or hard of hearing, if available.
        """
        )
    )

    @classmethod
    def can_handle_url(cls, url):
        return cls.url_re.match(url) is not None

    def __init__(self, url):
        super(NPO, self).__init__(url)
        self._token = None
        self.session.http.headers.update({"User-Agent": useragents.CHROME})
github streamlink / streamlink / src / streamlink / plugins / liveedu.py View on Github external
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."
        )
    )

    @classmethod
    def can_handle_url(cls, url):
        return cls.url_re.match(url) is not None
github streamlink / streamlink / src / streamlink / plugins / btv.py View on Github external
from __future__ import print_function
import re

from streamlink import PluginError
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
from streamlink.utils import parse_json
from streamlink.plugin import PluginArgument, PluginArguments


class BTV(Plugin):
    arguments = PluginArguments(
        PluginArgument(
            "username",
            metavar="USERNAME",
            requires=["password"],
            help="""
        A BTV username required to access any stream.
        """
        ),
        PluginArgument(
            "password",
            sensitive=True,
            metavar="PASSWORD",
            help="""
        A BTV account password to use with --btv-username.
        """
        )
    )
github back-to / generic / plugins / generic.py View on Github external
),
        PluginArgument(
            'blacklist-filepath',
            metavar='FILEPATH',
            type=comma_list,
            help='''
            Blacklist file names for iframes and playlists
            by using a comma-separated list:

              'index.html,ignore.m3u8,/ad/master.m3u8'

            Sometimes there are invalid URLs in the result list,
            this can be used to remove them.
            '''
        ),
        PluginArgument(
            'whitelist-netloc',
            metavar='NETLOC',
            type=comma_list,
            help='''
            Whitelist domains that should only be searched for iframes,
            by using a comma-separated list:

              'example.com,localhost,google.com'

            Useful for websites with lots of iframes,
            where the main iframe always has the same hosting domain.
            '''
        ),
        PluginArgument(
            'whitelist-path',
            metavar='PATH',
github streamlink / streamlink / src / streamlink / plugins / funimationnow.py View on Github external
raise_for_status=False,
                      headers={"Referer": "https://www.funimation.com/log-in/"})
        d = self.session.http.json(r, schema=self.login_schema)
        self.token = d.get("token", None)
        return self.token is not None


class FunimationNow(Plugin):
    arguments = PluginArguments(
        PluginArgument(
            "email",
            argument_name="funimation-email",
            requires=["password"],
            help="Email address for your Funimation account."
        ),
        PluginArgument(
            "password",
            argument_name="funimation-password",
            sensitive=True,
            help="Password for your Funimation account."
        ),
        PluginArgument(
            "language",
            argument_name="funimation-language",
            choices=["en", "ja", "english", "japanese"],
            default="english",
            help="""
            The audio language to use for the stream; japanese or english.

            Default is "english".
            """
        ),
github streamlink / streamlink / src / streamlink / plugins / ustvnow.py View on Github external
arguments = PluginArguments(
        PluginArgument(
            "username",
            metavar="USERNAME",
            required=True,
            help="Your USTV Now account username"
        ),
        PluginArgument(
            "password",
            sensitive=True,
            metavar="PASSWORD",
            required=True,
            help="Your USTV Now account password",
            prompt="Enter USTV Now account password"
        ),
        PluginArgument(
            "station-code",
            metavar="CODE",
            help=argparse.SUPPRESS
        ),
    )

    def __init__(self, url):
        super(USTVNow, self).__init__(url)
        self._encryption_config = {}
        self._token = None

    @classmethod
    def can_handle_url(cls, url):
        return cls._url_re.match(url) is not None

    @classmethod
github streamlink / streamlink / src / streamlink / plugins / twitch.py View on Github external
Example:

          "_twitch_session_id=xxxxxx; persistent=xxxxx"

        Note: This method is the old and clunky way of authenticating with
        Twitch, using --twitch-oauth-authenticate is the recommended and
        simpler way of doing it now.
        """
                       ),
        PluginArgument("disable-hosting",
                       action="store_true",
                       help="""
        Do not open the stream if the target channel is hosting another channel.
        """
                       ),
        PluginArgument("disable-ads",
                       action="store_true",
                       help="""
        Skip embedded advertisement segments at the beginning or during a stream.
        Will cause these segments to be missing from the stream.
        """
                       ),
        PluginArgument("disable-reruns",
                       action="store_true",
                       help="""
        Do not open the stream if the target channel is currently broadcasting a rerun.
        """
                       ))

    @classmethod
    def stream_weight(cls, key):
        weight = QUALITY_WEIGHTS.get(key)
github streamlink / streamlink / src / streamlink / plugins / pixiv.py View on Github external
metavar="SESSIONID",
            help="""
        The pixiv.net sessionid that's used in pixivs PHPSESSID cookie.
        can be used instead of the username/password login process.
        """
        ),
        PluginArgument(
            "devicetoken",
            sensitive=True,
            metavar="DEVICETOKEN",
            help="""
        The pixiv.net device token that's used in pixivs device_token cookie.
        can be used instead of the username/password login process.
        """
        ),
        PluginArgument(
            "purge-credentials",
            action="store_true",
            help="""
        Purge cached Pixiv credentials to initiate a new session
        and reauthenticate.
        """),
        PluginArgument(
            "performer",
            metavar="USER",
            help="""
        Select a co-host stream instead of the owner stream.
        """)
    )

    def __init__(self, url):
        super(Pixiv, self).__init__(url)
github streamlink / streamlink / src / streamlink / plugins / yupptv.py View on Github external
class YuppTV(Plugin):
    _url_re = re.compile(r"""https?://(?:www\.)?yupptv\.com""", re.VERBOSE)
    _m3u8_re = re.compile(r'''['"](http.+\.m3u8.*?)['"]''')
    _login_url = "https://www.yupptv.com/auth/validateSignin"
    _box_logout = "https://www.yupptv.com/auth/confirmLogout"
    _signin_url = "https://www.yupptv.com/signin/"
    _account_url = "https://www.yupptv.com/account/myaccount.aspx"

    arguments = PluginArguments(
        PluginArgument(
            "email",
            requires=["password"],
            metavar="EMAIL",
            help="Your YuppTV account email"
        ),
        PluginArgument(
            "password",
            sensitive=True,
            metavar="PASSWORD",
            help="Your YuppTV account password."
        )
    )

    @classmethod
    def can_handle_url(cls, url):
        return cls._url_re.match(url) is not None

    def login(self, username, password, depth=3):
        if depth == 0:
            log.error("Failed to login to YuppTV")
            raise PluginError("cannot login")
github back-to / generic / plugins / generic.py View on Github external
'''
        ),
        PluginArgument(
            'blacklist-path',
            metavar='PATH',
            type=comma_list,
            help='''
            Blacklist the path of a domain that should not be used,
            by using a comma-separated list:

              'example.com/mypath,localhost/example,google.com/folder'

            Useful for websites with different iframes of the same domain.
            '''
        ),
        PluginArgument(
            'blacklist-filepath',
            metavar='FILEPATH',
            type=comma_list,
            help='''
            Blacklist file names for iframes and playlists
            by using a comma-separated list:

              'index.html,ignore.m3u8,/ad/master.m3u8'

            Sometimes there are invalid URLs in the result list,
            this can be used to remove them.
            '''
        ),
        PluginArgument(
            'whitelist-netloc',
            metavar='NETLOC',