Commit graph

107 commits

Author SHA1 Message Date
Vadim Getmanshchuk
ac0f881eef * added QuotedOrUnquoted enum
* implemented `Default`, `From`, `Display` traits
* updated `VariantStream`, `AlternativeMedia`, `SessionData`, `Key`, `Start` emums
* updated `from_hashmap` methods for each enum
* fixed tests
2022-04-15 23:06:40 -07:00
Vadim Getmanshchuk
5c842fd9f6 minor cargo clippy suggestions 2022-04-08 16:31:37 -07:00
Vadim Getmanshchuk
2f92e3ae8c #EXT-X-ENDLIST is moved to be the last part of the media manifest. Theoretically it can appear anywhere in manifest, so the current placement is not breaking the standard, but not usually is what found in the wild and I believe will help with readability. As any placement is possible, the placement at the end is completely legal. 2022-04-08 16:27:04 -07:00
Vadim Getmanshchuk
3c8368f9a3 A fix for CLOSED-CAPTIONS=NONE case and a few minor fixes
The PR includes 
* a hotfix for issue #44. I'm not entirely sure and it's possible to
* `#EXT-X-ENDLIST` is moved to be the last part of the media manifest. Theoretically it can appear anywhere in manifest, so the current placement is not breaking the standard, but not usually is what found in the wild and I believe will help with readability. As any placement is possible, the placement at the end is completely legal.  
* minor `cargo clippy` suggestions
2022-04-08 16:23:27 -07:00
rutgersc
39b52a1d4b
Merge pull request #42 from sdroege/u64-instead-of-i32
Use `u64` instead of `i32` for byte ranges and sequence numbers
2022-02-19 13:38:06 +01:00
rutgersc
bc8ccf0f5d
Merge pull request #41 from sdroege/derive-more-traits
Derive some more traits for the public types where it makes sense
2022-02-19 13:37:41 +01:00
rutgersc
5ee1273f7c
Merge pull request #40 from sdroege/type-closed-captions
The `TYPE` attribute uses `CLOSED-CAPTIONS` and not `CLOSEDCAPTIONS`
2022-02-19 13:37:26 +01:00
Sebastian Dröge
44aa097c90 Use u64 instead of i32 for byte ranges and sequence numbers
Fixes https://github.com/rutgersc/m3u8-rs/issues/39
2022-01-07 12:47:40 +02:00
Sebastian Dröge
1bfad5df01 Derive some more traits for the public types where it makes sense
This makes them easier to use.
2022-01-07 12:44:56 +02:00
Sebastian Dröge
cca02b239d The TYPE attribute uses CLOSED-CAPTIONS and not CLOSEDCAPTIONS
See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-10#section-4.4.6.1
2022-01-05 19:11:42 +02:00
rutgersc
836ef1caaf
Merge pull request #37 from sdroege/is-master-playlist-early-return
Don't bother parsing as a playlist or detecting if it's a master/medi…
2021-11-20 19:06:41 +01:00
Sebastian Dröge
2fae1d8f20 Don't bother parsing as a playlist or detecting if it's a master/media playlist if it doesn't start with #EXTM3U 2021-11-19 11:29:46 +02:00
rutgersc
53e9439660
Merge pull request #36 from sdroege/nom-7
Port to nom 7
2021-11-18 17:15:50 +01:00
Sebastian Dröge
472618e1aa Update version to 3.0.0 2021-11-18 15:05:32 +02:00
Sebastian Dröge
2432846064 Move the crate docs to the root of the crate so they actually show up
And also fix all the broken links while we're at it.
2021-11-18 15:04:17 +02:00
Sebastian Dröge
51fcb70113 Re-export all types from the crate root and remove the playlist sub-module
There's not much else in this crate and having it behind another module
decreases visibility.
2021-11-18 15:00:01 +02:00
Sebastian Dröge
3edf5d1c0f Fix various minor clippy warnings 2021-11-18 14:54:46 +02:00
Sebastian Dröge
7e62854e20 Use unwrap_or_default() instead of unwrap_or_else(Default::default) 2021-11-18 14:52:38 +02:00
Sebastian Dröge
336f11e1ba Remove useless fn main() from documentation examples 2021-11-18 14:52:03 +02:00
Sebastian Dröge
a5d8358379 Make most internal parser functions private
And move parser internals tests into a test submodule of the parser.

Also add actual assertions to various tests so they test something.
2021-11-18 14:50:14 +02:00
Sebastian Dröge
5500166f74 Fix confusing #[path] usage and re-exports in lib.rs
This has effectively the same behaviour now with fewer lines, less
confusion and fewer compiler warnings about unused code.
2021-11-17 19:32:57 +02:00
Sebastian Dröge
4e6ac58d0c Add tests for parsing non-playlist text and binary data
These should fail to parse (and not panic), but previously the
non-playlist text succeeded.
2021-11-17 19:22:28 +02:00
Sebastian Dröge
65c295ee02 Require each M3U8 playlist to start with the #EXTM3U8 tag
The RFC requires this to be the very first line of every master/media
playlist, and without this we would be parsing arbitrary text files as
playlist without erroring out.

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

Fixes https://github.com/rutgersc/m3u8-rs/issues/27
2021-11-17 19:14:58 +02:00
Sebastian Dröge
a44c2a1a72 Run parser through cargo fmt
Now that we don't use the nom macros anymore this works properly.
2021-11-17 16:00:25 +02:00
Sebastian Dröge
0ed0ce51f8 Migrate to Rust 2018
Cleans up some noise.
2021-11-17 16:00:23 +02:00
Sebastian Dröge
81398f86cd Port to nom 7
Fixes https://github.com/rutgersc/m3u8-rs/issues/35
2021-11-17 16:00:08 +02:00
rutgersc
f104d431d9
Merge pull request #34 from rutgersc/ci-check-formatting
CI check formatting
2021-10-19 19:50:26 +02:00
Rutger Schoorstra
0a3fb0e671 Version 2.1.0 2021-10-19 19:48:26 +02:00
Rutger Schoorstra
1287975af4 Check cargo fmt on CI 2021-10-19 19:48:26 +02:00
Rutger Schoorstra
6ee1b52c01 Update readme 2021-10-19 19:48:26 +02:00
rutgersc
303d0ecfce
Merge pull request #33 from rafaelcaricio/apply-fmt-and-clippy
Apply cargo fmt and clippy suggestions
2021-10-19 18:54:21 +02:00
3d5599fa28
Apply clippy suggestions 2021-10-18 11:48:30 +02:00
39aab3a2ac
Apply cargo fmt 2021-10-18 11:41:28 +02:00
rutgersc
359695a25c
Merge pull request #30 from rafaelcaricio/support-segment-unknown-tags
Support parsing of unknown tags on segments
2021-10-16 21:09:02 +02:00
677027e22c
Update readme with new attribute 2021-10-14 21:35:35 +02:00
dc352301a3
Allow unknown tags at the master playlist level 2021-10-14 21:21:03 +02:00
c1ff2b3730
Support parsing of unknown tags on segments 2021-10-12 23:06:47 +02:00
Rutger Schoorstra
06162a8554 Version 2.0.0 2021-04-24 19:06:57 +02:00
rutgersc
46922bdab3
Merge pull request #23 from rutgersc/use-features
Use features to split parser and types
2021-04-24 19:03:49 +02:00
Rutger Schoorstra
dc576c8e3c Add parser as default feature 2021-04-24 18:43:57 +02:00
Rutger Schoorstra
c3ef5bc16e Split code into parser/types 2021-04-24 18:39:25 +02:00
rutgersc
5a72e1e875
Merge pull request #24 from thaytan/20-multiple-session-data-keys
Fixes for session data and keys handling
2021-04-24 17:29:44 +02:00
Jan Schmidt
05669cab68 Support multiple session data and key tags.
Collect Vecs of session_data and session_key tags to
allow for multiples of each. Doesn't do any validation
as to disallowed duplicated values.

Fixes #20
2021-04-25 00:44:08 +10:00
Jan Schmidt
870ca830d3 SessionData: Must have either VALUE or URI, but not both.
If SessionData has a value, don't write the URI and vice-versa.

As per https://tools.ietf.org/html/rfc8216#section-4.3.4.4
EXT-X-SESSION-DATA must have one or the other, not both.
2021-04-25 00:44:08 +10:00
rutgersc
85b0826103
Merge pull request #26 from thaytan/update-to-rfc8216
Add HDCP-LEVEL and CHANNELS fields.
2021-04-21 18:20:16 +02:00
Jan Schmidt
5fe3fc309c Add HDCP-LEVEL and CHANNELS fields.
Add support for parsing / generating HDCP-LEVEL in a VariantStream
and CHANNELS in AlternativeMedia. The fields were added after
draft-pantos-http-live-streaming-19.txt and brings things up to date
with RFC 8216.
2021-04-21 13:44:17 +10:00
rutgersc
b75379437d
Merge pull request #16 from rafaelcaricio/master
Expose unknown tags
2021-04-20 19:35:58 +02:00
3e74f7787f Expose unknown tags 2021-04-20 19:29:04 +02:00
rutgersc
302ff22f31
Merge pull request #21 from rutgersc/fix/alternatives
Move alternatives to MasterPlaylist
2021-04-20 18:47:33 +02:00
Rutger Schoorstra
b44f6518c8 Version 1.0.8 2021-04-18 12:51:43 +02:00