update files to use #!/usr/bin/env python3
This commit is contained in:
Vendored
+1
-7
@@ -9,13 +9,7 @@
|
|||||||
"type": "debugpy",
|
"type": "debugpy",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${file}",
|
"program": "${file}",
|
||||||
"args": [
|
"args": []
|
||||||
"--file", "my_video.mp4",
|
|
||||||
"--title", "My Automated Video Title",
|
|
||||||
"--category", "SCIENCE_AND_TECHNOLOGY",
|
|
||||||
"--description", "Testing out the Data API!",
|
|
||||||
"--privacy", "private"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from datetime import date as datetime_date
|
from datetime import date as datetime_date
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import whisper
|
import whisper
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
import re
|
import re
|
||||||
import string
|
import string
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
|||||||
+27
-1
@@ -1,4 +1,7 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
from moviepy import VideoFileClip
|
from moviepy import VideoFileClip
|
||||||
|
|
||||||
def convert_to_short(input_path):
|
def convert_to_short(input_path):
|
||||||
@@ -70,5 +73,28 @@ def upload_shorts():
|
|||||||
else:
|
else:
|
||||||
print(f"Slug: {slug} | Upload Process failed.")
|
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__":
|
if __name__ == "__main__":
|
||||||
convert_to_short()
|
main()
|
||||||
Reference in New Issue
Block a user