File: deprecations.rst

package info (click to toggle)
streamlink 8.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,568 kB
  • sloc: python: 51,299; sh: 184; makefile: 152
file content (385 lines) | stat: -rw-r--r-- 13,518 bytes parent folder | download | duplicates (2)
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
Deprecations
============

streamlink 8.1.0
----------------

--hls-segment-queue-threshold
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``--hls-segment-queue-threshold`` CLI argument has been deprecated in favor of :option:`--stream-segmented-queue-deadline`.


streamlink 8.0.0
----------------

--hls-duration
^^^^^^^^^^^^^^

The ``--hls-duration`` CLI argument has been deprecated in favor of :option:`--stream-segmented-duration`,
which affects all kinds of segmented streams, not just HLS streams.


streamlink 7.0.0
----------------

--verbose-player
^^^^^^^^^^^^^^^^

The ``--verbose-player`` CLI argument has been deprecated in favor of :option:`--player-verbose`.

--fifo
^^^^^^

The ``--fifo`` CLI argument has been deprecated in favor of :option:`--player-fifo`.


streamlink 6.11.0
-----------------

-R/--record-and-pipe
^^^^^^^^^^^^^^^^^^^^

The ``-R``/``--record-and-pipe`` CLI argument has been deprecated in favor of using both
:option:`--stdout` and :option:`--record` arguments at the same time.


streamlink 6.8.0
----------------

streamlink.plugins re-exports
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:bdg-ref-danger:`Removed in 7.0.0 <migrations:streamlink.plugins re-exports>`

Importing :class:`NoPluginError <streamlink.exceptions.NoPluginError>`,
:class:`NoStreamsError <streamlink.exceptions.NoStreamsError>`, :class:`PluginError <streamlink.exceptions.PluginError>`,
or :class:`Plugin <streamlink.plugin.plugin.Plugin>` from ``streamlink.plugins`` now emits
a :exc:`StreamlinkDeprecationWarning`. These re-exports have already been deprecated for more than ten years
and will finally be removed in the next major version. Import from the correct paths instead.


streamlink 6.7.0
----------------

--plugin-dirs
^^^^^^^^^^^^^

The ``--plugin-dirs`` CLI argument for sideloading plugins from one or more custom directories, separated by commas,
has been deprecated in favor of the newly added :option:`--plugin-dir` CLI argument, which only takes a single path,
but can be set multiple times for loading plugins from more than one path.


streamlink 6.6.0
----------------

HTTPSession and HTTPAdapters
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:bdg-ref-danger:`Removed in 7.0.0 <migrations:HTTPSession and HTTPAdapters>`

The module structure of the :class:`Streamlink <streamlink.session.Streamlink>` session implementation and related classes
like the ``HTTPSession`` has been re-organized.

Importing ``HTTPSession`` from either ``streamlink.plugin.api`` or ``streamlink.plugin.api.http_session`` is now deprecated.
It was never intended to import this class directly. Plugin implementors should always reference the session's ``HTTPSession``
instance via the :attr:`Streamlink.http <streamlink.session.Streamlink.http>` attribute.

In addition, importing ``TLSNoDHAdapter`` or ``TLSSecLevel1Adapter`` from ``streamlink.plugin.api.http_session`` is now also
deprecated. Import from the ``streamlink.session.http`` module instead, if actually necessary.

Streamlink.{get,load}_plugins()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As a result of the code refactoring mentioned above, the following plugins-related methods
on the :class:`Streamlink <streamlink.session.Streamlink>` session class have been deprecated:

``Streamlink.get_plugins()`` has been deprecated in favor of
:meth:`Streamlink.plugins.get_loaded() <streamlink.session.plugins.StreamlinkPlugins.get_loaded>`.

``Streamlink.load_plugins(path)`` has been deprecated in favor of
:meth:`Streamlink.plugins.load_path(path) <streamlink.session.plugins.StreamlinkPlugins.load_path>`.

``Streamlink.load_builtin_plugins()`` has been deprecated in favor of using
the :class:`plugins_builtin <streamlink.session.Streamlink>` Streamlink session keyword argument.
The old method was never publicly documented and was only used internally upon initialization.


streamlink 5.4.0
----------------

--force-progress
^^^^^^^^^^^^^^^^

:bdg-ref-danger:`Removed in 7.0.0 <migrations:--force-progress>`

The ``--force-progress`` CLI argument has been deprecated in favor of :option:`--progress=force`.


streamlink 5.3.0
----------------

Global plugin arguments
^^^^^^^^^^^^^^^^^^^^^^^

:bdg-ref-danger:`Removed in 6.0.0 <migrations:Global plugin arguments>`

The ``is_global=True`` :py:class:`plugin argument <streamlink.options.Argument>` parameter has been deprecated.
Instead of defining a global plugin argument to set a key-value pair on the plugin's options, use the respective option on
the plugin's Streamlink session instance instead.


streamlink 5.2.0
----------------

plugin.api.validate.text
^^^^^^^^^^^^^^^^^^^^^^^^

:bdg-ref-danger:`Removed in 6.0.0 <migrations:plugin.api.validate.text>`

The ``plugin.api.validate.text`` alias for ``str`` has been marked as deprecated, as it is a remnant of the py2 implementation.
Simply replace ``validate.text`` with ``str`` in each validation schema.


streamlink 5.0.0
----------------

Plugin.__init__(self, url) compatibility wrapper
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:bdg-ref-danger:`Removed in 6.0.0 <migrations:Plugin.__init__(self, url) compatibility wrapper>`

With the removal of the ``Plugin.bind()`` class method which was used for setting up the
:py:class:`Streamlink <streamlink.session.Streamlink>` session instance and module name in each plugin class,
the :py:class:`Plugin <streamlink.plugin.Plugin>` constructor's signature was changed and it now requires
the ``session`` and ``url`` arguments. Implementors of custom plugins should define variable positional arguments and keyword
arguments when subclassing and adding a custom constructor (``*args, **kwargs``), and the ``url`` should be accessed via
``self.url`` after calling the constructor of the super class.

Compatibility wrappers were added for old custom plugin implementations, and a deprecation message will be shown until
the compatibility wrappers will get removed in a future release.


streamlink 4.2.0
----------------

url_master in HLSStream
^^^^^^^^^^^^^^^^^^^^^^^

:bdg-ref-danger:`Removed in 8.0.0 <migrations:HLSStream url_master argument>`

The ``url_master`` parameter and attribute of the :class:`HLSStream <streamlink.stream.HLSStream>`
and :class:`MuxedHLSStream <streamlink.stream.MuxedHLSStream>` classes have been deprecated in favor of
the ``multivariant`` parameter and attribute. ``multivariant`` is an :class:`M3U8` reference of the parsed
HLS multivariant playlist.


streamlink 3.0.0
----------------

https-proxy option
^^^^^^^^^^^^^^^^^^

:ref:`HTTPS proxy CLI option <cli:HTTP options>` and the respective :ref:`Session options <api/session:Session>`
have been deprecated in favor of a single :option:`--http-proxy` that sets the proxy for all HTTP and
HTTPS requests, including WebSocket connections.


streamlink 2.4.0
----------------

Stream-type related CLI arguments
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:bdg-ref-danger:`Removed in 7.0.0 <migrations:Stream-type related CLI arguments>`

:ref:`Stream-type related CLI arguments <cli:Stream transport options>` and the respective
:ref:`Session options <api/session:Session>` have been deprecated in favor of existing generic arguments/options,
to avoid redundancy and potential confusion.

- use :option:`--stream-segment-attempts` instead of ``--{dash,hds,hls}-segment-attempts``
- use :option:`--stream-segment-threads` instead of ``--{dash,hds,hls}-segment-threads``
- use :option:`--stream-segment-timeout` instead of ``--{dash,hds,hls}-segment-timeout``
- use :option:`--stream-timeout` instead of ``--{dash,hds,hls,rtmp,http-stream}-timeout``


streamlink 2.3.0
----------------

Plugin.can_handle_url() and Plugin.priority()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:bdg-ref-danger:`Removed in 6.0.0 <migrations:Plugin.can_handle_url() and Plugin.priority()>`

A new plugin URL matching API was introduced in 2.3.0 which will help Streamlink with static code analysis and an improved
plugin loading mechanism in the future. Plugins now define their matching URLs and priorities declaratively.

The old ``can_handle_url`` and ``priority`` classmethods have therefore been deprecated and will be removed in the future.
When side-loading plugins which don't implement the new ``@pluginmatcher`` but implement the old classmethods, a deprecation
message will be written to the info log output for the first plugin that gets resolved this way.

**Deprecated plugin URL matching**

.. code-block:: python

   import re
   from streamlink.plugin import Plugin
   from streamlink.plugin.plugin import HIGH_PRIORITY, NORMAL_PRIORITY

   class MyPlugin(Plugin):
       _re_url_one = re.compile(
           r"https?://pattern-(?P<param>one)"
       )
       _re_url_two = re.compile(r"""
           https?://pattern-(?P<param>two)
       """, re.VERBOSE)

       @classmethod
       def can_handle_url(cls, url: str) -> bool:
           return cls._re_url_one.match(url) is not None \
                  or cls._re_url_two.match(url) is not None

       @classmethod
       def priority(cls, url: str) -> int:
           if cls._re_url_two.match(url) is not None:
               return HIGH_PRIORITY
           else:
               return NORMAL_PRIORITY

       def _get_streams(self):
           match_one = self._re_url_one.match(self.url)
           match_two = self._re_url_two.match(self.url)
           match = match_one or match_two
           param = match.group("param")
           if match_one:
               yield ...
           elif match_two:
               yield ...

   __plugin__ = MyPlugin

**Migration**

.. code-block:: python

   import re
   from streamlink.plugin import HIGH_PRIORITY, Plugin, pluginmatcher

   @pluginmatcher(re.compile(
       r"https?://pattern-(?P<param>one)"
   ))
   @pluginmatcher(priority=HIGH_PRIORITY, pattern=re.compile(r"""
       https?://pattern-(?P<param>two)
   """, re.VERBOSE))
   class MyPlugin(Plugin):
      def _get_streams(self):
          param = self.match.group("param")
          if self.matches[0]:
              yield ...
          elif self.matches[1]:
              yield ...

   __plugin__ = MyPlugin

.. note::

   Plugins which have more sophisticated logic in their ``can_handle_url()`` classmethod need to be rewritten with
   multiple ``@pluginmatcher`` decorators and/or an improved ``_get_streams()`` method which returns ``None`` or raises a
   ``NoStreamsError`` when there are no streams to be found on that particular URL.


streamlink 2.2.0
----------------

Config file paths
^^^^^^^^^^^^^^^^^

:bdg-ref-danger:`Removed in 7.0.0 <migrations:Config file paths>`

Streamlink's default config file paths got updated and corrected on Linux/BSD, macOS and Windows.
Old and deprecated paths will be dropped in the future.

Only the first existing config file will be loaded. If a config file gets loaded from a deprecated path,
a deprecation message will be written to the info log output.

To resolve this, move the config file(s) to the correct location or copy the contents of the old file(s) to the new one(s).

.. note::

   Please note that this also affects all plugin config files, as they use the same path as the primary config file but with
   ``.pluginname`` appended to the file name, eg. ``config.twitch``.

.. warning::

   **On Windows**, when installing Streamlink via the Windows installer, a default config file gets created automatically due
   to technical reasons (bundled ffmpeg and rtmpdump dependencies). This means that the Windows installer will create a
   config file with the new name when upgrading from an earlier version to Streamlink 2.2.0+, and the old config file won't be
   loaded as a result of this.

   This is unfortunately a soft breaking change, as the Windows installer is not supposed to touch user config data and the
   users are required to update this by themselves.

**Deprecated paths**

.. list-table::
    :header-rows: 1
    :class: table-custom-layout table-custom-layout-platform-locations

    * - Platform
      - Location
    * - Linux/BSD
      - - ``${HOME}/.streamlinkrc``
    * - macOS
      - - ``${XDG_CONFIG_HOME:-${HOME}/.config}/streamlink/config``
        - ``${HOME}/.streamlinkrc``
    * - Windows
      - - ``%APPDATA%\streamlink\streamlinkrc``

**Migration**

.. list-table::
    :header-rows: 1
    :class: table-custom-layout table-custom-layout-platform-locations

    * - Platform
      - Location
    * - Linux/BSD
      - ``${XDG_CONFIG_HOME:-${HOME}/.config}/streamlink/config``
    * - macOS
      - ``${HOME}/Library/ApplicationĀ Support/streamlink/config``
    * - Windows
      - ``%APPDATA%\streamlink\config``

Custom plugins sideloading paths
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:bdg-ref-danger:`Removed in 7.0.0 <migrations:Custom plugins sideloading paths>`

Streamlink's default custom plugins directory path got updated and corrected on Linux/BSD and macOS.
Old and deprecated paths will be dropped in the future.

**Deprecated paths**

.. list-table::
    :header-rows: 1
    :class: table-custom-layout table-custom-layout-platform-locations

    * - Platform
      - Location
    * - Linux/BSD
      - ``${XDG_CONFIG_HOME:-${HOME}/.config}/streamlink/plugins``
    * - macOS
      - ``${XDG_CONFIG_HOME:-${HOME}/.config}/streamlink/plugins``

**Migration**

.. list-table::
    :header-rows: 1
    :class: table-custom-layout table-custom-layout-platform-locations

    * - Platform
      - Location
    * - Linux/BSD
      - ``${XDG_DATA_HOME:-${HOME}/.local/share}/streamlink/plugins``
    * - macOS
      - ``${HOME}/Library/ApplicationĀ Support/streamlink/plugins``