Skip to content

Conversation

@bastimeyer
Copy link
Member

That should be the last plugin schema updates from me for now. As said on the streamlink Gitter channel, there are a couple of validation schemas left that could be refined according to the newly added stuff, but there are some problems.

$ GIT_PAGER=cat git grep -Pn --heading \
  -e 'validate\.any\(\s*None,\s*validate\.all\(' \
  -e 'validate\.transform\(\s*.+?\.search\s*\)' \
  -e 'validate\.validate\(' \
  -e 're\.Match,' \
  -e ',\s+validate\.Schema\(' \
  src/streamlink/plugins/

src/streamlink/plugins/ard_mediathek.py
75:                validate.any(None, validate.all(
81:                        "show": validate.any(None, validate.all(
src/streamlink/plugins/common_jwplayer.py
12:    validate.transform(_playlist_re.search),
src/streamlink/plugins/rtbf.py
59:        validate.transform(_video_stream_data_re.search),
src/streamlink/plugins/schoolism.py
31:        validate.transform(playlist_re.search),
src/streamlink/plugins/vimeo.py
30:        validate.transform(_config_url_re.search),
59:        validate.transform(_config_re.search),
60:        validate.any(None, validate.Schema(validate.get(1), _config_schema)),

common_jwplayer

That can be removed. It's not used by any plugin, and if 3rd party plugins import from that module, then they can re-implement it.

vimeo

There's already a PR for that plugin.

rtbf

I have local changes for that, but I don't want to submit a PR, as I can't test it. The site requires a registration with a Belgian address. The current implementation is most likely broken.

schoolism

I've got local changes for that plugin as well, but I haven't tested it yet, as it requires having an account. Maybe I'll take a look at this later, but not now.

ard_mediathek

Forgot to stage some changes after stashing and rebasing all the plugin changes a couple of times. Won't open another PR for that.


And then there are tons of other plugins with bad validation schema definitions and bad code styles. Fixing and updating those was not the plan in my recent changes.

instead of validate.validate(schema, value) in various plugins, so that
a proper PluginError gets raised on failure instead of a ValidationError
@gravyboat gravyboat merged commit 4088bcd into streamlink:master Aug 7, 2022
@bastimeyer bastimeyer deleted the plugins/validate-schema branch August 7, 2022 20:28
Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request Aug 12, 2022
instead of validate.validate(schema, value) in various plugins, so that
a proper PluginError gets raised on failure instead of a ValidationError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants