Commit Graph

191 Commits

Author SHA1 Message Date
bastimeyer 24c59a2310 utils: split into submodules and fix imports
- move remaining methods from `streamlink.utils` to `streamlink.utils.*`
  - streamlink.utils.cache.LRUCache
  - streamlink.utils.data.search_dict
  - streamlink.utils.module.load_module
  - streamlink.utils.rtmp.{escape_librtmp,rtmpparse}
  - streamlink.utils.swf.swfdecompress
- fix imports in streamlink, streamlink_cli and tests
- move utils tests into new `tests.utils` package
  - split up `test_utils` into individual test modules
  - move and rename `test_utils_*`
  - move and rename `test_localization`
  - fix up some tests
2021-09-17 14:49:20 +00:00
bastimeyer 356367a5f6 cli: add {time:format} var to --output / --title 2021-09-04 22:01:18 -07:00
bastimeyer 67cf4e6caa cli: include plugin metadata in --json output
- Add `Plugin.get_metadata()` which returns a dict of all metadata.
- Add `metadata` property to list of all resolved streams, but merge
  all metadata properties with the specific stream output in order to
  not introduce a breaking change in the JSON output format.
2021-09-03 21:53:35 +02:00
bastimeyer fed76bde6c cli.console: refactor ConsoleOutput
- turn ask() and askpass() into regular instance methods
- use correct output stream in ask() and askpass()
- return None in ask() and askpass() if not a tty or on caught exception
- remove args/kwargs from msg(), exit(), ask() and askpass()
- merge multiple objects and keywords in msg_json()
2021-09-03 07:03:30 +02:00
bastimeyer 9daac8c9b4 cli.main: check args.json instead of console.json 2021-09-03 07:03:30 +02:00
bastimeyer 39aa1a87f0 cli.main: annotate types of global vars 2021-09-03 07:03:30 +02:00
bastimeyer fbb3b67328 cli.main: f-strings 2021-09-03 07:03:30 +02:00
bastimeyer 89b51a9e84 cli: player title and file output metadata vars
- support the same plugin metadata variables in `--output`, `--record`
  and `--record-and-pipe` like they already exist in `--title`:
  `{url}`, `{author}`, `{category}`/`{game}` and `{title}`
- substitute unsupported file name characters on specific OS-types
- add `--fs-safe-rules` CLI argument for overriding substitution logic
- add new Formatter class with caching and parameter translation
- create formatter instance in `handle_stream` and pass it to output
  methods where player titles or file names need to be formatted
- rewrite test_cli_main tests

Co-Authored-By: Ian Cameron <1661072+mkbloke@users.noreply.github.com>
2021-08-31 11:54:00 +02:00
bastimeyer db73cb2b00 docs: reorganize stream transport options
- subdivide into multiple categories
- reorder arguments and keep generic ones at the top
- rewrite, fix and improve certain argument help texts
2021-08-02 18:46:43 -07:00
bastimeyer ccdd84bf76 stream.hls: remove hls-segment-stream-data option
- always stream data from unencrypted segment downloads
- never stream data from cached initialization sections, as the
  response content can only be consumed once when stream=True
- update --twitch-low-latency plugin argument and its description
2021-07-31 20:45:44 +02:00
bastimeyer e253c4ba04 session: deprecate options for spec. stream types
Having multiple session options and CLI arguments for different stream
types which are already covered by generic options/arguments is not only
redundant, but also confusing.

A distinction between different stream types does only make sense when
multiple different stream types are available and the user needs to
explicitly set different values for each of them, but since it's not
always clear which stream type is returned when a stream is selected
via the "best" stream name synonym for example, this makes it even more
confusing. And it's redundant as well, since only one stream can be
selected anyway.

- deprecate `{dash,hds,hls}-segment-attempts`
  in favor of `stream-segment-attempts`
- deprecate `{dash,hds,hls}-segment-threads`
  in favor of `stream-segment-threads`
- deprecate `{dash,hds,hls}-segment-timeout`
  in favor of `stream-segment-timeout`
- deprecate `{dash,hds,hls,rtmp,http-stream}-timeout`
  in favor of `stream-timeout` (dash/http-stream were never used)
- fix `HTTPStream` and use `stream-timeout` instead of `http-timeout`
- suppress deprecated CLI arguments
- update help texts of generic CLI arguments
- fix docs and add entry to deprecations page
2021-07-31 09:09:45 +02:00
bastimeyer 6cdc3ebb14 cli: fix order of config file deprecation log msgs
- Don't log when loading a config from a deprecated path when using the
  `--config` argument
- Only load the first existing plugin-specific config file
- Keep config file loading order
- Add tests for setup_config_args
2021-06-09 17:05:48 +02:00
bastimeyer 79a4232e02 cli: deprecate old config files and plugin dirs
- wrap deprecated config and plugin paths in `DeprecatedPath`,
  subclassed from pathlib.Path
- log info messages when loading deprecated configs or plugins
- return success from `Streamlink.load_plugins(path)` to be able to
  log plugin loading messages in the main cli module
2021-06-09 17:05:48 +02:00
bastimeyer 3808688dfc cli: refactor CONFIG_FILES and PLUGIN_DIRS
- use pathlib.Path instead of strings
- rename PLUGINS_DIR to PLUGIN_DIRS and turn into list
- call expanduser() for all `--plugin-dirs` dirs
- reformat CLI docs
- fix tests
2021-06-06 11:50:33 -07:00
bastimeyer 1ed85fcb24 cli: implement --logfile
- refactor streamlink_cli.main.{setup_logging,setup_console}
  and split into setup_logger_and_console and setup_signals
- add LOG_DIR to streamlink_cli.constants
- pass filename to logger.basicConfig
- re-use write stream of logger in ConsoleOutput
- fix escaped chars for percent-formatted argparse help strings in docs
- add tests
2021-05-31 12:39:26 -07:00
bastimeyer 61ce720f7f tests: refactor TestCLIMainLogging
- always exit streamlink_cli.main.main at the same function call, namely
  log_current_arguments
- patch out dummy functions in context manager
- slice debug log mock calls due to common test exit function
- properly reset mocks
- rename streamlink_cli.main.check_root to log_root_warning
- add test for streamlink_cli.main.log_root_warning
2021-05-31 12:39:26 -07:00
bastimeyer c90d028294 utils.named_pipe: rewrite named pipes
- split into two classes with an abstract base class
- remove name parameter from class and generate proper names
- remove mode parameter from open() as it's always binary mode
- change type of NamedPipe.path from str to pathlib.Path
- add tests
2021-04-30 17:12:05 -07:00
bastimeyer d38e6fd221 cli: refactor log_current_versions and add tests 2021-03-21 11:44:09 -07:00
bastimeyer c0fb224035 cli: debug-log arguments set by the user 2021-03-21 11:44:09 -07:00
bastimeyer 6152a60143 session: implement --interface, --ipv4 and --ipv6 2021-02-02 08:59:35 -08:00
back-to 474325f8f1
cli.main: use *_args, **_kwargs for create_http_server (#3450)
use `127.0.0.1` for local `create_http_server()`
use `0.0.0.0` for external `create_http_server()`

`--player-http` = ***127.0.0.1***
https://streamlink.github.io/cli.html#cmdoption-player-http

`--player-continuous-http` = ***127.0.0.1***
https://streamlink.github.io/cli.html#cmdoption-player-continuous-http

`--player-external-http` = ***None*** / ***0.0.0.0***
https://streamlink.github.io/cli.html#cmdoption-player-external-http

---

we use `AF_INET` which is IPv4

https://github.com/streamlink/streamlink/blob/2.0.0/src/streamlink_cli/utils/http_server.py#L24

we don't use `AF_INET6` which is IPv6, so IPv6 support is unimportant.

Ref https://github.com/streamlink/streamlink/issues/2622#issuecomment-529408813

---

```
$ streamlink https://www.youtube.com/channel/UCSrZ3UV4jOidv8ppoVuvW9Q/live --player-http -l debug
...
[cli][info] Starting player: /usr/bin/mpv
[cli.output][debug] Opening subprocess: /usr/bin/mpv "--force-media-title=Euronews English Live" http://127.0.0.1:35085/
```

```
$ streamlink https://www.youtube.com/channel/UCSrZ3UV4jOidv8ppoVuvW9Q/live --player-continuous-http -l debug
...
[cli][info] Starting player: /usr/bin/mpv
[cli.output][debug] Opening subprocess: /usr/bin/mpv "--force-media-title=Euronews English Live" http://127.0.0.1:39099/
[cli][info] Got HTTP request from libmpv
```

```
$ streamlink https://www.youtube.com/channel/UCSrZ3UV4jOidv8ppoVuvW9Q/live --player-external-http --player-external-http-port 33333
[cli][info] Starting server, access with one of:
[cli][info]  http://127.0.0.1:33333/
[cli][info]  http://127.0.0.53:33333/
[cli][info]  http://127.0.1.1:33333/
[cli][info] Got HTTP request from Mozilla/5.0 ...
[cli][info] Opening stream: 720p (hls)
```
2020-12-26 17:02:57 +01:00
Billy2011 b2748a77c6
stream.ffmpegmux: add --ffmpeg-copyts option (#3404) 2020-12-16 17:52:10 +01:00
back-to 37bd9fc6c3
stream.ffmpegmux: disable -start_at_zero for -copyts as default (#3413)
- don't use `-start_at_zero` as default for `-copyts`
- revert https://github.com/streamlink/streamlink/pull/2559

- change command `--ffmpeg-no-start-at-zero` to `--ffmpeg-start-at-zero`
  (there was no release in between this command)

- use `--ffmpeg-start-at-zero` for the facebook plugin,
  because the original fix was for it.
  https://github.com/streamlink/streamlink/issues/2488
2020-12-15 16:57:50 +01:00
bastimeyer f5c19bb08f cli: move plugin args into their own args group
This adds a second layer of plugin argument groups, so that the docs can
show menu items for each plugin which makes finding them is easier.

- make the doc's argparse extension read argparse groups recursively
- override argparse.ArgumentParser.format_help and show nested groups
- fix/update tests
2020-12-10 11:57:53 -08:00
bastimeyer 5a6398afb1 chore: replace old errors classes with OSError
See PEP 3151
https://docs.python.org/3/library/exceptions.html#OSError
2020-11-27 16:04:45 +01:00
beardypig 568c89df5e
stream.ffmpegmux: Add support for specifying output file format and audio sync option (#2892)
The change is introducing two new optional command line options:

    `--ffmpeg-fout`: The output file format when muxing with ffmpeg
    '--ffmpeg-no-start-at-zero': When used with ffmpeg and copyts, disables automatically shifting input timestamps so they start at zero

Both options defaults are keeping the predefined values, hence backwards compatibility is enforced.

Co-Authored-By: beardypig <beardypig@protonmail.com>
Co-authored-by: Luigi Capriotti <l.capriotti@tiscali.it>
2020-11-23 18:29:26 +01:00
back-to 00b692951f cli.utils: remove named_pipe.py file, use streamlink.utils import
Remove old compatibility import and import named_pipe directly from streamlink.utils

Ref https://github.com/streamlink/streamlink/pull/411
2020-11-20 11:55:13 -08:00
bastimeyer bd86ab725a chore: remove old rtmpdump/subprocess CLI args
and remove compat key name translations in the Session options.

Removes the following CLI arguments:
- `--rtmpdump-proxy` (use `--rtmp-proxy` instead)
- `-c` / `--cmdline` (use `--subprocess-cmdline` instead)
- `-e` / `--errorlog` (use `--subprocess-errorlog` instead)
- `--erorlog-path` (use `--subprocess-errorlog-path` instead)

Keeps `--rtmpdump` as a fallback for `--rtmp-rtmpdump`, as the default
streamlinkrc config file of the Windows installer is still using the
old parameter name.
2020-11-19 21:05:42 +01:00
bastimeyer d08b169a3a plugins: turn mux-subtitles into a global argument
This removes the old plugin-specific arguments:
- `--funimation-mux-subtitles`
- `--pluzz-mux-subtitles`
- `--rtve-mux-subtitles`
- `--svtplay-mux-subtitles`
- `--vimeo-mux-subtitles`

and replaces it with a single global `--mux-subtitles` argument.

Also adds `mux-subtitles` to the Session options.
2020-11-14 08:54:28 +01:00
bastimeyer 9a961f6ddc plugin: implement global plugin arguments
- Add `is_global` parameter to `streamlink.options.Argument`
  Global plugin arguments reference Streamlink's global arguments by
  name and cannot receive any other parameters, like `required`, etc.
- In `streamlink_cli.main.setup_plugin_args`, find the global argument
  references of each plugin, set the available default values and add
  the plugin to the argument's `plugins` list, which will be read by
  the docs generator
- In `streamlink_cli.main.setup_plugin_options`, set the provided
  global argument values on the plugin's `options` dictionary
- Refactor docs/ext_argparse
  - Don't override argparse.ArgumentParser when importing the parser
  - Add list of supported plugins to the parameter description if the
    `plugins` list is set on the argparse action object
- Add/improve/fix tests
2020-11-14 08:54:28 +01:00
bastimeyer 9384f3df53 cli: add support for stream manifest URL output
This enables the output of the input-stream's manifest/master URL via
`streamlink --stream-url URL` / `streamlink --json URL`
in addition to the already supported output when selecting a stream via
`streamlink --stream-url URL STREAM` / `streamlink --json URL STREAM`

This is primarily helpful for HLS streams with a variant playlist.
2020-11-01 09:25:22 +01:00
bastimeyer fcda5b6814 chore: remove u-strings 2020-10-31 18:04:08 +01:00
beardypig a585e88297 chore: sort imports, fix a dependency cycle and use absolute imports
Co-authored-by: bastimeyer <mail@bastimeyer.de>
2020-10-27 17:17:49 +01:00
bastimeyer d8c8a0252a chore: remove deprecated CLI arguments 2020-10-21 19:08:23 -07:00
bastimeyer 70dc809b81 logger: refactor StringFormatter
- Format time via datetime.strftime instead of time.strftime
  This avoids needing to format the logrecord's msecs separately
- Change datefmt of trace level logging to "%H:%M:%S.%f"
- Remove redundant StringFormatter.format code
- Fix StringFormatter.usesTime() being called twice during format
- Calculate usesTime value only once (depends on format, not record)
- Add tests
2020-10-20 17:54:19 +02:00
bastimeyer 9ac40cb075 logger: remove deprecated compat logger
- remove old Logger and LoggerModule classes
- remove old {,Compat}LogRecord classes
- remove deprecated and unneeded methods from StreamlinkLogger
- remove usage of old Logger from Session
- remove session reference from ConsoleOutput
2020-10-20 17:53:07 +02:00
bastimeyer 6a6fcec014 chore: remove streamlink.utils.encoding 2020-10-19 17:28:47 +02:00
beardypig 3ded7943e9
cli: make config based args available during early setup (#3255)
As arguments can be loaded from a config file these need to be loaded as
soon as possible otherwise some options will not have the desired
effect. For example, `quiet` can be specified in `.streamlinkrc`,
however it will not take effect. With this change the default config
args are loaded earlier, however plugin specific config files are
still loaded later.

Options that will take effect from the config file now include:
 - `loglevel`
 - `json`
 - `stream_url`
 - `subprocess-cmdline`
 - `quiet`
 - `stdout`
 - `output`
 - `record-and-pipe`
 - `plugins-dir`

The plugin specific config option behaviour remains unchanged, and
`loglevel` is the only option that is affected.
2020-10-17 22:17:20 +02:00
bastimeyer bf1460c8c0 stream.hls: customizable playlist reload times
via --hls-playlist-reload-time
2020-07-26 17:56:32 -07:00
Sebastian Meyer f88ed24105
cli.main: fix msecs format in logging output (#3025) 2020-06-21 11:14:28 +02:00
beardypig a6fc475add cli.output: make sure the player arguments are properly encoded 2020-04-09 22:07:42 -07:00
bastimeyer b5ebd054e4 plugins.twitch: remove oauth token login 2020-03-26 14:36:47 +01:00
bastimeyer b627cb158a stream.hls: add hls-segment-stream-data parameter 2020-03-08 18:46:00 +01:00
back-to ab22df903f
cli: New command --force-progress (#2438)
show the download progress bar even if there is no terminal
2020-03-07 12:22:57 -08:00
bastimeyer b325aff98d flake8: E501
E501 line too long (... > 128 characters)
2020-02-23 09:53:55 +01:00
bastimeyer 4b17f96c90 flake8: F841
F841 local variable '...' is assigned to but never used
2020-02-19 21:18:15 +01:00
bastimeyer 13510807e4 flake8: E126, E127, E128
E126 continuation line over-indented for hanging indent
E127 continuation line over-indented for visual indent
E128 continuation line under-indented for visual indent
2020-02-19 18:41:42 +01:00
Juan Ramirez 07a9683b4f Too many arguments for logging format string 2019-07-25 23:19:04 -03:00
Juan Ramirez aa9d2afecf Invalid use of console.logger in CLI 2019-07-25 22:28:55 -03:00
aqxa1 536456866b Handle keyboard interrupts in can_handle_url checks (#2318)
These checks can take a long time in the case of a typo in the url, for example.
This sets the return code to 130 so that external scripts can handle it
correctly.
2019-05-25 07:49:40 +00:00
bastimeyer 688b830c3c Add force_verify=true to Twitch OAuth URL 2019-03-06 18:30:26 +01:00
Roman Kornev 71d550fedf cli.main: Add {url} argument to window --title (#2232)
closes https://github.com/streamlink/streamlink/issues/2225
2019-02-09 17:22:51 +00:00
Visatouch Deeying 0ceb764ed8 Fix crash on missing output.record when using player-continous-http
Add checking for record attribute in read_stream in order to prevent crashing
when start with player-continuous-http or player-external-http option
2019-01-09 09:23:10 +07:00
qkolj 07387e22d5 Fix recording added in #920 (#2152)
* Add a record option

Add a record option for recording a stream while also playing it.

* Fix recording added in #920 by @grazzolini

 - Remove `-r` as short option for `--rtmp-rtmpdump`

 - Add options `--record` (`-r`) and `--record-and-pipe` (`-R`) as suggested by @bastimeyer in discussion on #920

 - Add info message that the download started as suggested by @back-to in discussion on #920

 - Add tests for `streamlink_cli.main.create_output` where these arguments are used
2019-01-03 18:21:48 -08:00
Maxwell Cody 7156828489 Add ability to specify custom key URI override for HLS streams (#2139)
* cli: add arguments (hopefully) for custom key uri feature

* stream.hls: (hopefully) implement custom key uri feature

* cli: fix argument

* stream.hls: force hls segment key response encoding to 'binary/octet-stream' as per hls spec.
2018-12-08 12:38:37 -08:00
beardypig d022e9b8fd cli: disable progress output for -o when no tty is available (#2090)
* cli: disable progress output for -o when no tty is available

Changes to the behaviour of the progress bar when using -o.

If there is no tty available for output (eg. when piping, or running a
subprocess), then no progress bar is output. This is because the
progress bar rewrites the console, which is only possible on interactive
terminals not for a pipe.

If there is no tty available for input and the file already exists an
error is given instead of a prompt to the user.

* Updated tests
2018-10-23 11:44:05 -07:00
back-to cd6f94a5a4
Removed old Livestreamer deprecations and API references
- removed versionchange references as Streamlink does not use it.
- removed old code that was deprecated in Livestreamer
- removed DeprecatedWarning for 2.6 as it is already mentioned in 
`setup.py`
  
a14f170a04/setup.py (L82)
- removed unittest2
- Flake8 for some lines/files that I changed.
2018-08-04 16:31:09 +02:00
Hubcapp 5c3cf571ee Window Titles = Stream Titles + Other Attributes (#1576)
* Largely untested, introduces custom title attributes pulled from site APIs

Included is support for {title}, {category}/{game}, and {author}
   for Twitch and Youtube
Only tested (briefly) for Python 3 + Linux.
Committing to test on other platforms (Windows)

* bug-fix 1

* bug-fix 2

changing to list2cmdline turns out to not be necessary, since subprocess.call has already disabled the ability to break out by using `shell=False`
also broke launching on windows.

* bug-fix 3

move this to the pi3 area

* allow user to escape $ with \$

in case the user wants to use format codes.
comes at the expense of allowing streamers to insert format codes
that only appear for streamlink users, but is not a security risk
2018-07-11 11:52:17 -07:00
beardypig 9bf061e2e8
plugin args: if args are suppressed, ignore them 2018-06-30 23:59:17 +02:00
NyanKiyoshi 81086b6a87 Fix 404 error on oauth authorize url 2018-06-26 21:31:09 +02:00
beardypig 9d63e64bbc API for plugins to request input from the user (#1827)
* API for plugins to request input from the user

* console: handle lack of TTY for user input

* New fatal plugin error, for unrecoverable errors

* tests: remove deprecated calls
2018-06-21 16:15:21 -07:00
beardypig a744f022d0
logging: rename logger for main back to 'cli' 2018-06-11 10:28:23 +01:00
beardypig 9c5056e51c
logging: when using the trace level, log the timestamp 2018-06-05 19:02:02 +02:00
beardypig 6c14a39a21
logging: do not log when using quiet options (--json, --quiet, etc) 2018-06-04 11:49:40 +02:00
beardypig d652bea49a
logging: fixed issue with logging from plugins using logging module 2018-06-01 00:36:23 +02:00
beardypig 55fb48514c
logging: set the log level once the plugin config files have been loaded 2018-05-30 23:32:48 +02:00
beardypig c1489782cf MPEG DASH Support (initial) (#1637)
* stream.dash: parser for dash manifest files

* stream.dash: stream player for dash with plugin to support dash:// prefixed urls

* cli.main: make sure that streams are closed on errors

* stream.dash: fix some parsing bugs

* stream.dash: tidy up the segment number generation

* plugins.dash: wip segment timeline

* stream.dash: update to segment timeline parsing

* stream.dash: py3 support

* stream.dash: raise an error for DRM protected streams

* stream.dash: fixes for timescaling and some segment templates

* docs: add DASHStream to docs with other Stream classes

* dash: fix for video only stream

* plugins.dash: fix bug where all URLs were matched

* stream.dash: fix issue with manifest reload

* plugin.dash: add tests and fix a couple of bugs found in testing

* stream.dash: add some tests to cover the DASHStream classes

* WIP: audio only streams

* add some debugging for threads and remove the thread joins

* dash: startNumber should default to 1

* dash: follow redirects to get the base url

* dash: fix bool parser, and segment template parser

* dash: fixed some issues...

...with some segment templates, as well as improving the presentation
delay handling

* dash: add a back-off for checking for manifest changes

* dash: fix broken tests

* dash: incomplete support for Segment@r

* dash: fixed audio/video sync issue

Added a `copyts` option to the FFMPEG muxer class so that the timestamps
given in the source files are maintained, this appears to fix the a/v
sync issues.

NB. The timestamp can get weird, but that's how it is :)

* dash: support for Time _and_ Number in segment timeline

* tests: add some dash parser tests + a little refactor

* tests: add dash to built in plugins

* tests: more coverage of dash_parser

Added a new module for tests, `freezegun`, for mocking time.

* dash: fix for missing publishTime

* dash: update available_at times to be datetime

This should fix any timezone or leap-second issues, etc.

* fixed timing issue for 1tv.ru

* dash: fix availability timeline for segment timeline

* dash: flake8 tweaks

* dash: add a few debug logging messages
2018-05-30 12:30:38 -07:00
beardypig 60efe3bfd4 logging: refactor to use python logging module (#1690)
* logging: refactor to use python logging module

The logging output remains identical to before. The API has changed,
instead of passing a Logger instance around, a module level `log`
instance is used. This is the standard way to do logging in most Python
applications and module.

There are a number of advantages to doing this:
  1. more Pythonic
  2. easier to add logging message from utils and other methods without
     passing session or loggers around
  3. if required, log messages from other Python modules can be enabled
  4. the log destination could be changed to (or duplicated to)
     other places, syslog for example
  5. when other applications include streamlink they can get the
     streamlink logging message

* tests: refactor deprecated warnings for Session.logger

* logging: added Logger compatibility class

* fix issue in argparse docs

* fix rebase issue

* de-flaked
2018-05-29 18:15:11 -07:00
beardypig d7a27b31b0 Plugin Arguments API (#1638)
* plugins: PluginArguments API

Allow plugins to specify arguments within the Plugin class.
This makes it easier to add and test plugin specific arguments, as well
as enabling sideloaded plugins to support command line arguments.

* update docs build to work with the new plugin arguments

* fix argument name override for funimation and ustream

* add some more tests for options/arguments

* rebase with abweb plugin

* switch to RuntimeException for py2 compat

* fix bug where required arguments were not prompted

* bug fixes for option names in plugins, should match existing names

* restore "normal" exception messages

* missed a RecursionError -> RuntimeError

* updated the api slightly with better (I think) argument name

added some docs for the Argument and Arguments classes

* options/args: normalise option names to replace - with _, and ensure the defaults are set

* normalise the plugin module name, replacing _ with -

* style issues pointed out by @back-to

* plugin.btsports: update to use PluginArguments

* plugins.bbciplayer: add hd argument

* plugins.twitch: move --twitch-oauth-authenticate back to argparser

Moved the option back to argparser as it's a special case.

* test: fixed typo
2018-05-25 14:25:15 -07:00
beardypig 747d076e36
plugins.bbciplayer: enable HD for some channels and speed up start-up
New option added to enable HD streams for some live channels (BBC One,
BBC Two): `--bbciplayer-hd`. Note that not all programmes are
broadcast in HD.

Sped up the stream enumeration by ignoring duplicate manifest entries,
reduced number of stream looks from ~70 to ~8 on live streams.
2018-05-22 00:54:35 +02:00
beardypig 00a1604422 plugins.btsports: add plugin bt sports
also adds a util function to compare two URLs
2018-05-14 16:46:06 +02:00
back-to 4aa5121494 [ABweb] New plugin for BIS Livestreams of french AB Groupe (#1595)
* [ABweb] New plugin for BIS Livestreams of french AB Groupe

> AB Groupe
> The AB is a French business group in the field of broadcasting.
> https://en.wikipedia.org/wiki/AB_Groupe

Requires a login and a subscription.

Username/Password is only required for the first login every 24h,
it will cache the required cookies and force a relog every 24h.

```
$ streamlink
"http://www.abweb.com/BIS-TV-online/bistvo-tele-universal.aspx?chn=ab1"
best
[cli][info] Found matching plugin abweb for URL
http://www.abweb.com/BIS-TV-online/bistvo-tele-universal.aspx?chn=ab1
[plugin.abweb][info] Attempting to authenticate using cached cookies
[cli][info] Available streams: 75k (worst), 240p, 360p, 432p, 720p
(best)
[cli][info] Opening stream: 720p (hls)
[cli][info] Starting player: /usr/bin/vlc
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...
```

http://www.abweb.com/BIS-TV-Online/
http://www.abweb.com/BIS-TV-Online/bistvo-tele-universal.aspx

* [ABweb] set self._expires cache correctly

* [ABweb] changes for site update

A generated m3u8 url expires after 24h
2018-04-29 19:29:24 -07:00
Sean Greenslade f99c872a50 Added retry-max option to limit the number of fetch retries.
Also updated the documentation for --retry-streams and --retry-open, since the
wording was a bit unclear on how the two related.
2018-03-20 14:23:38 -07:00
back-to ed3175d47c [pixiv] New plugin for sketch.pixiv.net (#1550)
* [pixiv] New plugin for sketch.pixiv.net

Streams can be found at https://sketch.pixiv.net/lives

* [pixiv] Added login option
2018-03-16 15:52:08 -07:00
back-to a6f094e5b9
Removed some dead plugins and some Deprecated options
- removed --jtv and --gomtv commands
- removed websites that are dead
- removed websites that redirectes to a complete different website than the streamlink Plugin
  if someone still wants to use the new website,
  open a new Plugin Request the old websites are already broken for a long time.

| file | domain | status |
| --- | --- | --- |
| apac.py | a-pac.tv | redirected to different website |
| bambuser.py | bambuser.com | Bambuser community has ceased its services. |
| connectcast.py | connectcast.tv | 401 login - dead? |
| daisuki.py | daisuki.net | offline and redirected to different website |
| disney_de.py | disneychannel.de | redirected to different website - new website/domain |
| dmcloud.py | api.dmcloud.net | offline |
| dmcloud_embed.py | - | dmcloud is offline |
| gomexp.py | gomexp.com  | redirected to different website |
| streamupcom.py | streamup.com  | stay tuned since 2016 - dead |
| wattv.py | wat.tv | New website already covered by TF1 Plugin |
2018-03-10 13:50:45 +01:00
bastimeyer 6ea0e87b6d [neulion] Remove plugin. See #1493 2018-02-21 17:29:30 +01:00
back-to d7e47a155d
[afreeca] Plugin update.
- Login for +19 streams
  --afreeca-username
  --afreeca-password
- Removed 15 sec countdown
- Added some error messages
- Removed old Global AfreecaTV plugin
- Added url tests
2018-02-07 11:10:46 +01:00
Forrest 97ec633483
Merge pull request #1432 from back-to/hls_skip_ts
[hls] New option --hls-segment-ignore-names
2018-02-06 19:56:57 -08:00
Charlie Drage 0489b5d80c
Merge pull request #1374 from back-to/1323
[cli-debug] Show current installed versions with -l debug
2018-02-05 06:56:28 -05:00
back-to edad8fb023
[cli-debug] Renamed method and small template update 2018-01-16 19:11:58 +01:00
hicrop 55db9e0f1e PEP8 (#1427)
* E265 - Fix spacing after comment hash for block comments.

* W293 - Remove trailing whitespace on blank line.

* E305 - Add missing 2 blank lines after end of function or class.

* E123 - Align closing bracket to match opening bracket.

* E202 - Remove extraneous whitespace before bracket.

* Remaining fixes.
2018-01-15 18:49:52 -08:00
Forrest bcc7798ba7
Merge pull request #1406 from back-to/neulion
[neulion] Updated the ufctv plugin to make it useable for other domains
2018-01-15 09:31:08 -08:00
back-to 39d81e3327
[hls] New option --hls-segment-ignore-names
You can ignore segment names that might corrupt or lag your output

- this will freeze the player until there is a valid segment name
- this will not add the segment to an output file,
  so it won't be damaged and can be edited.

Note: The `--hls-timeout` must be increased, to a time that is longer
than the ignored break.

Example:
`streamlink URL best --hls-segment-ignore-names 000,001,002
--hls-timeout 1200`

This will ignore every segment that ends with 000.ts, 001.ts and 002.ts
2018-01-13 23:44:18 +01:00
Forrest 225193baf8
Merge pull request #1303 from beardypig/hls-skip
HLS "Seeking" support
2018-01-04 09:31:04 -08:00
back-to ba893e618b
[neulion] Updated the ufctv plugin to make it useable for other domains
[neulion] Added fallback for js_to_json and for get_info

            [neulion] Replace ' with " in js_to_json, show Login required for 400 error in _get_stream_url

            [neulion] Updated the ufctv plugin to make it useable for other domains

            - Fixed KeyError if there is no 'type' in the result data

            - --ufctv-username and --ufctv-password can still be used,
              but the new command is --neulion-username --neulion-password

            ```
            https://fanpass.co.nz - Tested
            https://watch.nba.com - only free Video Tested
            https://watch.rugbypass.com - Not Tested
            https://www.elevensports.be - only free Video Tested
            https://www.elevensports.lu - only free Video Tested
            https://www.elevensports.pl - only free Video Tested
            https://www.elevensports.sg - Tested
            https://www.elevensports.tw - Tested
            https://www.tennischanneleverywhere.com - Tested
            https://www.ufc.tv - Tested
            ```
2018-01-03 20:12:31 +01:00
back-to 52d4163592
[cli-debug] Show current installed versions with -l debug
Maybe not exactly what was requested, but this won't break any third
party applications

Example:

```
[cli][debug] OS:         Linux-4.14.4-1-ARCH-x86_64-with-arch
[cli][debug] Python:     3.6.3
[cli][debug] Streamlink: 0.9.0
[cli][debug] Requests(2.18.4), Socks(1.6.7), Websocket(0.44.0)
```
Fixed https://github.com/streamlink/streamlink/issues/1323
2017-12-13 19:12:03 +01:00
back-to d24604edc8 Ignore WinError 10053 / WSAECONNABORTED
A nice solution for this error was found in gevent/gevent#1000

Fixed streamlink/streamlink#916
Fixed streamlink/streamlink#975
Fixed streamlink/streamlink#1236

Maybe this will help streamlink/streamlink-twitch-gui#467
2017-11-07 16:47:08 +01:00
beardypig 2fed8a8567 stream.hls: remove the end offset and replace with duration
The `--hls-duration` option specifies the length of the stream to play in hh:mm:ss. The option has no effect on live streams.
2017-11-01 15:29:24 +01:00
beardypig 1432cb40f2 stream.hls: add option to restart live stream, if possible 2017-11-01 15:29:24 +01:00
beardypig f59e8ea07c stream.hls: add options to skip some time at the start/end of VOD streams 2017-11-01 15:29:24 +01:00
Jake Robertson 652962b8cf unify sys.exit() calls 2017-09-29 09:06:24 -04:00
Jake Robertson 25d044bdb6 refactor error code determination 2017-09-29 08:43:39 -04:00
Jake Robertson b6939dc8e1 exit with code 130 after a KeyboardInterrupt 2017-09-28 23:35:32 -04:00
beardypig 3e85f8128c cli: remove the deprecation warnings for some of the http options
The deprecation warning has been removed from the
--http-{cookies,headers,query-params} options. The options are not
listed in the help or in the docs, but they will continue to work.

They should be considered unsupported.
2017-07-27 16:26:20 +01:00
back-to 527cef71f5 [zattoo] New plugin for zattoo.com / tvonline.ewe.de / nettv.netcologne.com (#1039)
* [zatto] New plugin for zattoo.com / tvonline.ewe.de / nettv.netcologne.com

* [zattoo] Better debug/error messages and use channel as cid if no cid.

streamlink/streamlink#804

* Fixed travis 20 character limit error and removed tabs from other plugins

/home/travis/build/streamlink/streamlink/docs/plugin_matrix.rst:265: (ERROR/3) Malformed table.
Text in column margin in table line 254.

* [zattoo] --zattoo-purge-credentials

You can reset your session with --zattoo-purge-credentials
2017-06-30 18:56:44 -07:00
beardypig 2a4095b596 plugin.ufctv: support for free and premium vod/live streams
Add two new arguments to support authentication:
    - `--ufctv-username`: The username used to register with ufc.tv.
    - `--ufctv-password`: A ufc.tv account password to use with
                          --ufctv-username.
2017-06-23 12:38:00 +01:00
Mohamed El Morabity 6c2170a83c Rebase 2017-05-27 12:35:07 +02:00
beardypig 557b0d4c05 plugins.bbciplayer: add option to login to a bbc account
As logging in will soon become a requirement, this PR lays the ground
work for that change. The login is not currently enforced, when it is
the plugin will need to be updated again.
2017-05-16 14:09:33 +01:00
Mohamed El Morabity 8f6a0fe8b9 Drop pcyourfreetv plugin 2017-05-10 21:24:40 +02:00
Forrest 93b64363c3 Merge pull request #809 from beardypig/url-param
cli: add --url option that can be used in config files to set a URL
2017-04-19 09:12:03 -07:00