Skip to content

stream: switch to sub-packages #5593

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 4 commits into from
Oct 8, 2023

Conversation

bastimeyer
Copy link
Member

#5498

This moves the various stream implementations into dedicated sub-packages, for having a cleaner separation of different stream types, as well as for being able to define the BaseSegment in the upcoming PR in a dedicated module. This PR therefore basically just moves the module files and updates the import paths (and mock paths in tests). I decided against naming the individual modules of those sub-packages with a leading underscore character.

As a side effect of moving the modules, and I'm not sure whether I like it, the logger names have changed as well (due to the __name__ reference). Example: stream.hls -> stream.hls.hls and stream.hls_playlist -> stream.hls.m3u8.

I believe it'd be better to override/revert the redundant logger names, which are stream.segmented.segmented, stream.hls.hls and stream.dash.dash. The logger names of the parser modules (hls.m3u8 and dash.manifest) are fine IMO and should be kept. They will be different no matter what due to the modules being renamed (previously hls_parser and dash_manifest).

In regards to the exports of the sub-packages, there will be no difference for the segmented stream base classes. The HLS sub-package also exports most of the m3u8 module, which I don't think is necessary, but I added those exports anyway since there are lots of custom HLS implementations. The DASH sub-package however only exports the relevant stuff. If there's a need for plugins to subclass DASH internals for custom implementations, then any missing stuff can be added later.

@bastimeyer
Copy link
Member Author

I've updated the logger names to reduce unnecessary redundancy.

Copy link
Member

@gravyboat gravyboat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I agree with you in regards to avoiding the redundant loggers 👍

@bastimeyer bastimeyer merged commit 82cd953 into streamlink:master Oct 8, 2023
@bastimeyer bastimeyer deleted the stream/subpackages branch October 8, 2023 12:52
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.

2 participants