add new video edit scripts for combine video and spliting video
This commit is contained in:
1 parent
ee93c06f7d
commit
856ab439f7
10 files changed
+199
-32
No files matched your search
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
import fcntl
|
||||
import asyncio
|
||||
|
||||
import package.twitch.video_info as video_info
|
||||
@@ -8,8 +11,24 @@ import package.twitch.download_thumbnails as download_thumbnails
|
||||
import package.build_videos as build_videos
|
||||
import package.process_uploads as process_uploads
|
||||
|
||||
def lock_file():
|
||||
# Open a lock file
|
||||
lock_file_path = "/tmp/python_script.lock"
|
||||
fp = open(lock_file_path, 'w')
|
||||
|
||||
try:
|
||||
# Try to grab an exclusive lock without blocking (LOCK_NB)
|
||||
fcntl.lockf(fp, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
except IOError:
|
||||
print("Another instance is already running. Exiting.")
|
||||
sys.exit(1)
|
||||
|
||||
# Your script logic goes here
|
||||
print("Running exclusively on Linux/macOS...")
|
||||
|
||||
if __name__ == "__main__":
|
||||
upload = True
|
||||
lock_file()
|
||||
upload = False
|
||||
|
||||
if upload is False:
|
||||
# Get Twitch Video Info
|
||||
|
||||
Reference in new issue
Block a user