ytmusicapi/mixins/playlists.py
def create_playlist(self,
                        title: str,
                        description: str,
                        privacy_status: str = "PRIVATE",
                        video_ids: List = None,
                        source_playlist: str = None) -> Union[str, Dict]:
        """
        Creates a new empty playlist and returns its id.

        :param title: Playlist title
        :param description: Playlist description
        :param privacy_status: Playlists can be 'PUBLIC', 'PRIVATE', or 'UNLISTED'. Default: 'PRIVATE'
        :param video_ids: IDs of songs to create the playlist with
        :param source_playlist: Another playlist whose songs should be added to the new playlist
        :return: ID of the YouTube playlist or full response if there was an error
        """
        self._check_auth()
        body = {
            'title': title,
            'description': html_to_txt(description),  # YT does not allow HTML tags
            'privacyStatus': privacy_status
        }
        if video_ids is not None:
            body['videoIds'] = video_ids

        if source_playlist is not None:
            body['sourcePlaylistId'] = source_playlist

        endpoint = 'playlist/create'
        response = self._send_request(endpoint, body)
        return response['playlistId'] if 'playlistId' in response else response

        Creates a new empty playlist and returns its id.

        :param title: Playlist title
        :param description: Playlist description
        :param privacy_status: Playlists can be 'PUBLIC', 'PRIVATE', or 'UNLISTED'. Default: 'PRIVATE'
        :param video_ids: IDs of songs to create the playlist with
        :param source_playlist: Another playlist whose songs should be added to the new playlist
        :return: ID of the YouTube playlist or full response if there was an error
        
Creates a new empty playlist and returns its id.
Creates a new empty playlist and returns its id .
def create_playlist(self,
                        title: str,
                        description: str,
                        privacy_status: str = "PRIVATE",
                        video_ids: List = None,
                        source_playlist: str = None) -> Union[str, Dict]:
        self._check_auth()
        body = {
            'title': title,
            'description': html_to_txt(description),  
            'privacyStatus': privacy_status
        }
        if video_ids is not None:
            body['videoIds'] = video_ids
        if source_playlist is not None:
            body['sourcePlaylistId'] = source_playlist
        endpoint = 'playlist/create'
        response = self._send_request(endpoint, body)
        return response['playlistId'] if 'playlistId' in response else response
def create_playlist ( self , title : str , description : str , privacy_status : str = "PRIVATE" , video_ids : List = None , source_playlist : str = None ) -> Union [ str , Dict ] : self . _check_auth ( ) body = { 'title' : title , 'description' : html_to_txt ( description ) , 'privacyStatus' : privacy_status } if video_ids is not None : body [ 'videoIds' ] = video_ids if source_playlist is not None : body [ 'sourcePlaylistId' ] = source_playlist endpoint = 'playlist/create' response = self . _send_request ( endpoint , body ) return response [ 'playlistId' ] if 'playlistId' in response else response
Creates a new empty playlist and returns its id.
Creates a new empty playlist and returns its id .
"""
        Creates a new empty playlist and returns its id.

        :param title: Playlist title
        :param description: Playlist description
        :param privacy_status: Playlists can be 'PUBLIC', 'PRIVATE', or 'UNLISTED'. Default: 'PRIVATE'
        :param video_ids: IDs of songs to create the playlist with
        :param source_playlist: Another playlist whose songs should be added to the new playlist
        :return: ID of the YouTube playlist or full response if there was an error
        """ # YT does not allow HTML tags
ID of the YouTube playlist or full response if there was an error
ID of the YouTube playlist or full response if there was an error
self
title
str
None
description
str
None
privacy_status
str
Playlists can be 'PUBLIC', 'PRIVATE', or 'UNLISTED'. Default: 'PRIVATE'
Playlists can be ' PUBLIC ' ' PRIVATE ' or ' UNLISTED ' . Default : ' PRIVATE '
video_ids
List
IDs of songs to create the playlist with
IDs of songs to create the playlist with
source_playlist
str
Another playlist whose songs should be added to the new playlist
Another playlist whose songs should be added to the new playlist