Skip to content

utils.parse: fix ignore_ns in parse_xml #4075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

bastimeyer
Copy link
Member

Fixes #4074

What's broken is the regex for removing the namespace data, which expects a leading space or tab character, which doesn't work when a new-line or a different whitespace character is used in the serialized XML content. I've added another test for that.

There's probably a better solution for stripping default namespace information than using a dirty regex substitution, but this simple fix should work for now (and I don't want to re-implement the parse_xml method).
https://lxml.de/parsing.html#parsers

@gravyboat gravyboat merged commit b311b2c into streamlink:master Oct 7, 2021
@bastimeyer bastimeyer deleted the utils/parse/xml branch October 7, 2021 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dash plugin: MPDParsingError: root tag did not match the expected tag: MPD
2 participants