php-m3u8 icon indicating copy to clipboard operation
php-m3u8 copied to clipboard

When parsing master.m3u8, provide full path to stream playlists

Open mbirth opened this issue 3 years ago • 0 comments

When parsing a master.m3u8 in some sub directory, this library returns the URIs of sub-streams as-is. Which means they can be relative to the directory where the master.m3u8 is located. It would be great if there was a property that gives the full path to the sub-stream. E.g.:

$master = $parser->parse(new FileStream('../download/master.m3u8'));
print_r($master['EXT-X-STREAM-INF'][0]);

This currently just returns:

[uri] => playlist-1280.m3u8

So I have to figure out myself that this is relative to ../download/.

I'd like to have it also spit out e.g.:

[uri] => playlist-1280.m3u8
[filepath] => ../download/playlist-1280.m3u8

mbirth avatar May 18 '22 12:05 mbirth