This file is indexed.

/usr/share/livestreamer/livestreamer_cli/argparser.py is in livestreamer 1.10.2-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
import argparse
import re

from string import printable
from textwrap import dedent

from .constants import (
    LIVESTREAMER_VERSION, STREAM_PASSTHROUGH, DEFAULT_PLAYER_ARGUMENTS
)
from .utils import find_default_player


_filesize_re = re.compile("""
    (?P<size>\d+(\.\d+)?)
    (?P<modifier>[Kk]|[Mm])?
    (?:[Bb])?
""", re.VERBOSE)
_printable_re = re.compile("[{0}]".format(printable))
_valid_option_start_re = re.compile("^[A-z]")
_valid_option_char_re = re.compile("[A-z\-]")


class ArgumentParser(argparse.ArgumentParser):
    def sanitize_option(self, option):
        return "".join(filter(_valid_option_char_re.match, option))

    def convert_arg_line_to_args(self, line):
        # Strip any non-printable characters that might be in the
        # beginning of the line (e.g. Unicode BOM marker).
        match = _printable_re.search(line)
        if not match:
            return
        line = line[match.start():]

        # Skip lines that do not start with a valid option character (e.g. comments)
        if not _valid_option_start_re.match(line):
            return

        split = line.find("=")
        if split > 0:
            option = line[:split].strip()
            value = line[split+1:].strip()
            yield "--{0}={1}".format(self.sanitize_option(option), value)
        else:
            yield "--{0}".format(self.sanitize_option(line))


class HelpFormatter(argparse.RawDescriptionHelpFormatter):
    """A nicer help formatter.

    Help for arguments can be indented and contain new lines.
    It will be de-dented and arguments in the help will be
    separated by a blank line for better readability.

    Originally written by Jakub Roztocil of the httpie project.
    """
    def __init__(self, max_help_position=4, *args, **kwargs):
        # A smaller indent for args help.
        kwargs["max_help_position"] = max_help_position
        argparse.RawDescriptionHelpFormatter.__init__(self, *args, **kwargs)

    def _split_lines(self, text, width):
        text = dedent(text).strip() + "\n\n"
        return text.splitlines()


def comma_list(values):
    return [val.strip() for val in values.split(",")]


def comma_list_filter(acceptable):
    def func(p):
        values = comma_list(p)
        return list(filter(lambda v: v in acceptable, values))

    return func


def num(type, min=None, max=None):
    def func(value):
        value = type(value)

        if min is not None and not (value > min):
            raise argparse.ArgumentTypeError(
                "{0} value must be more than {1} but is {2}".format(
                    type.__name__, min, value
                )
            )

        if max is not None and not (value <= max):
            raise argparse.ArgumentTypeError(
                "{0} value must be at most {1} but is {2}".format(
                    type.__name__, max, value
                )
            )

        return value

    func.__name__ = type.__name__

    return func


def filesize(value):
    match = _filesize_re.match(value)
    if not match:
        raise ValueError

    size = float(match.group("size"))
    if not size:
        raise ValueError

    modifier = match.group("modifier")
    if modifier in ("M", "m"):
        size *= 1024 * 1024
    elif modifier in ("K", "k"):
        size *= 1024

    return num(int, min=0)(size)


parser = ArgumentParser(
    fromfile_prefix_chars="@",
    formatter_class=HelpFormatter,
    add_help=False,
    usage="%(prog)s [OPTIONS] [URL] [STREAM]",
    description=dedent("""
    Livestreamer is command-line utility that extracts streams from
    various services and pipes them into a video player of choice.
    """),
    epilog=dedent("""
    For more in-depth documention see:
      http://livestreamer.tanuki.se/

    Please report broken plugins or bugs to the issue tracker on Github:
      https://github.com/chrippa/livestreamer/issues
    """)
)

positional = parser.add_argument_group("Positional arguments")
positional.add_argument(
    "url",
    metavar="URL",
    nargs="?",
    help="""
    A URL to attempt to extract streams from.

    If it's a HTTP URL then "http://" can be omitted.
    """
)
positional.add_argument(
    "stream",
    metavar="STREAM",
    nargs="?",
    type=comma_list,
    help="""
    Stream to play.

    Use "best" or "worst" for highest or lowest quality available.

    Fallback streams can be specified by using a comma-separated list:

      "720p,480p,best"

    If no stream is specified and --default-stream is not used then a
    list of available streams will be printed.
    """
)

general = parser.add_argument_group("General options")
general.add_argument(
    "-h", "--help",
    action="store_true",
    help="""
    Show this help message and exit.
    """
)
general.add_argument(
    "-V", "--version",
    action="version",
    version="%(prog)s {0}".format(LIVESTREAMER_VERSION),
    help="""
    Show version number and exit.
    """
)
general.add_argument(
    "--plugins",
    action="store_true",
    help="""
    Print a list of all currently installed plugins.
    """
)
general.add_argument(
    "--config",
    action="append",
    metavar="FILENAME",
    help="""
    Load options from this config file.

    Can be repeated to load multiple files, in which case
    the options are merged on top of each other where the
    last config has highest priority.
    """
)
general.add_argument(
    "-l", "--loglevel",
    metavar="LEVEL",
    default="info",
    help="""
    Set the log message threshold.

    Valid levels are: none, error, warning, info, debug
    """
)
general.add_argument(
    "-Q", "--quiet",
    action="store_true",
    help="""
    Hide all log output.

    Alias for "--loglevel none".
    """
)
general.add_argument(
    "-j", "--json",
    action="store_true",
    help="""
    Output JSON representations instead of the normal text output.

    Useful for external scripting.
    """
)
general.add_argument(
    "--yes-run-as-root",
    action="store_true",
    help=argparse.SUPPRESS
)

player = parser.add_argument_group("Player options")
player.add_argument(
    "-p", "--player",
    metavar="COMMAND",
    default=find_default_player(),
    help="""
    Player to feed stream data to. This is a shell-like syntax to
    support passing options to the player. For example:

      "vlc --file-caching=5000"

    To use a player that is located in a path with spaces you must
    quote the path:

      "'/path/with spaces/vlc' --file-caching=5000"

    By default VLC will be used if it can be found in its default
    location.
    """
)
player.add_argument(
    "-a", "--player-args",
    metavar="ARGUMENTS",
    default=DEFAULT_PLAYER_ARGUMENTS,
    help="""
    This option allows you to customize the default arguments which
    are put together with the value of --player to create a command
    to execute.

    Formatting variables available:

    filename
      This is the filename that the player will use.
      It's usually "-" (stdin), but can also be a URL or a file
      depending on the options used.


    It's usually enough to use --player instead of this unless you
    need to add arguments after the filename.

    Default is "{0}".
    """.format(DEFAULT_PLAYER_ARGUMENTS)
)
player.add_argument(
    "-v", "--verbose-player",
    action="store_true",
    help="""
    Allow the player to display its console output.
    """
)
player.add_argument(
    "-n", "--player-fifo", "--fifo",
    action="store_true",
    help="""
    Make the player read the stream through a named pipe instead of
    the stdin pipe.
    """
)
player.add_argument(
    "--player-http",
    action="store_true",
    help="""
    Make the player read the stream through HTTP instead of
    the stdin pipe.
    """
)
player.add_argument(
    "--player-continuous-http",
    action="store_true",
    help="""
    Make the player read the stream through HTTP, but unlike
    --player-http it will continuously try to open the stream if the
    player requests it.

    This makes it possible to handle stream disconnects if your player
    is capable of reconnecting to a HTTP stream. This is usually
    done by setting your player to a "repeat mode".

    Note: Some stream types may end up looping the last part of a
    stream once or twice when it ends. This is caused by a lack of
    shared state between attempts to use a stream and may be fixed in
    the future.

    """
)
player.add_argument(
    "--player-passthrough",
    metavar="TYPES",
    type=comma_list_filter(STREAM_PASSTHROUGH),
    default=[],
    help="""
    A comma-delimited list of stream types to pass to the player as a
    URL to let it handle the transport of the stream instead.

    Stream types that can be converted into a playable URL are:

    - {0}

    Make sure your player can handle the stream type when using this.
    """.format("\n    - ".join(STREAM_PASSTHROUGH))
)
player.add_argument(
    "--player-no-close",
    action="store_true",
    help="""
    By default Livestreamer will close the player when the stream ends.
    This is to avoid "dead" GUI players lingering after a stream ends.

    It does however have the side-effect of sometimes closing a player
    before it has played back all of its cached data.

    This option will instead let the player decide when to exit.
    """
)

output = parser.add_argument_group("File output options")
output.add_argument(
    "-o", "--output",
    metavar="FILENAME",
    help="""
    Write stream data to FILENAME instead of playing it.

    You will be prompted if the file already exists.
    """
)
output.add_argument(
    "-f", "--force",
    action="store_true",
    help="""
    When using -o, always write to file even if it already exists.
    """
)
output.add_argument(
    "-O", "--stdout",
    action="store_true",
    help="""
    Write stream data to stdout instead of playing it.
    """
)

stream = parser.add_argument_group("Stream options")
stream.add_argument(
    "--default-stream",
    type=comma_list,
    metavar="STREAM",
    help="""
    Open this stream when no stream argument is specified, e.g. "best".
    """
)
stream.add_argument(
    "--retry-streams",
    metavar="DELAY",
    type=num(float, min=0),
    help="""
    Will retry fetching streams until streams are found while
    waiting DELAY (seconds) between each attempt.
    """
)
stream.add_argument(
    "--retry-open",
    metavar="ATTEMPTS",
    type=num(int, min=0),
    default=1,
    help="""
    Will try ATTEMPTS times to open the stream until giving up.

    Default is 1.
    """
)
stream.add_argument(
    "--stream-types", "--stream-priority",
    metavar="TYPES",
    type=comma_list,
    help="""
    A comma-delimited list of stream types to allow.

    The order will be used to separate streams when there are multiple
    streams with the same name but different stream types.

    Default is "rtmp,hls,hds,http,akamaihd".
    """
)
stream.add_argument(
    "--stream-sorting-excludes",
    metavar="STREAMS",
    type=comma_list,
    help="""
    Fine tune best/worst synonyms by excluding unwanted streams.

    Uses a filter expression in the format:

      [operator]<value>

    Valid operators are >, >=, < and <=. If no operator is specified
    then equality is tested.

    For example this will exclude streams ranked higher than "480p":

      ">480p"

    Multiple filters can be used by separating each expression with
    a comma.

    For example this will exclude streams from two quality types:

      ">480p,>medium"

    """
)

transport = parser.add_argument_group("Stream transport options")
transport.add_argument(
    "--hds-live-edge",
    type=num(float, min=0),
    metavar="SECONDS",
    help="""
    The time live HDS streams will start from the edge of stream.

    Default is 10.0.
    """
)
transport.add_argument(
    "--hds-segment-attempts",
    type=num(int, min=0),
    metavar="ATTEMPTS",
    help="""
    How many attempts should be done to download each HDS segment
    before giving up.

    Default is 3.
    """
)
transport.add_argument(
    "--hds-segment-threads",
    type=num(int, max=10),
    metavar="THREADS",
    help="""
    The size of the thread pool used to download HDS segments.
    Minimum value is 1 and maximum is 10.

    Default is 1.
    """
)
transport.add_argument(
    "--hds-segment-timeout",
    type=num(float, min=0),
    metavar="TIMEOUT",
    help="""
    HDS segment connect and read timeout.

    Default is 10.0.
    """
)
transport.add_argument(
    "--hds-timeout",
    type=num(float, min=0),
    metavar="TIMEOUT",
    help="""
    Timeout for reading data from HDS streams.

    Default is 60.0.
    """
)
transport.add_argument(
    "--hls-live-edge",
    type=num(int, min=0),
    metavar="SEGMENTS",
    help="""
    How many segments from the end to start live HLS streams on.

    The lower the value the lower latency from the source you will be,
    but also increases the chance of buffering.

    Default is 3.
    """
)
transport.add_argument(
    "--hls-segment-attempts",
    type=num(int, min=0),
    metavar="ATTEMPTS",
    help="""
    How many attempts should be done to download each HLS segment
    before giving up.

    Default is 3.
    """
)
transport.add_argument(
    "--hls-segment-threads",
    type=num(int, max=10),
    metavar="THREADS",
    help="""
    The size of the thread pool used to download HLS segments.
    Minimum value is 1 and maximum is 10.

    Default is 1.
    """
)
transport.add_argument(
    "--hls-segment-timeout",
    type=num(float, min=0),
    metavar="TIMEOUT",
    help="""
    HLS segment connect and read timeout.

    Default is 10.0.
    """)
transport.add_argument(
    "--hls-timeout",
    type=num(float, min=0),
    metavar="TIMEOUT",
    help="""
    Timeout for reading data from HLS streams.

    Default is 60.0.
    """)
transport.add_argument(
    "--http-stream-timeout",
    type=num(float, min=0),
    metavar="TIMEOUT",
    help="""
    Timeout for reading data from HTTP streams.

    Default is 60.0.
    """
)
transport.add_argument(
    "--ringbuffer-size",
    metavar="SIZE",
    type=filesize,
    help="""
    The maximum size of ringbuffer. Add a M or K suffix to specify mega
    or kilo bytes instead of bytes.

    The ringbuffer is used as a temporary storage between the stream
    and the player. This is to allows us to download the stream faster
    than the player wants to read it.

    The smaller the size, the higher chance of the player buffering
    if there are download speed dips and the higher size the more data
    we can use as a storage to catch up from speed dips.

    It also allows you to temporary pause as long as the ringbuffer
    doesn't get full since we continue to download the stream in the
    background.

    Note: A smaller size is recommended on lower end systems (such as
    Raspberry Pi) when playing stream types that require some extra
    processing (such as HDS) to avoid unnecessary background
    processing.

    Default is "16M".
    """)
transport.add_argument(
    "--rtmp-proxy", "--rtmpdump-proxy",
    metavar="PROXY",
    help="""
    A SOCKS proxy that RTMP streams will use.

    Example: 127.0.0.1:9050
    """
)
transport.add_argument(
    "--rtmp-rtmpdump", "--rtmpdump", "-r",
    metavar="FILENAME",
    help="""
    RTMPDump is used to access RTMP streams. You can specify the
    location of the rtmpdump executable if it is not in your PATH.

    Example: "/usr/local/bin/rtmpdump"
    """
)
transport.add_argument(
    "--rtmp-timeout",
    type=num(float, min=0),
    metavar="TIMEOUT",
    help="""
    Timeout for reading data from RTMP streams.

    Default is 60.0.
    """
)
transport.add_argument(
    "--stream-segment-attempts",
    type=num(int, min=0),
    metavar="ATTEMPTS",
    help="""
    How many attempts should be done to download each segment before giving up.

    This is generic option used by streams not covered by other options,
    such as stream protocols specific to plugins, e.g. UStream.

    Default is 3.
    """
)
transport.add_argument(
    "--stream-segment-threads",
    type=num(int, max=10),
    metavar="THREADS",
    help="""
    The size of the thread pool used to download segments.
    Minimum value is 1 and maximum is 10.

    This is generic option used by streams not covered by other options,
    such as stream protocols specific to plugins, e.g. UStream.

    Default is 1.
    """
)
transport.add_argument(
    "--stream-segment-timeout",
    type=num(float, min=0),
    metavar="TIMEOUT",
    help="""
    Segment connect and read timeout.

    This is generic option used by streams not covered by other options,
    such as stream protocols specific to plugins, e.g. UStream.

    Default is 10.0.
    """)
transport.add_argument(
    "--stream-timeout",
    type=num(float, min=0),
    metavar="TIMEOUT",
    help="""
    Timeout for reading data from streams.

    This is generic option used by streams not covered by other options,
    such as stream protocols specific to plugins, e.g. UStream.

    Default is 60.0.
    """)
transport.add_argument(
    "--stream-url",
    action="store_true",
    help="""
    If possible, translate the stream to a URL and print it.
    """
)
transport.add_argument(
    "--subprocess-cmdline", "--cmdline", "-c",
    action="store_true",
    help="""
    Print command-line used internally to play stream.

    This is only available on RTMP streams.
    """
)
transport.add_argument(
    "--subprocess-errorlog", "--errorlog", "-e",
    action="store_true",
    help="""
    Log possible errors from internal subprocesses to a temporary file.
    The file will be saved in your systems temporary directory.

    Useful when debugging rtmpdump related issues.
    """
)


http = parser.add_argument_group("HTTP options")
http.add_argument(
    "--http-proxy",
    metavar="HTTP_PROXY",
    help="""
    A HTTP proxy to use for all HTTP requests.

    Example: http://hostname:port/
    """
)
http.add_argument(
    "--https-proxy",
    metavar="HTTPS_PROXY",
    help="""
    A HTTPS capable proxy to use for all HTTPS requests.

    Example: http://hostname:port/
    """
)
http.add_argument(
    "--http-cookies",
    metavar="COOKIES",
    help="""
    A semi-colon delimited list of cookies to add to each HTTP
    request.

    For example this will add the cookies "foo" and "baz":

      "foo=bar; baz=qux"

    """
)
http.add_argument(
    "--http-headers",
    metavar="HEADERS",
    help="""
    A semi-colon delimited list of headers to add to each HTTP
    request.

    For example this will add the headers "X-Forwarded-For"
    and "User-Agent":

      "X-Forwarded-For=0.0.0.0; User-Agent=foo"

    """
)
http.add_argument(
    "--http-query-params",
    metavar="PARAMS",
    help="""
    A semi-colon delimited list of query parameters to add to each
    HTTP request.

    For example this will add the query parameters "foo" and "baz":

      "foo=bar; baz=qux"

    """
)
http.add_argument(
    "--http-ignore-env",
    action="store_true",
    help="""
    Ignore HTTP settings set in the environment such as environment
    variables (HTTP_PROXY, etc) or ~/.netrc authentication.
    """
)
http.add_argument(
    "--http-no-ssl-verify",
    action="store_true",
    help="""
    Don't attempt to verify SSL certificates.

    Usually a bad idea, only use this if you know what you're doing.
    """
)
http.add_argument(
    "--http-ssl-cert",
    metavar="FILENAME",
    help="""
    SSL certificate to use.

    Expects a .pem file.
    """
)
http.add_argument(
    "--http-ssl-cert-crt-key",
    metavar=("CRT_FILENAME", "KEY_FILENAME"),
    nargs=2,
    help="""
    SSL certificate to use.

    Expects a .crt and a .key file.
    """
)
http.add_argument(
    "--http-timeout",
    metavar="TIMEOUT",
    type=num(float, min=0),
    help="""
    General timeout used by all HTTP requests except the ones covered
    by other options.

    Default is 20.0.
    """
)


plugin = parser.add_argument_group("Plugin options")
plugin.add_argument(
    "--plugin-dirs",
    metavar="DIRECTORY",
    type=comma_list,
    help="""
    Attempts to load plugins from these directories.

    Multiple directories can be used by separating them with a
    semi-colon.
    """
)
plugin.add_argument(
    "--twitch-oauth-token",
    metavar="TOKEN",
    help="""
    An OAuth token to use for Twitch authentication.
    Use --twitch-oauth-authenticate to create a token.
    """
)
plugin.add_argument(
    "--twitch-oauth-authenticate",
    action="store_true",
    help="""
    Open a web browser where you can grant Livestreamer access
    to your Twitch account which creates a token for use with
    --twitch-oauth-token.
    """
)
plugin.add_argument(
    "--twitch-cookie",
    metavar="COOKIES",
    help="""
    Twitch cookies to authenticate to allow access to subscription channels.

    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.

    """
)
plugin.add_argument(
    "--ustream-password",
    metavar="PASSWORD",
    help="""
    A password to access password protected UStream.tv channels.
    """
)
plugin.add_argument(
    "--crunchyroll-username",
    metavar="USERNAME",
    help="""
    A Crunchyroll username to allow access to restricted streams.
    """
)
plugin.add_argument(
    "--crunchyroll-password",
    metavar="PASSWORD",
    nargs="?",
    const=True,
    default=None,
    help="""
    A Crunchyroll password for use with --crunchyroll-username.

    If left blank you will be prompted.
    """
)
plugin.add_argument(
    "--crunchyroll-purge-credentials",
    action="store_true",
    help="""
    Purge cached Crunchyroll credentials to initiate a new session
    and reauthenticate.
    """
)
plugin.add_argument(
    "--livestation-email",
    metavar="EMAIL",
    help="""
    A Livestation account email to access restricted or premium
    quality streams.
    """
)
plugin.add_argument(
    "--livestation-password",
    metavar="PASSWORD",
    help="""
    A Livestation account password to use with --livestation-email.
    """
)


# Deprecated options
stream.add_argument(
    "--best-stream-default",
    action="store_true",
    help=argparse.SUPPRESS
)
player.add_argument(
    "-q", "--quiet-player",
    action="store_true",
    help=argparse.SUPPRESS
)
transport.add_argument(
    "--hds-fragment-buffer",
    type=int,
    metavar="fragments",
    help=argparse.SUPPRESS
)
plugin.add_argument(
    "--jtv-legacy-names", "--twitch-legacy-names",
    action="store_true",
    help=argparse.SUPPRESS
)
plugin.add_argument(
    "--gomtv-cookie",
    metavar="cookie",
    help=argparse.SUPPRESS
)
plugin.add_argument(
    "--gomtv-username",
    metavar="username",
    help=argparse.SUPPRESS
)
plugin.add_argument(
    "--gomtv-password",
    metavar="password",
    nargs="?",
    const=True,
    default=None,
    help=argparse.SUPPRESS
)
plugin.add_argument(
    "--jtv-cookie",
    help=argparse.SUPPRESS
)
plugin.add_argument(
    "--jtv-password", "--twitch-password",
    help=argparse.SUPPRESS
)

__all__ = ["parser"]