|
|
@ -7,6 +7,7 @@ from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
|
|
|
|
from moviepy.editor import VideoFileClip
|
|
|
|
from moviepy.editor import VideoFileClip
|
|
|
|
from utils.console import print_step, print_substep
|
|
|
|
from utils.console import print_step, print_substep
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_start_and_end_times(video_length, length_of_clip):
|
|
|
|
def get_start_and_end_times(video_length, length_of_clip):
|
|
|
|
random_time = randrange(180, int(length_of_clip) - int(video_length))
|
|
|
|
random_time = randrange(180, int(length_of_clip) - int(video_length))
|
|
|
|
return random_time, random_time + video_length
|
|
|
|
return random_time, random_time + video_length
|
|
|
@ -32,7 +33,7 @@ def download_background():
|
|
|
|
)
|
|
|
|
)
|
|
|
|
print_substep("Downloading the backgrounds videos... please be patient 🙏 ")
|
|
|
|
print_substep("Downloading the backgrounds videos... please be patient 🙏 ")
|
|
|
|
for uri, filename, credit in background_options:
|
|
|
|
for uri, filename, credit in background_options:
|
|
|
|
if Path(f'assets/backgrounds/{credit}-{filename}').is_file():
|
|
|
|
if Path(f"assets/backgrounds/{credit}-{filename}").is_file():
|
|
|
|
continue # adds check to see if file exists before downloading
|
|
|
|
continue # adds check to see if file exists before downloading
|
|
|
|
print_substep(f"Downloading {filename} from {uri}")
|
|
|
|
print_substep(f"Downloading {filename} from {uri}")
|
|
|
|
YouTube(uri).streams.filter(res="1080p").first().download(
|
|
|
|
YouTube(uri).streams.filter(res="1080p").first().download(
|
|
|
|