def _get_yt_playlist_videos(self, playlist_url: str):
        """Get the list of videos from a youtube playlist."""
        try:
            # Create the downloader object
            with yt_dlp.YoutubeDL({"extract_flat": True, "quiet": True}) as ydl:
                playlist_info = ydl.extract_info(playlist_url, download=False)
            if "entries" in playlist_info:
                video_list = []
                for video in playlist_info["entries"]:
                    video_list.append(
                        {
                            "title": video.get("title", "Unknown Title"),
                            "url": f"https://www.youtube.com/watch?v={video['id']}",
                        }
                    )
                return video_list
        except Exception as e:
            logger.exception(f"Error in getting playlist info: {e}")
            return None
Get the list of videos from a youtube playlist.
backend/director/agents/upload.py