N/A
(0)
Posts: 1
Earned: 0 XMR
Tipped: 0 XMR
For those who don't know invidious.io, it's a free, open-source, and privacy-focused front-end for YouTube.
Invidious allows users to access YouTube content without the need to interact with Google's servers directly, ad-free and allowing direct video downloads.
I'm used to download my YouTube content with yt-dlp or pytubefix and was wondering if it was possible to use Invidious urls directly. While Invidious allows direct downloads, yt-dlp and pytubefix offer more audio and video options. So, I tested both, and it works fine with pytubefix.
I share here a python script. You'll find more examples on the pytubefix GitHub.
from pytubefix import YouTube
url = input("YouTube url: ")
yt = YouTube(url)
print("Available itag values:")
print(yt.streams)
itag = input("Your itag choice : ")
stream = yt.streams.get_by_itag(itag)
print(f"Downloading: {yt.title}...")
stream.download()
print("Download completed!")