Merge pull request #30 from OlMi1/master

Create Background Video Download Progress Bar
pull/164/head
Lewis Menelaws 3 years ago committed by GitHub
commit c916e1c1cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,6 @@
from random import randrange
from pytube import YouTube
from pytube.cli import on_progress
from pathlib import Path
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
from moviepy.editor import VideoFileClip
@ -11,7 +12,6 @@ def get_start_and_end_times(video_length, length_of_clip):
random_time = randrange(180, int(length_of_clip) - int(video_length))
return random_time, random_time + video_length
def download_background():
"""Downloads the background video from youtube.
@ -23,7 +23,7 @@ def download_background():
"We need to download the Minecraft background video. This is fairly large but it's only done once. 😎"
)
print_substep("Downloading the background video... please be patient 🙏")
YouTube("https://www.youtube.com/watch?v=n_Dv4JMiwK8").streams.filter(
YouTube("https://www.youtube.com/watch?v=n_Dv4JMiwK8", on_progress_callback=on_progress).streams.filter(
res="720p"
).first().download(
"assets/mp4",

Loading…
Cancel
Save