#37 Implement new Peertube playlist system instead of channel

Closed
opened 4 years ago by LecygneNoir · 4 comments
Owner

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--

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-- ```
LecygneNoir added the
enhancement
label 4 years ago
LecygneNoir added the
Work in Progress
label 4 years ago
Poster
Owner

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

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
Poster
Owner

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?
LecygneNoir self-assigned this 4 years ago
Poster
Owner

Beta tests on the branch feature/pt-playlist-1.3

Beta tests on the branch [feature/pt-playlist-1.3](https://git.lecygnenoir.info/LecygneNoir/prismedia/src/branch/feature/pt-playlist-1.3)
Poster
Owner

Released with v0.6.2

Released with v0.6.2
LecygneNoir closed this issue 4 years ago
LecygneNoir removed the
Work in Progress
label 4 years ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.