stream.hls_playlist: round BANDWIDTH and parse as int#3721
Merged
Conversation
same as DASH Streams streamlink#1995 --- before ``` [cli][info] Available streams: 360p_364k (worst), 480p_764k, 720p_1564k, 720p_2564k, 576p_5008k, 720p_6891k, 720p_9726k (best) ``` now ``` [cli][info] Available streams: 360p_360k (worst), 480p_760k, 720p_1600k, 720p_2600k, 576p_5000k, 720p_6900k, 720p_9700k (best) ``` --- useful for streamlink#3708
bastimeyer
reviewed
May 8, 2021
| bandwidth = streaminf.get("BANDWIDTH") | ||
| if bandwidth: | ||
| bandwidth = float(bandwidth) | ||
| bandwidth = round(float(bandwidth), 1 - int(math.log10(float(bandwidth)))) |
Member
There was a problem hiding this comment.
Why is bandwidth parsed as a float?
https://tools.ietf.org/html/rfc8216#section-4.3.4.2
The following attributes are defined:
BANDWIDTH The value is a decimal-integer of bits per second. It represents the peak segment bit rate of the Variant Stream.
Collaborator
Author
There was a problem hiding this comment.
Member
|
Btw, the entire stream name+weights selection needs a major rewrite. We're currently guessing the stream weight from the yielded stream name in the streams dict instead of properly calculating the stream weights from various (additional) stream properties, like FPS for example. This would also fix issues with duplicates, but it'd probably be a breaking change, as this is part of the public API. |
Billy2011
pushed a commit
to Billy2011/streamlink-27
that referenced
this pull request
May 9, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
same as DASH Streams #1995
before
now
useful for #3708