Skip to content

plugins.twitch: refactor worker, parser and tests #3169

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

Conversation

bastimeyer
Copy link
Member

  • Removes the custom parameters and properties from the parser and adds
    the "prefetch" field to the namedtuple Segment.
  • Filters out prefetch segments in the worker's process_sequences method
  • Replaces the playlist_reloads counter with a playlist_sequence == -1
    check, which is sufficient for checking the beginning of the stream.
  • Adds had_content property to worker, which checks for segments which
    are not ads until the first segment was found.
  • Refactors the info log messages and fixes the
    "This is not a low latency stream" message when preroll ads exist.
  • Cleans up tests
  • Adds more tests for certain low-latency and disable-ads conditions.

- Removes the custom parameters and properties from the parser and adds
  the "prefetch" field to the namedtuple Segment.
- Filters out prefetch segments in the worker's process_sequences method
- Replaces the playlist_reloads counter with a playlist_sequence == -1
  check, which is sufficient for checking the beginning of the stream.
- Adds had_content property to worker, which checks for segments which
  are not ads until the first segment was found.
- Refactors the info log messages and fixes the
  "This is not a low latency stream" message when preroll ads exist.
- Cleans up tests
- Adds more tests for certain low-latency and disable-ads conditions.
@codecov
Copy link

codecov bot commented Sep 12, 2020

Codecov Report

Merging #3169 into master will decrease coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3169      +/-   ##
==========================================
- Coverage   52.67%   52.62%   -0.05%     
==========================================
  Files         244      244              
  Lines       15636    15626      -10     
==========================================
- Hits         8236     8223      -13     
- Misses       7400     7403       +3     

@bastimeyer
Copy link
Member Author

This PR is a combination of three things

  1. a clean up of the TwitchM3U8Parser, which makes it independent of the TwitchHLSStream parameters
  2. a clean up of the TwitchHLSStreamWorker and the info log messages
  3. and a fix regarding the "This is not a low latency stream" info log message which gets incorrectly emitted when there are preroll ads.

And I've cleaned up the tests and added a few more for certain low-latency and disable-ads conditions.


This doesn't fix the timeout "issue" when filtering out mid-stream ads, which I've talked about in the other thread.

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.

@bastimeyer This looks good, I'm almost tempted to say we should include a link to the pinned issue about commercials in the text for the commercial break segment to try and head off any additional issues/comments. If you don't agree feel free to merge this as is.

@bastimeyer
Copy link
Member Author

No, let's not add links to debug/info log messages. These links will become obsolete quickly.

@back-to back-to merged commit ebc791a into streamlink:master Sep 17, 2020
@bastimeyer bastimeyer deleted the plugins/twitch/refactor-worker-and-parser branch October 9, 2020 06:52
resiproxy pushed a commit to resiproxy/streamlink that referenced this pull request Nov 5, 2020
- Removes the custom parameters and properties from the parser and adds
  the "prefetch" field to the namedtuple Segment.
- Filters out prefetch segments in the worker's process_sequences method
- Replaces the playlist_reloads counter with a playlist_sequence == -1
  check, which is sufficient for checking the beginning of the stream.
- Adds had_content property to worker, which checks for segments which
  are not ads until the first segment was found.
- Refactors the info log messages and fixes the
  "This is not a low latency stream" message when preroll ads exist.
- Cleans up tests
- Adds more tests for certain low-latency and disable-ads conditions.
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.

3 participants