• 🌙 Community Spirit

    Ramadan Mubarak! To honor this month, Crax has paused NSFW categories. Wishing you peace and growth!

Python script to download YouTube-Videos (1 Viewer)

Currently reading:
 Python script to download YouTube-Videos (1 Viewer)

Recently searched:

mikeh1990

Member
LV
1
Joined
Jul 9, 2023
Threads
10
Likes
2
Awards
4
Credits
1,021©
Cash
0$
from pytube import YouTube
import os
import platform
def get_downloads_folder():
system = platform.system()
if system == 'Windows':
return os.path.join(os.path.expanduser("~"), "Downloads")
elif system == 'Darwin':
return os.path.join(os.path.expanduser("~"), "Downloads")
elif system == 'Linux':
return os.path.join(os.path.expanduser("~"), "Downloads")
else:
return None
print("WELCOME TO PYTHON VIDEO DOWNLOADER")
print("AUTHOR JOHYNCHARLES")
URL=input("PLEASE ENTER THE URL OF THE VIDEO: \n")
os.system('cls')
yt=YouTube(URL)
print("...............PLEASE VERIFY THE DETAILS OF THE VIDEO YOU WANT TO DOWNLOAD....................")
print("TITLE:",yt.title)
print("PUBLISH DATE:",yt.publish_date)
print("AGE RESTRICTION:",yt.age_restricted)
print("VIEWS:",yt.views)
print("CHOOSE FROM ONE OF THE OPTION BELOW:")
print("1:DOWNLOAD MP3")
print("2:DOWNLOAD MP4")
choice=int(input())
os.system('cls')
if choice==1:
print(1)
if yt.age_restricted:
yt.bypass_age_gate()
print("DOWNLOADING AUDIO OF",yt.title)
yt.streams.get_audio_only().download(get_downloads_folder())
print("DOWNLOADED SUCCESSFULLY")
if choice==2:
print("CHOOSE")
print("1:LOW QUALITY")
print("2:HIGH QUALITY")
choice1=int(input())
if choice1==1:
if yt.age_restricted:
yt.bypass_age_gate()
print("DOWNLOADING LOW QUALITY VIDEO OF",yt.title)
yt.streams.get_lowest_resolution().download()
print("DOWNLOADED SUCCUESSFULLY")
if choice1==2:
if yt.age_restricted:
yt.bypass_age_gate()
print("DOWNLOADING HIGH QUALITY VIDEO OF",yt.title)
yt.streams.get_highest_resolution().download(get_downloads_folder())
print("DOWNLOADED SUCCESSFULLY")
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Tips
Recently searched:

Similar threads

Users who are viewing this thread

Top Bottom