pythondailymotion-api

How to reorder a playlist?


How can I reorder a playlist using the Dailymotion API (via Python)?

I've looked through the api and found no mention of a video's order within the playlist. My playlists were imported in reverse order and I'm trying to avoid having to reorder 150+ episodes x 100 playlists.

I have this working using the YouTube API already...

Thanks.


Solution

  • You can reorder your playlist by POSTing the new order of your video IDs with this endpoint: https://api.dailymotion.com/playlist/{PLAYLIST_ID}/videos?ids={VIDEO_ID},...,{VIDEO_ID}

    With our SDK python the method would be like this

    d.post('/playlist/{PLAYLIST_ID}/videos', {'ids' : '{VIDEO_ID},...,{VIDEO_ID}'})
    

    You can list your current playlist order with this endpoint: https://api.dailymotion.com/playlist/{playlist_id}/videos?fields=id