31
loading...
This website collects cookies to deliver better user experience
pip install pytube
from pytube import YouTube
yt = YouTube("<Your youtube URL>")
mp4_files = yt.streams.filter(file_extension="mp4")
mp4_369p_files = mp4_files.get_by_resolution("360p")
mp4_369p_files.download("<Download folder path>")
from pytube import YouTube
def download_360p_mp4_videos(url: str, outpath: str = "./"):
yt = YouTube(url)
yt.streams.filter(file_extension="mp4").get_by_resolution("360p").download(outpath)
if __name__ == "__main__":
download_360p_mp4_videos(
"https://www.youtube.com/watch?v=JfVOs4VSpmA&t=4s&ab_channel=SonyPicturesEntertainment",
"./trailers",
)
from pytube import YouTube
from typer import Typer
app = Typer()
@app.command()
def download_360p_mp4_videos(url: str, outpath: str = "./"):
yt = YouTube(url)
yt.streams.filter(file_extension="mp4").get_by_resolution("360p").download(outpath)
if __name__ == "__main__":
app()
python get-yt.py "https://www.youtube.com/watch?v=JfVOs4VSpmA&t=4s&ab_channel=SonyPicturesEntertainment"