Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/scripto/core/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

from .errors import OperationStopped

VIDEO_EXTENSIONS = {".mp4", ".mov", ".m4v", ".mkv", ".webm"}
VIDEO_EXTENSIONS = {".mp4", ".mov", ".m4v", ".mkv", ".webm",
".ts", ".m2ts", ".mts"} # MPEG transport streams
AUDIO_EXTENSIONS = {".mp3", ".m4a", ".wav", ".aac", ".flac"}
DEFAULT_EXTENSIONS = VIDEO_EXTENSIONS | AUDIO_EXTENSIONS

Expand Down
10 changes: 10 additions & 0 deletions tests/test_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,13 @@ def test_stable_order(media_tree):
first = scanner.scan([str(root)]).files
second = scanner.scan([str(root)]).files
assert first == second


def test_transport_streams_are_supported(tmp_path):
for name in ("recording.ts", "camcorder.m2ts", "clip.mts"):
(tmp_path / name).write_bytes(b"x")
result = scanner.scan([str(tmp_path)], recursive=False)
assert [p.name for p in result.files] == [
"camcorder.m2ts", "clip.mts", "recording.ts",
]
assert result.warnings == []
Loading