Merge branch 'develop' into master
This commit is contained in:
18 files changed
+42
-38
No files matched your search
+2
-2
@@ -205,7 +205,7 @@
|
||||
<select name="background_choice" class="form-select" data-toggle="tooltip"
|
||||
data-original-title='Sets the background of the video'>
|
||||
<option value=" ">Random Video</option>
|
||||
{% for background in checks["background_choice"]["options"][1:] %}
|
||||
{% for background in checks["background_video"]["options"][1:] %}
|
||||
<option value="{{background}}">{{background}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
@@ -618,4 +618,4 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -14,14 +14,12 @@ from utils import settings
|
||||
from utils.console import print_step, print_substep
|
||||
from utils.voice import sanitize_text
|
||||
|
||||
|
||||
DEFAULT_MAX_LENGTH: int = (
|
||||
50 # Video length variable, edit this on your own risk. It should work, but it's not supported
|
||||
)
|
||||
|
||||
|
||||
class TTSEngine:
|
||||
|
||||
"""Calls the given TTS engine to reduce code duplication and allow multiple TTS engines.
|
||||
|
||||
Args:
|
||||
|
||||
@@ -43,8 +43,8 @@ class StreamlabsPolly:
|
||||
f"Please set the config variable STREAMLABS_POLLY_VOICE to a valid voice. options are: {voices}"
|
||||
)
|
||||
voice = str(settings.config["settings"]["tts"]["streamlabs_polly_voice"]).capitalize()
|
||||
headers = {"referer": "https://streamlabs.com"}
|
||||
body = {"voice": voice, "text": text, "service": "polly"}
|
||||
headers = {"Referer" : "https://streamlabs.com/" }
|
||||
response = requests.post(self.url, headers=headers, data=body)
|
||||
if not check_ratelimit(response):
|
||||
self.run(text, filepath, random_voice)
|
||||
|
||||
@@ -7,11 +7,13 @@ from subprocess import Popen
|
||||
from typing import NoReturn
|
||||
|
||||
from prawcore import ResponseException
|
||||
from utils.console import print_substep
|
||||
|
||||
from reddit.subreddit import get_subreddit_threads
|
||||
from utils import settings
|
||||
from utils.cleanup import cleanup
|
||||
from utils.console import print_markdown, print_step
|
||||
from utils.console import print_substep
|
||||
from utils.ffmpeg_install import ffmpeg_install
|
||||
from utils.id import id
|
||||
from utils.version import checkversion
|
||||
from video_creation.background import (
|
||||
@@ -23,7 +25,6 @@ from video_creation.background import (
|
||||
from video_creation.final_video import make_final_video
|
||||
from video_creation.screenshot_downloader import get_screenshots_of_reddit_posts
|
||||
from video_creation.voices import save_text_to_mp3
|
||||
from utils.ffmpeg_install import ffmpeg_install
|
||||
|
||||
__VERSION__ = "3.2.1"
|
||||
|
||||
|
||||
+3
-5
@@ -1,18 +1,16 @@
|
||||
import re
|
||||
|
||||
from prawcore.exceptions import ResponseException
|
||||
|
||||
from utils import settings
|
||||
import praw
|
||||
from praw.models import MoreComments
|
||||
from prawcore.exceptions import ResponseException
|
||||
|
||||
from utils import settings
|
||||
from utils.ai_methods import sort_by_similarity
|
||||
from utils.console import print_step, print_substep
|
||||
from utils.posttextparser import posttextparser
|
||||
from utils.subreddit import get_subreddit_undone
|
||||
from utils.videos import check_done
|
||||
from utils.voice import sanitize_text
|
||||
from utils.posttextparser import posttextparser
|
||||
from utils.ai_methods import sort_by_similarity
|
||||
|
||||
|
||||
def get_subreddit_threads(POST_ID: str):
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
boto3==1.26.142
|
||||
botocore==1.29.142
|
||||
gTTS==2.3.2
|
||||
gTTS==2.5.1
|
||||
moviepy==1.0.3
|
||||
playwright==1.34.0
|
||||
praw==7.7.0
|
||||
@@ -10,14 +10,14 @@ rich==13.4.1
|
||||
toml==0.10.2
|
||||
translators==5.7.6
|
||||
pyttsx3==2.90
|
||||
Pillow==9.5.0
|
||||
Pillow==10.2.0
|
||||
tomlkit==0.11.8
|
||||
Flask==2.3.3
|
||||
clean-text==0.6.0
|
||||
unidecode==1.3.6
|
||||
unidecode==1.3.8
|
||||
spacy==3.5.3
|
||||
torch==2.0.1
|
||||
transformers==4.29.2
|
||||
torch==2.2.0
|
||||
transformers==4.37.2
|
||||
ffmpeg-python==0.2.0
|
||||
elevenlabs==0.2.17
|
||||
yt-dlp==2023.7.6
|
||||
@@ -44,7 +44,7 @@ background_thumbnail_font_color = { optional = true, default = "255,255,255", ex
|
||||
|
||||
[settings.tts]
|
||||
voice_choice = { optional = false, default = "tiktok", options = ["elevenlabs", "streamlabspolly", "tiktok", "googletranslate", "awspolly", "pyttsx", ], example = "tiktok", explanation = "The voice platform used for TTS generation. " }
|
||||
random_voice = { optional = false, default = true, example = true, options = [true, false,], explanation = "Randomizes the voice used for each comment" }
|
||||
random_voice = { optional = false, type = "bool", default = true, example = true, options = [true, false,], explanation = "Randomizes the voice used for each comment" }
|
||||
elevenlabs_voice_name = { optional = false, default = "Bella", example = "Bella", explanation = "The voice used for elevenlabs", options = ["Adam", "Antoni", "Arnold", "Bella", "Domi", "Elli", "Josh", "Rachel", "Sam", ] }
|
||||
elevenlabs_api_key = { optional = true, example = "21f13f91f54d741e2ae27d2ab1b99d59", explanation = "Elevenlabs API key" }
|
||||
aws_polly_voice = { optional = false, default = "Matthew", example = "Matthew", explanation = "The voice used for AWS Polly" }
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import numpy as np
|
||||
from transformers import AutoTokenizer, AutoModel
|
||||
import torch
|
||||
from transformers import AutoTokenizer, AutoModel
|
||||
|
||||
|
||||
# Mean Pooling - Take attention mask into account for correct averaging
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
from os.path import exists
|
||||
import shutil
|
||||
from os.path import exists
|
||||
|
||||
|
||||
def _listdir(d): # listdir with full path
|
||||
|
||||
+11
-4
@@ -1,7 +1,8 @@
|
||||
import zipfile
|
||||
import requests
|
||||
import os
|
||||
import subprocess
|
||||
import zipfile
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
def ffmpeg_install_windows():
|
||||
@@ -39,7 +40,10 @@ def ffmpeg_install_windows():
|
||||
# Rename and move files
|
||||
os.rename(f"{ffmpeg_extracted_folder}-6.0-full_build", ffmpeg_extracted_folder)
|
||||
for file in os.listdir(os.path.join(ffmpeg_extracted_folder, "bin")):
|
||||
os.rename(os.path.join(ffmpeg_extracted_folder, "bin", file), os.path.join(".", file))
|
||||
os.rename(
|
||||
os.path.join(ffmpeg_extracted_folder, "bin", file),
|
||||
os.path.join(".", file),
|
||||
)
|
||||
os.rmdir(os.path.join(ffmpeg_extracted_folder, "bin"))
|
||||
for file in os.listdir(os.path.join(ffmpeg_extracted_folder, "doc")):
|
||||
os.remove(os.path.join(ffmpeg_extracted_folder, "doc", file))
|
||||
@@ -101,7 +105,10 @@ def ffmpeg_install():
|
||||
try:
|
||||
# Try to run the FFmpeg command
|
||||
subprocess.run(
|
||||
["ffmpeg", "-version"], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||
["ffmpeg", "-version"],
|
||||
check=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
)
|
||||
except FileNotFoundError as e:
|
||||
# Check if there's ffmpeg.exe in the current directory
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import os
|
||||
import re
|
||||
import textwrap
|
||||
import os
|
||||
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
from rich.progress import track
|
||||
|
||||
from TTS.engine_wrapper import process_text
|
||||
|
||||
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
import re
|
||||
from typing import Tuple, Dict
|
||||
from pathlib import Path
|
||||
from typing import Tuple, Dict
|
||||
|
||||
import toml
|
||||
from rich.console import Console
|
||||
|
||||
|
||||
+1
-1
@@ -2,8 +2,8 @@ import json
|
||||
from os.path import exists
|
||||
|
||||
from utils import settings
|
||||
from utils.console import print_substep
|
||||
from utils.ai_methods import sort_by_similarity
|
||||
from utils.console import print_substep
|
||||
|
||||
|
||||
def get_subreddit_undone(submissions: list, subreddit, times_checked=0, similarity_scores=None):
|
||||
|
||||
+1
-1
@@ -4,10 +4,10 @@ import time as pytime
|
||||
from datetime import datetime
|
||||
from time import sleep
|
||||
|
||||
from cleantext import clean
|
||||
from requests import Response
|
||||
|
||||
from utils import settings
|
||||
from cleantext import clean
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
from datetime import timezone
|
||||
|
||||
@@ -5,11 +5,12 @@ from pathlib import Path
|
||||
from random import randrange
|
||||
from typing import Any, Tuple, Dict
|
||||
|
||||
import yt_dlp
|
||||
from moviepy.editor import VideoFileClip, AudioFileClip
|
||||
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
|
||||
|
||||
from utils import settings
|
||||
from utils.console import print_step, print_substep
|
||||
import yt_dlp
|
||||
|
||||
|
||||
def load_background_options():
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import multiprocessing
|
||||
import os
|
||||
import re
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
from os.path import exists # Needs to be imported specifically
|
||||
from typing import Final
|
||||
from typing import Tuple, Any, Dict
|
||||
from typing import Tuple, Dict
|
||||
|
||||
import ffmpeg
|
||||
import translators
|
||||
@@ -11,15 +14,11 @@ from PIL import Image
|
||||
from rich.console import Console
|
||||
from rich.progress import track
|
||||
|
||||
from utils import settings
|
||||
from utils.cleanup import cleanup
|
||||
from utils.console import print_step, print_substep
|
||||
from utils.thumbnail import create_thumbnail
|
||||
from utils.videos import save_data
|
||||
from utils import settings
|
||||
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
|
||||
console = Console()
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ from pathlib import Path
|
||||
from typing import Dict, Final
|
||||
|
||||
import translators
|
||||
from playwright.async_api import async_playwright # pylint: disable=unused-import
|
||||
from playwright.sync_api import ViewportSize, sync_playwright
|
||||
from rich.progress import track
|
||||
|
||||
@@ -12,7 +11,6 @@ from utils import settings
|
||||
from utils.console import print_step, print_substep
|
||||
from utils.imagenarator import imagemaker
|
||||
from utils.playwright import clear_cookie_by_name
|
||||
|
||||
from utils.videos import save_data
|
||||
|
||||
__all__ = ["download_screenshots_of_reddit_posts"]
|
||||
|
||||
@@ -5,9 +5,9 @@ from rich.console import Console
|
||||
from TTS.GTTS import GTTS
|
||||
from TTS.TikTok import TikTok
|
||||
from TTS.aws_polly import AWSPolly
|
||||
from TTS.elevenlabs import elevenlabs
|
||||
from TTS.engine_wrapper import TTSEngine
|
||||
from TTS.pyttsx import pyttsx
|
||||
from TTS.elevenlabs import elevenlabs
|
||||
from TTS.streamlabs_polly import StreamlabsPolly
|
||||
from utils import settings
|
||||
from utils.console import print_table, print_step
|
||||
|
||||
Reference in new issue
Block a user