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

the behavior of M3U8(builtins.object).files #93

Open
redstoneleo opened this issue Oct 19, 2016 · 3 comments
Open

the behavior of M3U8(builtins.object).files #93

redstoneleo opened this issue Oct 19, 2016 · 3 comments
Labels

Comments

@redstoneleo
Copy link

>>> import m3u8
>>> p=m3u8.load('http://qv.gaiamount.com/playlist/u116/v810_mp4.m3u8?e=1477373423&token=_6yhTpZI-AHtfULMSiW7eOCvrNEnOS_YcLV9GNfH:a6ZdAsiLXdfy10QBiWguUyq26yU=')
>>> p.files
['http://www.gaiamount.com/keys/3958/4k', '/seg/u116/v810_mp4_0000.ts', '/seg/u116/v810_mp4_0001.ts', '/seg/u116/v810_mp4_0002.ts', '/seg/u116/v810_mp4_0003.ts', '/seg/u116/v810_mp4_0004.ts', '/seg/u116/v810_mp4_0005.ts', '/seg/u116/v810_mp4_0006.ts', '/seg/u116/v810_mp4_0007.ts', '/seg/u116/v810_mp4_0008.ts', '/seg/u116/v810_mp4_0009.ts', '/seg/u116/v810_mp4_0010.ts', '/seg/u116/v810_mp4_0011.ts', '/seg/u116/v810_mp4_0012.ts', '/seg/u116/v810_mp4_0013.ts', '/seg/u116/v810_mp4_0014.ts', '/seg/u116/v810_mp4_0015.ts', '/seg/u116/v810_mp4_0016.ts', '/seg/u116/v810_mp4_0017.ts', '/seg/u116/v810_mp4_0018.ts', '/seg/u116/v810_mp4_0019.ts', '/seg/u116/v810_mp4_0020.ts', '/seg/u116/v810_mp4_0021.ts', '/seg/u116/v810_mp4_0022.ts', '/seg/u116/v810_mp4_0023.ts', '/seg/u116/v810_mp4_0024.ts', '/seg/u116/v810_mp4_0025.ts', '/seg/u116/v810_mp4_0026.ts', '/seg/u116/v810_mp4_0027.ts', '/seg/u116/v810_mp4_0028.ts', '/seg/u116/v810_mp4_0029.ts', '/seg/u116/v810_mp4_0030.ts']
>>>

(1) what should I do to get the absolute URIs of all the segments?
(2) I think M3U8(builtins.object).files should return all the URIs of the segments , but why present the key uri along with them ? This makes the result difficult to use , for example if I want to use the returned result to download all the chunks, then I have to judge whether the first element is a key uri or not, so annoying! It would be better to create another method like M3U8(builtins.object).key_uri to specifically return the key uri .

@leandromoreira
Copy link
Contributor

leandromoreira commented Oct 19, 2016

  1. It should be the base_uri
  2. I think it's reasonable to keep all the files from the playlist on .files and you can filter only ts files
[x for x in m3u8.files if x endswith(".ts")]

Let's leave this open so more people can give their opinions.

@redstoneleo
Copy link
Author

also, it seems file segments returned by M3U8(builtins.object).files doesn't in the order they appear in the whole video, any solution to correct this ?

@mauricioabreu
Copy link
Member

I think it is a semantic problem, right? files gives the feel it has only real files (chunks)
If we remove the key_uri we would break the current API for those who depend on having the key_uri inside files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants