pull/963/head
Drugsosos 2 years ago
parent 38a9354f66
commit 6a2b448c73
No known key found for this signature in database
GPG Key ID: 8E35176FE617E28D

@ -114,7 +114,7 @@ def get_random_voice(
def audio_length( def audio_length(
path: str, path: str,
) -> float | int: ) -> Union[float, int]:
""" """
Gets the length of the audio file Gets the length of the audio file
@ -132,9 +132,9 @@ def audio_length(
except Exception as e: except Exception as e:
import logging import logging
logger = logging.getLogger('spam_application') logger = logging.getLogger('tts_logger')
logger.setLevel(logging.DEBUG) logger.setLevel(logging.ERROR)
handler = logging.FileHandler('tts_log', mode='a+', encoding='utf-8') handler = logging.FileHandler('.tts.log', mode='a+', encoding='utf-8')
logger.addHandler(handler) logger.addHandler(handler)
logger.error('Error occurred in audio_length:', e) logger.error('Error occurred in audio_length:', e)
return 0 return 0

@ -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": "/"
}
]

@ -1,8 +0,0 @@
[
{
"name": "eu_cookie",
"value": "{%22opted%22:true%2C%22nonessential%22:false}",
"domain": ".reddit.com",
"path": "/"
}
]

@ -3,7 +3,7 @@ import multiprocessing
import os import os
import re import re
from os.path import exists from os.path import exists
from typing import Tuple, Any from typing import Tuple, Any, Union
from moviepy.editor import ( from moviepy.editor import (
VideoFileClip, VideoFileClip,
@ -80,7 +80,7 @@ def make_final_video(
opacity = settings.config['settings']['opacity'] / 100 opacity = settings.config['settings']['opacity'] / 100
def create_audio_clip( def create_audio_clip(
clip_title: str | int, clip_title: Union[str, int],
clip_start: float, clip_start: float,
) -> 'AudioFileClip': ) -> 'AudioFileClip':
return ( return (
@ -126,7 +126,7 @@ def make_final_video(
new_opacity = 1 if opacity is None or opacity >= 1 else opacity new_opacity = 1 if opacity is None or opacity >= 1 else opacity
def create_image_clip( def create_image_clip(
image_title: str | int, image_title: Union[str, int],
audio_start: float, audio_start: float,
audio_duration: float, audio_duration: float,
) -> 'ImageClip': ) -> 'ImageClip':
@ -174,7 +174,7 @@ def make_final_video(
# .set_opacity(float(opacity)), # .set_opacity(float(opacity)),
# ) # )
# else: story mode stuff # 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) download_background(background_config)
chop_background_video(background_config, video_duration) chop_background_video(background_config, video_duration)
@ -209,8 +209,6 @@ def make_final_video(
y2=back_video_height 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 = CompositeVideoClip([background_clip, image_concat])
final.audio = audio_composite final.audio = audio_composite

@ -63,7 +63,7 @@ class ExceptionDecorator:
def catch_exception( def catch_exception(
func: Optional[_function], func: Optional[_function],
exception: Optional[_exceptions] = None, exception: Optional[_exceptions] = None,
) -> ExceptionDecorator | _function: ) -> Union[ExceptionDecorator, _function]:
""" """
Decorator for catching exceptions and writing logs Decorator for catching exceptions and writing logs
@ -91,7 +91,7 @@ class Browser:
default={ default={
'defaultViewport': { 'defaultViewport': {
'width': 500, 'width': 500,
'height': 900, 'height': 1200,
}, },
}, },
kw_only=True, kw_only=True,

Loading…
Cancel
Save