diff --git a/PARAMETERS.MD b/PARAMETERS.MD index 55eff69e..4f2039f9 100644 --- a/PARAMETERS.MD +++ b/PARAMETERS.MD @@ -11,7 +11,8 @@ The Anime Scripter is a powerful tool for enhancing and manipulating videos with - `--version` (action=store_true): Outputs the script version. - `--benchmark` (action=store_true): Enable benchmarking. This will not output any video and it will only test the performance of the script without any additional processing. - `--offline` (action=store_true): Enable offline mode, this will download all available models and store them locally in the weights folder, due to Github rate limiting and variables like internet connection this can take up to 5 minutes but it will make the script work 100% offline. ( except for YTDLP ) -- `--consent` (action=store_true): WIP! Enable fully anonymous logging of usage, this will store data from log.txt and send it to my server, the only data that is being processed from log.txt are: " Arguments " ( excluding input/output ), " System Specs " and " Processing Outputs ". This can help provide better insight on usage and errors. +- `--consent` (action=store_true, default=False): WIP! Enable fully anonymous logging of usage, this will store data from log.txt and send it to my server, the only data that is being processed from log.txt are: " Arguments " ( excluding input/output ), " System Specs " and " Processing Outputs ". This can help provide better insight on usage and errors. +- `--ae` (actions=store_true, default=False): A simple flag for the script to know if it's ran from the After Effects interface or not. #### Input and Output: diff --git a/TheAnimeScripter.jsx b/TheAnimeScripter.jsx index 5a5d3685..2dca25a8 100644 --- a/TheAnimeScripter.jsx +++ b/TheAnimeScripter.jsx @@ -845,6 +845,7 @@ var TheAnimeScripter = (function () { "--resize_factor", resizeValue(), "--nt", threadsValue(), "--denoise_method", denoiseMethod().toLowerCase(), + "--ae", ]; if (checkboxInterpolateValue()) { @@ -1003,6 +1004,7 @@ var TheAnimeScripter = (function () { "\"" + exeFile + "\"", "--output", "\"" + outputName + "\"", "--input", "\"" + textGetVideo.text + "\"", + "--ae", ]; var command = attempt.join(" "); callCommand(command); diff --git a/main.py b/main.py index b2849588..efbd69a4 100644 --- a/main.py +++ b/main.py @@ -473,6 +473,7 @@ def start(self): argparser.add_argument( "--scenechange", action="store_true", help="Detect scene changes", required=False ) + argparser.add_argument("--ae", action="store_true", help="A simple flag for notifying if the script is ran from the After Effects interface", required=False) args = argparser.parse_args() args = argumentChecker(args, mainPath, scriptVersion) diff --git a/src/argumentsChecker.py b/src/argumentsChecker.py index 46300678..cf794ce2 100644 --- a/src/argumentsChecker.py +++ b/src/argumentsChecker.py @@ -144,6 +144,7 @@ def processURL(args, mainPath): args.encode_method, args.custom_encoder, args.ffmpeg_path, + args.ae, ) args.input = str(args.output) diff --git a/src/ytdlp.py b/src/ytdlp.py index 5623f441..651a6e46 100644 --- a/src/ytdlp.py +++ b/src/ytdlp.py @@ -7,13 +7,14 @@ class VideoDownloader: def __init__( - self, video_link, output, encodeMethod, customEncoder, ffmpegPath: str = None + self, video_link, output, encodeMethod, customEncoder, ffmpegPath: str = None, ae: bool = False ): self.link = video_link self.output = output self.encodeMethod = encodeMethod self.customEncoder = customEncoder self.ffmpegPath = ffmpegPath + self.ae = ae resolutions = self.listResolutions() @@ -32,10 +33,10 @@ def __init__( self.resolution = answers["resolution"] - if self.resolution > 1080: - toPrint = f"The selected resolution {self.resolution} is higher than 1080p, this will require an aditional step of encoding the video for compatibility with After Effects, [WIP]" - logging.warning(toPrint) - print(toPrint) + if self.resolution > 1080 and self.ae: + toPrint = f"The selected resolution {self.resolution} is higher than 1080p, this will require an aditional step of encoding the video for compatibility with After Effects" + logging.warning(toPrint) + print(toPrint) else: toPrint = f"Selected resolution: {self.resolution}" logging.info(toPrint) @@ -65,7 +66,7 @@ def downloadVideo(self): ydl.download([self.link]) def getOptions(self): - if self.resolution > 1080: + if self.resolution > 1080 and self.ae: return { "format": f"bestvideo[height<={self.resolution}]+bestaudio[ext=m4a]/best[ext=mp4]", "outtmpl": os.path.splitext(self.output)[0],