diff --git a/m3u8/parser.py b/m3u8/parser.py index 3f511e3c..5fceccfa 100644 --- a/m3u8/parser.py +++ b/m3u8/parser.py @@ -8,7 +8,11 @@ import re from urllib.parse import urljoin as _urljoin -import iso8601 +try: + from iso8601 import parse_date +except ImportError: + parse_date = datetime.datetime.fromisoformat + from m3u8 import protocol @@ -20,7 +24,7 @@ def cast_date_time(value): - return iso8601.parse_date(value) + return parse_date(value) def format_date_time(value, **kwargs): diff --git a/requirements.txt b/requirements.txt index 57c80f08..f2d13e13 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -iso8601 +iso8601; python_version < '3.11' diff --git a/setup.py b/setup.py index d9a95375..f1c01d4a 100644 --- a/setup.py +++ b/setup.py @@ -23,5 +23,5 @@ url="https://github.com/globocom/m3u8", description="Python m3u8 parser", long_description=long_description, - python_requires=">=3.6", + python_requires=">=3.7", )