Skip to content

Instantly share code, notes, and snippets.

@asvechkar
Created June 28, 2023 07:15
Show Gist options
  • Save asvechkar/2089d779336ce024addf63af6c870d73 to your computer and use it in GitHub Desktop.
Save asvechkar/2089d779336ce024addf63af6c870d73 to your computer and use it in GitHub Desktop.
Загружать видео с Youtube
pip install pytube
from pytube import YouTube
# Specify the URL of the YouTube video
video_url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# Create a YouTube object
yt = YouTube(video_url)
# Select the highest resolution stream
stream = yt.streams.get_highest_resolution()
# Define the output path for the downloaded video
output_path = "path/to/output/directory/"
# Download the video
stream.download(output_path)
print("Video downloaded successfully!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment