from yt_dlapi import YTDLAPI
client = YTDLAPI()
# A single video, by video ID.
video = client.video.get("jNQXAC9IVRw")
# A channel, by handle/name or by channel ID.
channel = client.channel.get_by_name("jawed")
channel = client.channel.get_by_id("UC4QobU6STFB0P71PMvOGN5A")
# A playlist, by playlist ID.
playlist = client.playlist.get("PLuhl9TnQPDCnWIhy_KSbtFwXVQnNvgfSh")
# The videos in a playlist. Accepts a normal playlist ID (PL...) or a
# channel-derived uploads playlist ID (UU...).
videos = client.playlist_videos.get("UU4QobU6STFB0P71PMvOGN5A")
Overview
yt-dlapi is an unofficial YouTube API Python library built on top of yt-dlp. yt-dlapi was originally part of Stream Channeler, but was converted into a library to make it easier to use in other projects.