Add download progress bar

pull/30/head
Ole 3 years ago committed by GitHub
parent 5b3989611f
commit e3eb67feed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,6 @@
from random import randrange from random import randrange
from pytube import YouTube from pytube import YouTube
from pytube.cli import on_progress
from pathlib import Path from pathlib import Path
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
from moviepy.editor import VideoFileClip from moviepy.editor import VideoFileClip
@ -23,7 +24,7 @@ def download_background():
"We need to download the Minecraft background video. This is fairly large but it's only done once. 😎" "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 🙏") 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" res="720p"
).first().download( ).first().download(
"assets/mp4", "assets/mp4",

Loading…
Cancel
Save