Playlists

class Tribler.Core.Modules.restapi.channels.channels_playlists_endpoint.ChannelsModifyPlaylistTorrentsEndpoint(session, cid, playlist_id, infohash)[source]
render_DELETE(request)[source]
DELETE /channels/discovered/(string: channelid)/playlists/(int: playlistid)/(string: infohash)

Remove a torrent with a specified infohash from a specified playlist.

Example request:

curl -X DELETE http://localhost:8085/channels/discovered/abcd/playlists/3/abcdef

Example response:

{
    "removed": True
}
statuscode 404:if the specified channel/playlist/torrent does not exist.
render_PUT(request)[source]
PUT /channels/discovered/(string: channelid)/playlists/(int: playlistid)/(string: infohash)

Add a torrent with a specified infohash to a specified playlist. The torrent that is added to the playlist, should be present in the channel.

Example request:

curl -X PUT http://localhost:8085/channels/discovered/abcd/playlists/3/abcdef

Example response:

{
    "added": True
}
statuscode 404:if the specified channel/playlist/torrent does not exist.
statuscode 409:if the specified torrent is already in the specified playlist.
class Tribler.Core.Modules.restapi.channels.channels_playlists_endpoint.ChannelsModifyPlaylistsEndpoint(session, cid, playlist_id)[source]

This class is responsible for requests that are modifying a specific playlist in a channel.

render_DELETE(request)[source]
DELETE /channels/discovered/(string: channelid)/playlists/(int: playlistid)

Remove a playlist with a specified playlist id.

Example request:

curl -X DELETE http://localhost:8085/channels/discovered/abcd/playlists/3

Example response:

{
    "removed": True
}
statuscode 404:if the specified channel (community) or playlist does not exist
render_POST(request)[source]
POST /channels/discovered/(string: channelid)/playlists/(int: playlistid)

Edit a specific playlist. The new name and description should be passed as parameter.

Example request:

curl -X POST http://localhost:8085/channels/discovered/abcd/playlists/3
--data "name=test&description=my test description"

Example response:

{
    "modified": True
}
statuscode 404:if the specified channel (community) or playlist does not exist or if the

name and description parameters are missing.

class Tribler.Core.Modules.restapi.channels.channels_playlists_endpoint.ChannelsPlaylistsEndpoint(session, cid)[source]

This class is responsible for handling requests regarding playlists in a channel.

render_GET(request)[source]
GET /channels/discovered/(string: channelid)/playlists

Returns the playlists in your channel. Returns error 404 if you have not created a channel. - disable_filter: whether the family filter should be disabled for this request (1 = disabled)

Example request:

curl -X GET http://localhost:8085/channels/discovered/abcd/playlists

Example response:

{
    "playlists": [{
        "id": 1,
        "name": "My first playlist",
        "description": "Funny movies",
        "torrents": [{
            "id": 4,
            "infohash": "97d2d8f5d37e56cfaeaae151d55f05b077074779",
            "name": "Ubuntu-16.04-desktop-amd64",
            "size": 8592385,
            "category": "other",
            "num_seeders": 42,
            "num_leechers": 184,
            "last_tracker_check": 1463176959
        }, ... ]
    }, ...]
}
statuscode 404:if you have not created a channel.
render_PUT(request)[source]
PUT /channels/discovered/(string: channelid)/playlists

Create a new empty playlist with a given name and description. The name and description parameters are mandatory.

Example request:

curl -X PUT http://localhost:8085/channels/discovered/abcd/playlists
--data "name=My fancy playlist&description=This playlist contains some random movies"

Example response:

{
    "created": True
}
statuscode 400:if you are missing the name and/or description parameter
statuscode 404:if the specified channel does not exist