created remote transcriber
This commit is contained in:
1 parent
856ab439f7
commit
38e0cc6764
10 files changed
+718
-68
No files matched your search
+34
-5
@@ -3,7 +3,9 @@ from datetime import datetime
|
||||
|
||||
import package.video_editing.build_shorts as yt_shorts
|
||||
import package.transcribe_video as transcribe_video
|
||||
import package.transcribe_client as transcribe_client
|
||||
import package.twitch.chat_vod as chat_vod
|
||||
import package.video_editing.highlights as highlights
|
||||
from package.config import DB as DB
|
||||
from package.config import TZ as TZ
|
||||
|
||||
@@ -22,19 +24,20 @@ def build_chat_video():
|
||||
print("====================================================")
|
||||
|
||||
def build_transcribe():
|
||||
unuploadeds = DB.get_unuploaded()
|
||||
downloads = DB.get_downloaded()
|
||||
|
||||
for unuploaded in unuploadeds:
|
||||
if unuploaded.clip_is:
|
||||
for download in downloads:
|
||||
if download.clip_is:
|
||||
target_dir = f"download/clips"
|
||||
else:
|
||||
target_dir = f"download/videos"
|
||||
|
||||
print("====================================================")
|
||||
print(f"🚀 Transcribe: {unuploaded.title}")
|
||||
print(f"🚀 Transcribe: {download.title}")
|
||||
print("====================================================")
|
||||
|
||||
transcribe_video.transcribe_to_srt(f"{target_dir}/{unuploaded.id}/{unuploaded.id}.mp4")
|
||||
#transcribe_video.transcribe_to_srt(f"{target_dir}/{unuploaded.id}/{unuploaded.id}.mp4", True)
|
||||
transcribe_client.transcribe_to_srt_remote(f"{target_dir}/{download.id}/{download.id}.mp4")
|
||||
|
||||
print("====================================================")
|
||||
print(f"✅ Processing: Transcribing Done.")
|
||||
@@ -65,6 +68,32 @@ def build_shorts():
|
||||
print(f"✅ Processing: Clip to Youtube Short Done.")
|
||||
print("====================================================")
|
||||
|
||||
def build_highlights():
|
||||
lights = DB.get_downloaded()
|
||||
|
||||
top_txt = "TeamPGP Live on Twitch...\n Every Friday and Sunday @7:30 ET.\n twitch.tv/teampgp"
|
||||
count = 1
|
||||
|
||||
for light in lights:
|
||||
target_dir = f"download/clips/{light.id}/{light.id}.mp4"
|
||||
|
||||
print("====================================================")
|
||||
print(f"🚀 Processing: Highlights {light.title}")
|
||||
print("====================================================")
|
||||
print(f"{count}/{len(lights)}")
|
||||
|
||||
created_at = datetime.strptime(light.created_at, "%Y-%m-%d %H:%M:%S%z")
|
||||
created_at = created_at.astimezone(TZ)
|
||||
|
||||
#ToDo
|
||||
highlights.highlights(target_dir, [], 5, 8)
|
||||
#yt_shorts.fit_to_9_16_letterbox(target_dir, top_txt, f"Clipped By: {light.creator_name},\n on {created_at.strftime("%Y-%m-%d %H:%M:%S %Z")}")
|
||||
count += 1
|
||||
|
||||
print("====================================================")
|
||||
print(f"✅ Processing: Clip to Youtube Short Done.")
|
||||
print("====================================================")
|
||||
|
||||
def build_videos():
|
||||
build_shorts()
|
||||
build_transcribe()
|
||||
|
||||
Reference in new issue
Block a user