Skip to content

Commit

Permalink
Switch to from import
Browse files Browse the repository at this point in the history
  • Loading branch information
daveisfera authored and mauricioabreu committed Oct 26, 2023
1 parent acd3464 commit 9be37de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions m3u8/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Use of this source code is governed by a MIT License
# license that can be found in the LICENSE file.

import datetime
import itertools
import re
from datetime import datetime, timedelta
from urllib.parse import urljoin as _urljoin

try:
Expand All @@ -25,7 +25,7 @@


def cast_date_time(value):
return datetime.datetime.fromisoformat(value)
return datetime.fromisoformat(value)


def format_date_time(value, **kwargs):
Expand Down Expand Up @@ -292,7 +292,7 @@ def _parse_ts_chunk(line, data, state):
segment["program_date_time"] = state.pop("program_date_time")
if state.get("current_program_date_time"):
segment["current_program_date_time"] = state["current_program_date_time"]
state["current_program_date_time"] += datetime.timedelta(
state["current_program_date_time"] += timedelta(
seconds=segment["duration"]
)
segment["uri"] = line
Expand Down Expand Up @@ -580,7 +580,7 @@ def _parse_part(line, data, state):
# this should always be true according to spec
if state.get("current_program_date_time"):
part["program_date_time"] = state["current_program_date_time"]
state["current_program_date_time"] += datetime.timedelta(
state["current_program_date_time"] += timedelta(
seconds=part["duration"]
)

Expand Down

0 comments on commit 9be37de

Please sign in to comment.