init
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from pathlib import Path
|
||||
|
||||
from n_m3u8dl_py.dash import DASHExtractor
|
||||
|
||||
|
||||
ROOT = Path(__file__).parents[2]
|
||||
|
||||
|
||||
def test_dash_resource_parses_expected_stream_shape() -> None:
|
||||
path = ROOT / "src/N_m3u8DL-RE.Tests/Resources/Dash/Manifest_1080p.mpd"
|
||||
streams = DASHExtractor(path.resolve().as_uri()).extract(path.read_text())
|
||||
assert len(streams) == 23
|
||||
first = streams[0]
|
||||
assert first.bandwidth == 386437
|
||||
assert first.extension == "m4s"
|
||||
assert first.playlist is not None
|
||||
assert first.playlist.total_duration == 736
|
||||
assert first.playlist.media_init is not None
|
||||
assert first.playlist.media_init.url.endswith("/1/init.mp4")
|
||||
|
||||
|
||||
def test_dash_removes_duplicate_segment_urls() -> None:
|
||||
path = ROOT / "src/N_m3u8DL-RE.Tests/Resources/Dash/Manifest_DuplicateSegments.mpd"
|
||||
stream = DASHExtractor(path.resolve().as_uri()).extract(path.read_text())[0]
|
||||
assert stream.playlist is not None
|
||||
assert [segment.url.rsplit("/", 1)[-1] for segment in stream.playlist.segments] == ["seg-1.m4s", "seg-2.m4s", "seg-3.m4s"]
|
||||
Reference in New Issue
Block a user