globocom / m3u8

Python m3u8 Parser for HTTP Live Streaming (HLS) Transmissions
Other
2.03k stars 471 forks source link

Quotation marks are still in VIDEO-RANGE property #321

Closed dlarrick closed 1 month ago

dlarrick commented 1 year ago

Greetings,

The fix for quoted VIDEO-RANGE properties in #289 is necessary but not sufficient.

That fix, https://github.com/globocom/m3u8/blob/master/m3u8/parser.py#L328 , adds video_range to the list of fields that will be de-quoted if needed. However, https://github.com/globocom/m3u8/blob/master/m3u8/parser.py#L337 overwrites this assignment with plain str so video_range does not, in fact, have quotes removed. This line should be removed.

Thanks!

mauricioabreu commented 1 month ago

@dlarrick sorry for the late reply. Reading the test and code, I could not see where the quotes were added. Can you show us an example?

dlarrick commented 1 month ago

The code has changed a little. New line numbers: https://github.com/globocom/m3u8/blob/master/m3u8/parser.py#L349 adds video_range to the list of fields that will be de-quoted, if needed.

However, a subsequent line overwrites this behavior by declaring that video_range is to be treated as str: https://github.com/globocom/m3u8/blob/master/m3u8/parser.py#L349

As the original ticket #289 suggests, m3u8 is not supposed to have quotes around the video_range. But we do encounter such files in the wild, even from some of the major streaming content providers.

mauricioabreu commented 1 month ago

@dlarrick Now I get it. The code works fine when video-range does not come with quotes, however, it does not remove the quotes when it happens.

mauricioabreu commented 1 month ago

Closed via https://github.com/globocom/m3u8/commit/91c398235dcf969b718b496b3e0678601eb6b2e8