Skip to content

Remove streamlink.plugin.api.utils.itertags #4455

@bastimeyer

Description

@bastimeyer

streamlink.plugin.api.utils.itertags has become obsolete ever since lxml was added as a dependency to Streamlink for parsing HTML.

itertags is a hacky implementation via regexes, which is not only slow, but it's also impossible to correctly parse HTML nodes with regular expressions, so it shouldn't be used when better and much faster solutions are available. It also always requires unescaping tag values, which is annoying.

We've already updated and replaced lots of plugins which were previously using it, but there are still some left:

$ GIT_PAGER=cat git grep -F 'from streamlink.plugin.api.utils import' a1ce471f
a1ce471f:src/streamlink/plugins/cdnbg.py:from streamlink.plugin.api.utils import itertags
a1ce471f:src/streamlink/plugins/facebook.py:from streamlink.plugin.api.utils import itertags
a1ce471f:src/streamlink/plugins/funimationnow.py:from streamlink.plugin.api.utils import itertags
a1ce471f:src/streamlink/plugins/senategov.py:from streamlink.plugin.api.utils import itertags
a1ce471f:src/streamlink/plugins/vrtbe.py:from streamlink.plugin.api.utils import itertags
a1ce471f:tests/test_plugin_utils.py:from streamlink.plugin.api.utils import itertags
  • cdnbg
  • facebook
  • funimationnow
  • senategov
  • vrtbe

Once every last plugin has been updated, the entire streamlink.plugin.api.utils module can be removed, as it only contains the itertags function and some other useless export aliases which are not even used anymore in Streamlink's codebase.

If we care about plugin-API stability (something which has never been discussed), removing this would be considered a breaking change. Since we've just dropped py36, that's something which could be included in the 4.0.0 release.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions