rearange files and updateing files
This commit is contained in:
1 parent
20acb4bc9f
commit
2de2c461e2
28 files changed
+285
-188
No files matched your search
@@ -0,0 +1,123 @@
|
||||
#!/usr/bin/env python3
|
||||
import youtube_short
|
||||
import package.transcribe_video as transcribe_video
|
||||
import package.twitch.chat_vod as chat_vod
|
||||
from package.config import DB as DB
|
||||
|
||||
def build_chat_video():
|
||||
chats = DB.get_unuploaded_chats()
|
||||
|
||||
for chat in chats:
|
||||
(
|
||||
id,
|
||||
title,
|
||||
created_at,
|
||||
view_count,
|
||||
duration,
|
||||
url,
|
||||
thumbnail_url,
|
||||
game_id,
|
||||
game_name,
|
||||
stream_id,
|
||||
creator_name,
|
||||
clip_is,
|
||||
downloaded,
|
||||
uploaded_yt,
|
||||
uploaded_yt_chats,
|
||||
uploaded_yt_shorts,
|
||||
) = chat
|
||||
|
||||
print("====================================================")
|
||||
print(f"🚀 Chat Video: {title}")
|
||||
print("====================================================")
|
||||
|
||||
chat_vod.combine_twitch_vod_and_chat(f"download/videos/{id}/{id}.mp4", "side-by-side")
|
||||
|
||||
print("====================================================")
|
||||
print(f"✅ Processing: Chat Video Done.")
|
||||
print("====================================================")
|
||||
|
||||
|
||||
def build_transcribe():
|
||||
unuploadeds = DB.get_unuploaded()
|
||||
|
||||
for unuploaded in unuploadeds:
|
||||
(
|
||||
id,
|
||||
title,
|
||||
created_at,
|
||||
view_count,
|
||||
duration,
|
||||
url,
|
||||
thumbnail_url,
|
||||
game_id,
|
||||
game_name,
|
||||
stream_id,
|
||||
creator_name,
|
||||
clip_is,
|
||||
downloaded,
|
||||
uploaded_yt,
|
||||
uploaded_yt_chats,
|
||||
uploaded_yt_shorts,
|
||||
) = unuploaded
|
||||
|
||||
if clip_is:
|
||||
target_dir = f"download/clips"
|
||||
else:
|
||||
target_dir = f"download/videos"
|
||||
|
||||
print("====================================================")
|
||||
print(f"🚀 Transcribe: {title}")
|
||||
print("====================================================")
|
||||
|
||||
transcribe_video.transcribe_to_srt(f"{target_dir}/{id}/{id}.mp4")
|
||||
|
||||
print("====================================================")
|
||||
print(f"✅ Processing: Transcribing Done.")
|
||||
print("====================================================")
|
||||
|
||||
|
||||
def build_shorts():
|
||||
shorts = DB.get_unuploaded_shorts()
|
||||
|
||||
top_txt = "TeamPGP Live on Twitch...\n Every Friday and Sunday @7:30 ET.\n twitch.tv/teampgp"
|
||||
|
||||
for short in shorts:
|
||||
(
|
||||
id,
|
||||
title,
|
||||
created_at,
|
||||
view_count,
|
||||
duration,
|
||||
url,
|
||||
thumbnail_url,
|
||||
game_id,
|
||||
game_name,
|
||||
stream_id,
|
||||
creator_name,
|
||||
clip_is,
|
||||
downloaded,
|
||||
uploaded_yt,
|
||||
uploaded_yt_chats,
|
||||
uploaded_yt_shorts,
|
||||
) = short
|
||||
|
||||
target_dir = f"download/clips/{id}/{id}.mp4"
|
||||
|
||||
print("====================================================")
|
||||
print(f"🚀 Processing: Clip to Youtube Short {title}")
|
||||
print("====================================================")
|
||||
|
||||
youtube_short.fit_to_9_16_letterbox(target_dir, top_txt, f"Clipped By: {creator_name}.")
|
||||
|
||||
print("====================================================")
|
||||
print(f"✅ Processing: Clip to Youtube Short Done.")
|
||||
print("====================================================")
|
||||
|
||||
def main():
|
||||
build_shorts()
|
||||
build_transcribe()
|
||||
build_chat_video()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user