update files to use #!/usr/bin/env python3

This commit is contained in:
2026-07-20 19:32:48 -04:00
parent ff15ded0c9
commit 19e525d64c
6 changed files with 32 additions and 8 deletions
+27 -1
View File
@@ -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()
main()