diff --git a/TTS/common.py b/TTS/common.py index b0d8898..9f71090 100644 --- a/TTS/common.py +++ b/TTS/common.py @@ -114,7 +114,7 @@ def get_random_voice( def audio_length( path: str, -) -> float | int: +) -> Union[float, int]: """ Gets the length of the audio file @@ -132,9 +132,9 @@ def audio_length( except Exception as e: import logging - logger = logging.getLogger('spam_application') - logger.setLevel(logging.DEBUG) - handler = logging.FileHandler('tts_log', mode='a+', encoding='utf-8') + logger = logging.getLogger('tts_logger') + logger.setLevel(logging.ERROR) + handler = logging.FileHandler('.tts.log', mode='a+', encoding='utf-8') logger.addHandler(handler) logger.error('Error occurred in audio_length:', e) return 0 diff --git a/video_creation/data/cookie-dark-mode.json b/video_creation/data/cookie-dark-mode.json deleted file mode 100644 index 774f4cc..0000000 --- a/video_creation/data/cookie-dark-mode.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "name": "USER", - "value": "eyJwcmVmcyI6eyJ0b3BDb250ZW50RGlzbWlzc2FsVGltZSI6MCwiZ2xvYmFsVGhlbWUiOiJSRURESVQiLCJuaWdodG1vZGUiOnRydWUsImNvbGxhcHNlZFRyYXlTZWN0aW9ucyI6eyJmYXZvcml0ZXMiOmZhbHNlLCJtdWx0aXMiOmZhbHNlLCJtb2RlcmF0aW5nIjpmYWxzZSwic3Vic2NyaXB0aW9ucyI6ZmFsc2UsInByb2ZpbGVzIjpmYWxzZX0sInRvcENvbnRlbnRUaW1lc0Rpc21pc3NlZCI6MH19", - "domain": ".reddit.com", - "path": "/" - }, - { - "name": "eu_cookie", - "value": "{%22opted%22:true%2C%22nonessential%22:false}", - "domain": ".reddit.com", - "path": "/" - } -] diff --git a/video_creation/data/cookie-light-mode.json b/video_creation/data/cookie-light-mode.json deleted file mode 100644 index 048a3e3..0000000 --- a/video_creation/data/cookie-light-mode.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "name": "eu_cookie", - "value": "{%22opted%22:true%2C%22nonessential%22:false}", - "domain": ".reddit.com", - "path": "/" - } -] diff --git a/video_creation/final_video.py b/video_creation/final_video.py index ff12862..b92acb5 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -3,7 +3,7 @@ import multiprocessing import os import re from os.path import exists -from typing import Tuple, Any +from typing import Tuple, Any, Union from moviepy.editor import ( VideoFileClip, @@ -80,7 +80,7 @@ def make_final_video( opacity = settings.config['settings']['opacity'] / 100 def create_audio_clip( - clip_title: str | int, + clip_title: Union[str, int], clip_start: float, ) -> 'AudioFileClip': return ( @@ -126,7 +126,7 @@ def make_final_video( new_opacity = 1 if opacity is None or opacity >= 1 else opacity def create_image_clip( - image_title: str | int, + image_title: Union[str, int], audio_start: float, audio_duration: float, ) -> 'ImageClip': @@ -174,7 +174,7 @@ def make_final_video( # .set_opacity(float(opacity)), # ) # else: story mode stuff - image_concat = concatenate_videoclips(image_clips).set_position(background_config[3]) + image_concat = CompositeVideoClip(image_clips).set_position(background_config[3]) download_background(background_config) chop_background_video(background_config, video_duration) @@ -209,8 +209,6 @@ def make_final_video( y2=back_video_height ) - [print(image.start, audio.start, '|', audio.end, image.end, end=f'\n{"-" * 10}\n') for - audio, image in zip(audio_clips, image_clips)] final = CompositeVideoClip([background_clip, image_concat]) final.audio = audio_composite diff --git a/video_creation/screenshot_downloader.py b/video_creation/screenshot_downloader.py index a779f6f..19d958f 100644 --- a/video_creation/screenshot_downloader.py +++ b/video_creation/screenshot_downloader.py @@ -63,7 +63,7 @@ class ExceptionDecorator: def catch_exception( func: Optional[_function], exception: Optional[_exceptions] = None, -) -> ExceptionDecorator | _function: +) -> Union[ExceptionDecorator, _function]: """ Decorator for catching exceptions and writing logs @@ -91,7 +91,7 @@ class Browser: default={ 'defaultViewport': { 'width': 500, - 'height': 900, + 'height': 1200, }, }, kw_only=True,