Skip to content
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

Check for uri in segment key before creating class #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GreenZapdos
Copy link

On some m3u8 servers, there is an #EXT-X-KEY line without a uri to signify that there is not a key.

@flavioribeiro
Copy link
Contributor

@GreenZapdos can you add tests and an example playlist so we can understand better your pull request?

@GreenZapdos
Copy link
Author

The current version of m3u8 (0.2.4) will not load a playlist like this:

#EXTM3U

#EXT-X-KEY:METHOD=AES-128,URI="http://example.com/key1",IV=0x01
#EXTINF:10,
http://example.com/video/encrypted-1.ts

#EXT-X-KEY:METHOD=AES-128,URI="http://example.com/key2",IV=0x02
#EXTINF:10,
http://example.com/video/encrypted-2.ts

#EXT-X-KEY:METHOD=AES-128,URI="http://example.com/key3",IV=0x03
#EXTINF:10,
http://example.com/video/encrypted-3.ts

#EXT-X-KEY:METHOD=UNENCRYPTED
#EXTINF:10,
http://example.com/video/unencrypted-A.ts

I'm not sure how this should be tested.

@leandromoreira
Copy link
Contributor

@GreenZapdos I think you can inspire by looking at https://github.com/globocom/m3u8/blob/master/tests/test_parser.py#L10 but instead of a SIMPLE_PLAYLIST you could create another type like PLAYLIST_WITH_EXTKEY_NO_URI https://github.com/globocom/m3u8/blob/master/tests/playlists.py#L10 and make sure it will pass only if your PR is applied.

@leandromoreira
Copy link
Contributor

@GreenZapdos ping?

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.

None yet

3 participants