
import yt_dlp as youtube_dl

def download_playlist(playlist_url,save_dir):
    ydl_opts = {
        'format': 'bestvideo+bestaudio/best',
        'outtmpl': f"{save_dir}"+'/%(title)s.%(ext)s',
        'ignoreerrors': True,
        'playliststart': 1,
        'playlistend': 40  # Change this value to download more or fewer videos from the playlist
    }

    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
        ydl.download([playlist_url])
 

# Example usage
# playlist_url = 'https://www.youtube.com/watch?v=-NQ8uQPYlwo&list=PLbU126RatCWTmY_7oVPIgdu-iLLaRaFpJ'
# download_playlist(playlist_url)

series = {
    "Kaina_Dorouf":"https://www.youtube.com/watch?v=pT5p8YKgDtM&list=PL7CGdjLyghWm1y3g1A-TOcHuVVKp90mWR"
}

for name,link in series.items():
    
    download_playlist(link,name)