CHANGE Write shell script to videos folder
This commit is contained in:
@@ -6,6 +6,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
from models.streams import VideoFile, VideoStream, AudioStream, SubtitleStream
|
from models.streams import VideoFile, VideoStream, AudioStream, SubtitleStream
|
||||||
from movie_details import get_movie_details
|
from movie_details import get_movie_details
|
||||||
|
from lib.fs import write_shell_script
|
||||||
|
|
||||||
|
|
||||||
def parse_streams(stream_data: dict, VideoFile: VideoFile) -> VideoFile:
|
def parse_streams(stream_data: dict, VideoFile: VideoFile) -> VideoFile:
|
||||||
@@ -42,6 +43,10 @@ def main(filename: Path, imdb: str, nosubtitles: bool):
|
|||||||
]
|
]
|
||||||
result = subprocess.run(cmd, capture_output=True, check=True)
|
result = subprocess.run(cmd, capture_output=True, check=True)
|
||||||
data = parse_streams(json.loads(result.stdout), video_details)
|
data = parse_streams(json.loads(result.stdout), video_details)
|
||||||
|
export_data = " ".join(data.cmd())
|
||||||
|
export_path = Path(filename).parent / "encode.sh"
|
||||||
|
write_shell_script(export_data, export_path)
|
||||||
|
print(Path(filename).parent)
|
||||||
print(" ".join(data.cmd()))
|
print(" ".join(data.cmd()))
|
||||||
# json.dump(data, sys.stdout, indent=4)
|
# json.dump(data, sys.stdout, indent=4)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user