Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added YouTube video downloader #38

Merged
merged 3 commits into from
Oct 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions youtube_video_downloader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from pytube import YouTube

while True:
url = input("Paste the YouTube link you wanted to download: ")
try:
print("Attempting to get your video...")
yt = YouTube(url)

print(f"""
Title: {yt.title}
Views: {yt.views}
Length: {yt.length}
""")
except:
print("Looks like you have the wrong link. Try again!")
continue

option = input("Is this the video you wanted to download? (Y/N) ")
if option == 'Y' or option == 'y':
print("Getting the video for you...")
yt.streams.filter(progressive=True, file_extension='mp4') \
.order_by('resolution') \
.desc() \
.first() \
.download()
print("Download completed!")
break