-
Notifications
You must be signed in to change notification settings - Fork 464
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
Added check that parameter name matches fully #201
base: master
Are you sure you want to change the base?
Conversation
@@ -86,6 +86,18 @@ | |||
http://media.example.com/fileSequence52-3.ts | |||
''' | |||
|
|||
PLAYLIST_WITH_CUSTOM_MEDIA_HEADER = '''#EXTM3U |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can name it PLAYLIST_WITH_CUSTOM_TAG
because your code fixes every custom tag, not just EXT-X-MEDIA
. Do you agree?
@@ -273,6 +273,10 @@ def test_session_key_attribute_without_initialization_vector(): | |||
assert None == obj.session_keys[0].iv | |||
|
|||
|
|||
def test_parse_custom_media_header(): | |||
obj = m3u8.M3U8(playlists.PLAYLIST_WITH_CUSTOM_MEDIA_HEADER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should expect this test to assert something. I get it does not break, but what happens with the EXT-X-MEDIA-READY? Does it go away? Does it get parsed?
@@ -271,6 +271,9 @@ def _parse_attribute_list(prefix, line, atribute_parser): | |||
params = ATTRIBUTELISTPATTERN.split(line.replace(prefix + ':', ''))[1::2] | |||
|
|||
attributes = {} | |||
if not line.startswith(prefix+':') : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Could you remove that extra black space before the last colon?
Hello.
I've encountered m3u8 playlist with custom header:
#EXT-X-MEDIA-READY:7f659f6f09bce196d7
This header is erroneously parsed as
#EXT-X-MEDIA
header and gives this error:ValueError: not enough values to unpack (expected 2, got 1)
at parser.py: 275
I think you should check that parameter string starts with exact parameter name, not just part of it.
Here is PR that fixes this.
test is also provided.