vkpymusic.models.playlist
This module contains the Playlist class.
Playlist
A class that represents a playlist.
Attributes:
Name | Type | Description |
---|---|---|
title |
str
|
The title of the playlist. |
description |
str
|
The description of the playlist. |
photo |
str
|
The URL of the playlist's photo. |
count |
int
|
The number of tracks in the playlist. |
owner_id |
int
|
The ID of the playlist's owner. |
playlist_id |
int
|
The ID of the playlist. |
access_key |
str
|
The access key of the playlist. |
__init__(title, description, photo, count, followers, owner_id, playlist_id, access_key)
Initializes a Playlist object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title
|
str
|
The title of the playlist. |
required |
description
|
str
|
The description of the playlist. |
required |
photo
|
str
|
The URL of the playlist's photo. |
required |
count
|
int
|
The number of tracks in the playlist. |
required |
owner_id
|
int
|
The ID of the playlist's owner. |
required |
playlist_id
|
int
|
The ID of the playlist. |
required |
access_key
|
str
|
The access key of the playlist. |
required |
to_dict()
Converts the playlist to a dictionary.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
The playlist as a dictionary. |
from_json(item)
classmethod
Converts a JSON object to a Playlist object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item
|
dict
|
A JSON object. |
required |
Returns:
Name | Type | Description |
---|---|---|
Playlist |
Playlist
|
The Playlist object. |