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

Standardized m3u8 formatting #229

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Standardized m3u8 formatting #229

merged 1 commit into from
Aug 29, 2024

Conversation

Artrix9095
Copy link
Contributor

Currently you're breaking the m3u8 standard and it breaks some media players. Adding the #EXTM3U tag should fix it.

There is more information that would be best practice to add but I don't know how to add it. Please read the m3u8 spec or the wiki for more information.

@Artrix9095
Copy link
Contributor Author

Is there any way I can get the file size for each torrent?

@ikatson ikatson merged commit 0b248a9 into ikatson:main Aug 29, 2024
6 checks passed
@ikatson
Copy link
Owner

ikatson commented Aug 29, 2024

What do you mean? Through http API? Must be in one of the stats endpoints, /torrents/id/stats/v1 if I remember correctly (on phone)

@Artrix9095
Copy link
Contributor Author

Artrix9095 commented Aug 29, 2024

the #EXTINF: tag requires the file size for each uri in the playlist. Is there any way to get that inside the playlist response?

@Artrix9095
Copy link
Contributor Author

@ikatson
Copy link
Owner

ikatson commented Aug 29, 2024

Build playlist content is called from the iterator iter_filenames_and_lengths, the second item there is length in bytes

@ikatson
Copy link
Owner

ikatson commented Aug 29, 2024

See https://datatracker.ietf.org/doc/html/rfc8216#section-4.3.2.1

That's not what it is though, it's not HTTP live streaming streaming, just a playlist with links .

See https://en.m.wikipedia.org/wiki/M3U

So at best you can add #EXTBYT

There's no length in seconds, rqbit doesn't understand video/audio formats and their details.

Streaming is done through range header (bytes) and a lot of clients are fine with this.

So not sure what is it breaking, it's just probably not what you think it is?

@Artrix9095
Copy link
Contributor Author

My bad! I got the file size and video length mixed up. Currently it still breaks Hls.js which is a fairly popular HLS player on the web.

@ikatson
Copy link
Owner

ikatson commented Aug 30, 2024

Got it. It's not HLS though which afaik needs specially crafted input, full files aren't enough

@Artrix9095
Copy link
Contributor Author

It is possible to split each file into segments relatively easily. Segments consist of .ts files which afaik are quite literally just chunked mpeg files (would be basically the same as what you're already doing just with a different file extension). I'll try to implement this in another PR if I can get some help

@Artrix9095
Copy link
Contributor Author

Actually this is might be more complicated and require FFmpeg. Which might add extra bloat. Probably should make this a feature flag called "pure-hls" or something

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

Successfully merging this pull request may close these issues.

2 participants