ytmusicapi/mixins/playlists.py
def edit_playlist(self,
                      playlistId: str,
                      title: str = None,
                      description: str = None,
                      privacyStatus: str = None,
                      moveItem: Tuple[str, str] = None,
                      addPlaylistId: str = None) -> Union[str, Dict]:
        """
        Edit title, description or privacyStatus of a playlist.
        You may also move an item within a playlist or append another playlist to this playlist.

        :param playlistId: Playlist id
        :param title: Optional. New title for the playlist
        :param description: Optional. New description for the playlist
        :param privacyStatus: Optional. New privacy status for the playlist
        :param moveItem: Optional. Move one item before another. Items are specified by setVideoId, see :py:func:`get_playlist`
        :param addPlaylistId: Optional. Id of another playlist to add to this playlist
        :return: Status String or full response
        """
        self._check_auth()
        body = {'playlistId': playlistId}
        actions = []
        if title:
            actions.append({'action': 'ACTION_SET_PLAYLIST_NAME', 'playlistName': title})

        if description:
            actions.append({
                'action': 'ACTION_SET_PLAYLIST_DESCRIPTION',
                'playlistDescription': description
            })

        if privacyStatus:
            actions.append({
                'action': 'ACTION_SET_PLAYLIST_PRIVACY',
                'playlistPrivacy': privacyStatus
            })

        if moveItem:
            actions.append({
                'action': 'ACTION_MOVE_VIDEO_BEFORE',
                'setVideoId': moveItem[0],
                'movedSetVideoIdSuccessor': moveItem[1]
            })

        if addPlaylistId:
            actions.append({'action': 'ACTION_ADD_PLAYLIST', 'addedFullListId': addPlaylistId})

        body['actions'] = actions
        endpoint = 'browse/edit_playlist'
        response = self._send_request(endpoint, body)
        return response['status'] if 'status' in response else response

        Edit title, description or privacyStatus of a playlist.
        You may also move an item within a playlist or append another playlist to this playlist.

        :param playlistId: Playlist id
        :param title: Optional. New title for the playlist
        :param description: Optional. New description for the playlist
        :param privacyStatus: Optional. New privacy status for the playlist
        :param moveItem: Optional. Move one item before another. Items are specified by setVideoId, see :py:func:`get_playlist`
        :param addPlaylistId: Optional. Id of another playlist to add to this playlist
        :return: Status String or full response
        
Edit title, description or privacyStatus of a playlist.
You may also move an item within a playlist or append another playlist to this playlist.
Edit title description or privacyStatus of a playlist . You may also move an item within a playlist or append another playlist to this playlist .
def edit_playlist(self,
                      playlistId: str,
                      title: str = None,
                      description: str = None,
                      privacyStatus: str = None,
                      moveItem: Tuple[str, str] = None,
                      addPlaylistId: str = None) -> Union[str, Dict]:
        self._check_auth()
        body = {'playlistId': playlistId}
        actions = []
        if title:
            actions.append({'action': 'ACTION_SET_PLAYLIST_NAME', 'playlistName': title})
        if description:
            actions.append({
                'action': 'ACTION_SET_PLAYLIST_DESCRIPTION',
                'playlistDescription': description
            })
        if privacyStatus:
            actions.append({
                'action': 'ACTION_SET_PLAYLIST_PRIVACY',
                'playlistPrivacy': privacyStatus
            })
        if moveItem:
            actions.append({
                'action': 'ACTION_MOVE_VIDEO_BEFORE',
                'setVideoId': moveItem[0],
                'movedSetVideoIdSuccessor': moveItem[1]
            })
        if addPlaylistId:
            actions.append({'action': 'ACTION_ADD_PLAYLIST', 'addedFullListId': addPlaylistId})
        body['actions'] = actions
        endpoint = 'browse/edit_playlist'
        response = self._send_request(endpoint, body)
        return response['status'] if 'status' in response else response
def edit_playlist ( self , playlistId : str , title : str = None , description : str = None , privacyStatus : str = None , moveItem : Tuple [ str , str ] = None , addPlaylistId : str = None ) -> Union [ str , Dict ] : self . _check_auth ( ) body = { 'playlistId' : playlistId } actions = [ ] if title : actions . append ( { 'action' : 'ACTION_SET_PLAYLIST_NAME' , 'playlistName' : title } ) if description : actions . append ( { 'action' : 'ACTION_SET_PLAYLIST_DESCRIPTION' , 'playlistDescription' : description } ) if privacyStatus : actions . append ( { 'action' : 'ACTION_SET_PLAYLIST_PRIVACY' , 'playlistPrivacy' : privacyStatus } ) if moveItem : actions . append ( { 'action' : 'ACTION_MOVE_VIDEO_BEFORE' , 'setVideoId' : moveItem [ 0 ] , 'movedSetVideoIdSuccessor' : moveItem [ 1 ] } ) if addPlaylistId : actions . append ( { 'action' : 'ACTION_ADD_PLAYLIST' , 'addedFullListId' : addPlaylistId } ) body [ 'actions' ] = actions endpoint = 'browse/edit_playlist' response = self . _send_request ( endpoint , body ) return response [ 'status' ] if 'status' in response else response
Edit title, description or privacyStatus of a playlist.
Edit title description or privacyStatus of a playlist .
"""
        Edit title, description or privacyStatus of a playlist.
        You may also move an item within a playlist or append another playlist to this playlist.

        :param playlistId: Playlist id
        :param title: Optional. New title for the playlist
        :param description: Optional. New description for the playlist
        :param privacyStatus: Optional. New privacy status for the playlist
        :param moveItem: Optional. Move one item before another. Items are specified by setVideoId, see :py:func:`get_playlist`
        :param addPlaylistId: Optional. Id of another playlist to add to this playlist
        :return: Status String or full response
        """
Status String or full response
Status String or full response
self
playlistId
str
None
title
str
Optional. New title for the playlist
Optional . New title for the playlist
description
str
Optional. New description for the playlist
Optional . New description for the playlist
privacyStatus
str
Optional. New privacy status for the playlist
Optional . New privacy status for the playlist
moveItem
Tuple[str, str]
Optional. Move one item before another. Items are specified by setVideoId, see :py:func:`get_playlist`
Optional . Move one item before another . Items are specified by setVideoId see : py : func : ` get_playlist `
addPlaylistId
str
Optional. Id of another playlist to add to this playlist
Optional . Id of another playlist to add to this playlist