diff --git a/podcast_transcript_convert/converters/any_to_simple.py b/podcast_transcript_convert/converters/any_to_simple.py index 6b0f08f..815b0d5 100644 --- a/podcast_transcript_convert/converters/any_to_simple.py +++ b/podcast_transcript_convert/converters/any_to_simple.py @@ -3,9 +3,7 @@ from typing import TypeAlias from podcast_transcript_convert.converters.html_to_json import html_file_to_json_file -from podcast_transcript_convert.converters.json_to_simple import ( - json_file_to_simple_file, -) +from podcast_transcript_convert.converters.json_to_json import json_file_to_json_file from podcast_transcript_convert.converters.srt_to_json import srt_file_to_json_file from podcast_transcript_convert.converters.vtt_to_json import vtt_file_to_json_file from podcast_transcript_convert.converters.xml_to_json import xml_file_to_json_file @@ -16,7 +14,7 @@ type_to_converter_map: dict[FileType, Converter] = { FileType.HTML: html_file_to_json_file, - FileType.JSON: json_file_to_simple_file, + FileType.JSON: json_file_to_json_file, FileType.SRT: srt_file_to_json_file, FileType.VTT: vtt_file_to_json_file, FileType.XML: xml_file_to_json_file, diff --git a/podcast_transcript_convert/converters/json_to_json.py b/podcast_transcript_convert/converters/json_to_json.py index 9c3fb9a..58b916b 100644 --- a/podcast_transcript_convert/converters/json_to_json.py +++ b/podcast_transcript_convert/converters/json_to_json.py @@ -5,8 +5,8 @@ def json_file_to_json_file( - origin_file: str, - destination_file: str, + origin_file: str | Path, + destination_file: str | Path, metadata: dict | None, ) -> None: try: diff --git a/podcast_transcript_convert/converters/srt_to_json.py b/podcast_transcript_convert/converters/srt_to_json.py index e4ecda4..13535f6 100644 --- a/podcast_transcript_convert/converters/srt_to_json.py +++ b/podcast_transcript_convert/converters/srt_to_json.py @@ -45,7 +45,11 @@ def srt_to_podcast_dict(srt_string: str) -> dict: } -def srt_file_to_json_file(srt_file: str, json_file: str, metadata: dict | None) -> None: +def srt_file_to_json_file( + srt_file: str | Path, + json_file: str | Path, + metadata: dict | None, +) -> None: srt_string = Path(srt_file).read_text() try: transcript_dict = srt_to_podcast_dict(srt_string) diff --git a/podcast_transcript_convert/converters/vtt_to_json.py b/podcast_transcript_convert/converters/vtt_to_json.py index e0b7404..0e6a817 100644 --- a/podcast_transcript_convert/converters/vtt_to_json.py +++ b/podcast_transcript_convert/converters/vtt_to_json.py @@ -37,7 +37,11 @@ def vtt_to_podcast_dict(vtt_string: str) -> dict: # https://www.w3.org/TR/webvtt1/#file-structure -def vtt_file_to_json_file(vtt_file: str, json_file: str, metadata: dict | None) -> None: +def vtt_file_to_json_file( + vtt_file: str | Path, + json_file: str | Path, + metadata: dict | None, +) -> None: vtt_string = Path(vtt_file).read_text() try: transcript_dict = vtt_to_podcast_dict(vtt_string) diff --git a/podcast_transcript_convert/converters/xml_to_json.py b/podcast_transcript_convert/converters/xml_to_json.py index 0f61cb7..c408298 100644 --- a/podcast_transcript_convert/converters/xml_to_json.py +++ b/podcast_transcript_convert/converters/xml_to_json.py @@ -47,7 +47,11 @@ def xml_to_podcast_dict(xml_string: str) -> dict: } -def xml_file_to_json_file(xml_file: str, json_file: str, metadata: dict | None) -> None: +def xml_file_to_json_file( + xml_file: str | Path, + json_file: str | Path, + metadata: dict | None, +) -> None: xml_string = Path(xml_file).read_text() try: transcript_dict = xml_to_podcast_dict(xml_string)