update files to use #!/usr/bin/env python3
This commit is contained in:
Vendored
+1
-7
@@ -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": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
import sqlite3
|
||||
from datetime import datetime
|
||||
from datetime import date as datetime_date
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import subprocess
|
||||
import whisper
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
import os
|
||||
import requests
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
import re
|
||||
import string
|
||||
from collections import Counter
|
||||
|
||||
+27
-1
@@ -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()
|
||||
Reference in New Issue
Block a user