Skip to content

Incorrect format for daterange start-date and end-date #408

@wabiloo

Description

@wabiloo

The START-DATE and END-DATE attributes of EXT-X-DATERANGE should be serialized as ISO8601 with a 'T' between date and time.

playlist = m3u8.M3U8()
playlist.version = 6
playlist.target_duration = 8
playlist.playlist_type = "VOD"

segment = m3u8.Segment(uri="segment_0.ts", duration=8.0, title="")
segment.program_date_time = datetime(1970, 1, 1, 0, 0, 0, tzinfo=timezone.utc)
playlist.segments.append(segment)

start_date_dt = datetime(1970, 1, 1, 0, 0, 8, tzinfo=timezone.utc)
dr = m3u8.DateRange(id="repro", start_date=start_date_dt, duration=16.0)

segment.dateranges.append(dr)

dumped = playlist.dumps(timespec="seconds")
print(dumped)

currently outputs

#EXT-X-DATERANGE:ID="repro",START-DATE="1970-01-01 00:00:08+00:00",DURATION=16

but should be

#EXT-X-DATERANGE:ID="repro",START-DATE="1970-01-01T00:00:08+00:00",DURATION=16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions