created new files for transcribing videos , find tranding hashtags
This commit is contained in:
+32
-1
@@ -1,7 +1,12 @@
|
||||
import sys
|
||||
from moviepy.editor import VideoFileClip
|
||||
|
||||
def convert_to_short(input_path, output_path="youtube_short.mp4"):
|
||||
def convert_to_short(input_path):
|
||||
|
||||
input_file = Path(input_path)
|
||||
|
||||
output_path = f"{input_file.stem}_shorts{input_file.suffix}"
|
||||
|
||||
# Load the video file
|
||||
clip = VideoFileClip(input_path)
|
||||
|
||||
@@ -39,5 +44,31 @@ def convert_to_short(input_path, output_path="youtube_short.mp4"):
|
||||
print(f"🎉 Success! Short saved as: {output_path}")
|
||||
return True
|
||||
|
||||
def upload_shorts():
|
||||
"""Loops over the downloaded videos entries and uploaded them to youtube."""
|
||||
print("Uploading Shorts...")
|
||||
|
||||
unuploaded_shorts = DB.get_unuploaded()
|
||||
|
||||
categoryId = CategoryId.GAMING
|
||||
|
||||
for slug, record_date, title, game_name, clip_by, views, downloaded, uploaded_yt in unuploaded_shorts:
|
||||
print(f"Slug: {slug} | Date: {record_date} | Game: {game_name} | By: {clip_by} | Views: {views} | Title: {title}")
|
||||
|
||||
file_path = f"save/clips/{slug}/{slug}_shorts.mp4"
|
||||
title = title
|
||||
description = f"Game: {game_name}, Cliped By: {clip_by}, on {record_date}, #Shorts #Clips #Twitch Every Friday and Sunday @7:30 EST https://twitch.tv/teampgp"
|
||||
categoryId = CategoryId.GAMING
|
||||
privatcyStatus = 'private'
|
||||
tags = ['shorts', 'gaming', 'TeamPGP', f'{game_name}', f'{clip_by}', 'twitch_clips', 'clips', 'Level1Techs', 'twitch']
|
||||
|
||||
output = uploader.upload_video(file_path, title, categoryId, description, privatcyStatus, tags)
|
||||
|
||||
if output is True:
|
||||
print(f"Slug: {slug} | Was successfully uploaded.")
|
||||
DB.mark_as_uploaded(slug)
|
||||
else:
|
||||
print(f"Slug: {slug} | Upload Process failed.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
convert_to_short()
|
||||
Reference in New Issue
Block a user