bastimeyer · GitHub

@bastimeyer

@bastimeyer

- 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

@bastimeyer

@bastimeyer bastimeyer changed the title stream.hls: catch ValueError on segment decryption stream.hls: refactor segment decryption

May 16, 2022

@back-to

@bastimeyer

bastimeyer deleted the stream/hls/decryption-log-error branch

May 18, 2022 17:57

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 19, 2022
- 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

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 21, 2022
- 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

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 24, 2022
- 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

Read the original on github.com ↗