From 19e525d64c04b72ee7507433a3449caa8fb2e7e3 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Mon, 20 Jul 2026 19:32:48 -0400 Subject: [PATCH] update files to use #!/usr/bin/env python3 --- .vscode/launch.json | 8 +------- database.py | 1 + transcribe_video.py | 1 + void_ID.py | 1 + youtube_hashtags.py | 1 + youtube_short.py | 28 +++++++++++++++++++++++++++- 6 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index cc3a575..148f8b7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,13 +9,7 @@ "type": "debugpy", "request": "launch", "program": "${file}", - "args": [ - "--file", "my_video.mp4", - "--title", "My Automated Video Title", - "--category", "SCIENCE_AND_TECHNOLOGY", - "--description", "Testing out the Data API!", - "--privacy", "private" - ] + "args": [] } ] } \ No newline at end of file diff --git a/database.py b/database.py index 5e0bbd6..8e949f2 100644 --- a/database.py +++ b/database.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import sqlite3 from datetime import datetime from datetime import date as datetime_date diff --git a/transcribe_video.py b/transcribe_video.py index 698f711..9417cd5 100644 --- a/transcribe_video.py +++ b/transcribe_video.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import os import subprocess import whisper diff --git a/void_ID.py b/void_ID.py index 6e39ec4..600de4c 100644 --- a/void_ID.py +++ b/void_ID.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import json import os import requests diff --git a/youtube_hashtags.py b/youtube_hashtags.py index 78ddedd..e305ac8 100644 --- a/youtube_hashtags.py +++ b/youtube_hashtags.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import re import string from collections import Counter diff --git a/youtube_short.py b/youtube_short.py index 7d3bcf5..decec51 100644 --- a/youtube_short.py +++ b/youtube_short.py @@ -1,4 +1,7 @@ +#!/usr/bin/env python3 +import argparse import sys +from pathlib import Path from moviepy import VideoFileClip def convert_to_short(input_path): @@ -70,5 +73,28 @@ def upload_shorts(): else: print(f"Slug: {slug} | Upload Process failed.") +def main(): + # Set up the command-line argument parser + parser = argparse.ArgumentParser(description="TeamPGP Clip Processing and Upload Pipeline") + + # Add optional arguments + parser.add_argument('--convert', type=str, metavar='CLIP_PATH', help='Path to a video file to convert to a 9:16 Short') + parser.add_argument('--upload', action='store_true', help='Process and upload pending Shorts in the database to YouTube') + + args = parser.parse_args() + + # If no flags are provided, show help text and exit + if not args.convert and not args.upload: + parser.print_help() + sys.exit("\n❌ Error: You must provide at least one action flag (--convert or --upload).") + + # Execute conversion step if path is provided + if args.convert: + convert_to_short(args.convert) + + # Execute database upload step if flag is provided + if args.upload: + upload_shorts() + if __name__ == "__main__": - convert_to_short() \ No newline at end of file + main() \ No newline at end of file