Peertube 1.3 implements a playlist system that is more "playlist" style than the channel already existing.
At first we used channel as playlist but now we have true playlist, we should use it :-)
For the moment there is no documentation, but I have done some test via browser console
```
## To create playlist
curl 'https://your.url/api/v1/video-playlists/' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3' --compressed -H 'Referer: https://your.url/my-account/video-playlists/create' -H 'Authorization: Bearer XXX' -H 'Content-Type: multipart/form-data; boundary=---------------------------503377908933939666729212442' -H 'Connection: keep-alive' --data ''
-----------------------------503377908933939666729212442
Content-Disposition: form-data; name="displayName"
testplaylist
-----------------------------503377908933939666729212442
Content-Disposition: form-data; name="privacy"
3 # 1 for public, 2 for unlisted, 3 for private
-----------------------------503377908933939666729212442
Content-Disposition: form-data; name="description"
null
-----------------------------503377908933939666729212442
Content-Disposition: form-data; name="videoChannelId"
2 # null to use default channel
-----------------------------503377908933939666729212442
Content-Disposition: form-data; name="thumbnailfile"
null
-----------------------------503377908933939666729212442--
```
I am not sure about where the "VideoID" came from, it's not the long videoid nor the playlistid.
Same for the video-playlists/3/videos , the 3 refers to the local id as answered when creating a playlist:
videoPlaylist {…}
id 4
uuid 6c74dcad-243e-484e-aad3-c1d2e7479e8e
Probably it's possible to find these id while searching for playlist/uploading the video
To add a video into a playlist:
```
curl 'https://your.url/api/v1/video-playlists/3/videos' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: https://your.url/videos/watch/VIDEOID' -H 'Authorization: Bearer XXX' -H 'Content-Type: application/json' -H 'Connection: keep-alive' --data '{"videoId":275}'
```
I am not sure about where the "VideoID" came from, it's not the long videoid nor the playlistid.
Same for the `video-playlists/3/videos` , the 3 refers to the local id as answered when creating a playlist:
```
videoPlaylist {…}
id 4
uuid 6c74dcad-243e-484e-aad3-c1d2e7479e8e
```
Probably it's possible to find these id while searching for playlist/uploading the video
Okay when uploading the video, we indeed get the id as an answer, in addition to the uuid we already used in prismedia (to construct the video url):
video {…}
id 277
uuid e3d3ce91-c671-4c63-a912-05630fe0406f
So we should be able to create playlist, get its id, upload video, get its id, then add the video to the playlist.
Last thing needed is the ability to search for playlist, in order to be sure if it already exists or not, and if exists, how to get its id?
Okay when uploading the video, we indeed get the id as an answer, in addition to the uuid we already used in prismedia (to construct the video url):
```
video {…}
id 277
uuid e3d3ce91-c671-4c63-a912-05630fe0406f
```
So we should be able to create playlist, get its id, upload video, get its id, then add the video to the playlist.
Last thing needed is the ability to search for playlist, in order to be sure if it already exists or not, and if exists, how to get its id?
Peertube 1.3 implements a playlist system that is more "playlist" style than the channel already existing.
At first we used channel as playlist but now we have true playlist, we should use it :-)
For the moment there is no documentation, but I have done some test via browser console
To add a video into a playlist:
I am not sure about where the "VideoID" came from, it's not the long videoid nor the playlistid.
Same for the
video-playlists/3/videos
, the 3 refers to the local id as answered when creating a playlist:Probably it's possible to find these id while searching for playlist/uploading the video
Okay when uploading the video, we indeed get the id as an answer, in addition to the uuid we already used in prismedia (to construct the video url):
So we should be able to create playlist, get its id, upload video, get its id, then add the video to the playlist.
Last thing needed is the ability to search for playlist, in order to be sure if it already exists or not, and if exists, how to get its id?
Beta tests on the branch feature/pt-playlist-1.3
Released with v0.6.2