Skip to content

Instantly share code, notes, and snippets.

@NataliaItani
Created September 10, 2023 18:27
Show Gist options
  • Save NataliaItani/7e0d2b2372c63c91e9acbb8520045412 to your computer and use it in GitHub Desktop.
Save NataliaItani/7e0d2b2372c63c91e9acbb8520045412 to your computer and use it in GitHub Desktop.
Youtube Downloader
import pytube
def download_video(url, save_path):
try:
# Create a YouTube object
yt = pytube.YouTube(url)
# Get the highest resolution stream
stream = yt.streams.get_highest_resolution()
# Download the video
stream.download(output_path=save_path)
print("Download completed successfully.")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
video_url = input("Enter the YouTube video URL: ")
save_location = input("Enter the directory to save the video: ")
download_video(video_url, save_location)
@NataliaItani
Copy link
Author

NataliaItani commented Sep 10, 2023

It is the free YouTube downloader scripts that works with the pytube. Now, it is Youtube mp3 downloader for android and desktops.

@safiradara
Copy link

Thanks for the amazing list out. I really need it now. I liked this. If you are interested in look at our reliable blog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment