def _upload_yt_playlist(self, playlist_info: dict, media_type):
        """Upload the videos in a youtube playlist."""
        for media in playlist_info:
            try:
                self.output_message.actions.append(
                    f"Uploading video: {media['title']} as {media_type}"
                )
                self._upload(media["url"], "url", media_type)
            except Exception as e:
                self.output_message.actions.append(
                    f"Upload failed for {media['title']}"
                )
                logger.exception(f"Error in uploading {media['title']}: {e}")
        return AgentResponse(
            status=AgentStatus.SUCCESS,
            message=f"All the videos in the playlist uploaded successfully as {media_type}",
        )
Upload the videos in a youtube playlist.
backend/director/agents/upload.py