- Add mypy and available typing stubs to dev-requirements
- Add mypy config
- Add py.typed to streamlink + streamlink_cli packages (PEP 561):
This is required, so that mypy can import types from streamlink when
installed in editable mode. Don't publish this file for now.
Once various streamlink APIs are properly typed, typing stub files
can be added instead.
- Generate a mapping of tags->callbacks on parser init once
and cache mapping as class attribute (avoid parent class lookups)
- Performance: look up tags in cached mapping in `parse_line()`
- Re-order `parse_tag_...` methods by definition order of RFC 8216
- Add docstring to each `parse_tag_...` method with link to RFC 8216
- Add typing annotations to each `parse_tag_...` method
- Fix minor typing issues in regards to optional URIs in Key and Media
and update parse methods accordingly
- Pass keywords to various named tuples instead of positional args
- Catch ValueError when decrypting and unpadding segments, as well as
other exceptions that can be raised when downloading the segment,
similar to unencrypted segments, and log error messages accordingly.
Don't close the stream on any of those errors.
- Remove garbage data truncation from encrypted segments:
This was (most likely) implemented because of an old issue related to
Content-Length HTTP headers not being handled correctly, leading to
partial segment downloads. Cutting off data that doesn't fit into the
AES block size doesn't make sense, as it implies that the segment data
incomplete, and incomplete segment data misses its padding bytes at
the end which must always be included.
- Update tests
- Change format of Stream string representations and error messages
of `to_url` and `to_manifest_url`
- Don't override `__repr__` in `Stream` subclasses
- Raise TypeError if url or manifest URL is None
- Fix CLI
- Abort passthrough if stream can't be translated to URL
- Remove unneeded streamlink_cli.utils.stream module
- Rewrite stream URL tests
- Move FilmOnHLS stream URL tests to plugin test module (and rewrite)
- Import urllib3 directly instead of importing from requests.packages
- Remove unneeded urllib3.contrib.pyopenssl.DEFAULT_SSL_CIPHER_LIST
override, as it's not used on py3
- Update ipv4/ipv6 tests, add http-disable-dh tests
When running test as root, there is an additional log done to warn the
user that it is running streamlink as root. This causes some logging
tests to fail.
For these logging test, ensure we run with a mocked user euid when not
testing for the root euid.
* update params for Windows app
* remove Android headers
* fix device_id cached value
* add id to metadata
* minor spelling corrections
* add support for beta URLs
* update tests
* update cache.set() calls to use expires kw
* update expires_at=0 to expires=0
- Change signature of `ValidationError` to be able to pass template
strings and template variables which can get truncated individually.
- Make error messages consistent by using string representations for
template variables where it makes sense
- Implement `ValidationError`
- Inherit from `ValueError` to preserve backwards compatiblity
- Allow collecting multiple errors (AnySchema)
- Keep an error stack of parent `ValidationError`s or other exceptions
- Format error stack when converting error to string
- Raise `ValidationError` instead of `ValueError`
- Add error contexts where it makes sense
- Add schema names to error instances
- Add and update tests
Turn module into package with multiple logical sub-modules:
- Define a public interface in the package's `__init__` module
- Split validation schemas, validators and validate logic
- schemas: classes which register attributes used by their
respective `validate` implementations
- validators: functions which can internally call `validate`
and which return something that can be validated
- validate: singledispatch functions which implement the validation
logic for schemas and various other types
- Rename validation schemas for better internal references
- Rename singledispatch methods
Other clean-up work:
- Update comments and fix grammar
- Add type annotations
- Use f-strings
- Use `str` instead of the `text` alias
- Simplify some code blocks
- Rearrange classes and functions
- Rephrase certain error messages
- Add a few more tests for better code coverage
Remove callable check from the base validate singledispatch function
and register the abc.Callable type instead.
Also fix type validation in the transform schema.
- Completely rewrite GitHub release script
- Remove --dry-run and make it implicit when no API key is set
- Remove --api-key and read from RELEASES_API_KEY or GITHUB_TOKEN
- Add --template, --changelog, --no-contributors and --no-shortlog
- Refactor GitHub API stuff
- Update release template logic and use Jinja2
- Get list of contributors (with support for commit co-authors):
GitHub highlights usernames in releases, which this is meant for
- Generate git shortlog automatically
- Always close open file handles
- Update release template based on Jinja2 logic
- Update release CI job
- Install Jinja2
- Upgrade Python to 3.10 and setup-python to v2
- Fetch entire repo
- Don't upload wheels to GitHub releases