bastimeyer · GitHub

Resolves #3944

This adds the lxml dependency for parsing XML and HTML to Streamlink's install_requires.

There's also the lxml-stubs package available on pypi for adding type definitions which are lacking in the lxml package, but I don't know how this external package works. I'm using pycharm professional and it's generating types from the docs automatically (not that well though). lxml-stubs is supposed to go into dev-requirements.txt I think. Should this be added?


The validation methods and parse_xml utility method have not been modified yet and are still using the standard library methods for parsing XML. DASH streams and the validation methods (which are only called one single plugin - rtve) are therefore not affected.

I've tried to update the methods, but ran into encoding issues while reading XML from strings (utf-8) with a custom encoding set in the XML declaration (<?xml version="..." encoding="..."?>). This needs some refactoring first.


As an example on how XPath queries massively simplify plugins in a safe way, take a look at this diff:
bastimeyer/streamlink@ requirements/lxml...bastimeyer:plugins/deutschewelle/rewrite-xpath

Read the original on github.com ↗