deezer playlist without user object for playlist collaborative - playlist

I want to create a jukebox collaborativewith the api deezer.
But for that's, i want to create a playlist who everyboy can add a music on this playlist.
Do you have idea ?
Thks

Your playlist will always be linked to a Deezer user, there's no way to do otherwise:
you create a collaborative playlist:
http://developers.deezer.com/api/user/playlists doing a POST request
to api.deezer.com/user/your_user_id/playlists
Change this playlist to be collaborative:
http://developers.deezer.com/api/playlist#actions doing a POST request to
api.deezer.com/playlist/your_playlist_id
Add tracks to the playlist
http://developers.deezer.com/api/playlist/tracks doing a POST
request on api.deezer.com/playlist/your_playlist_id/tracks

Related

YouTube Api v3: calculate youtube playlist length

How can i get a youtube playlist duration (the sum of all it's videos durations).
I used this endpoint to get the playlist videos :
https://youtube.googleapis.com/youtube/v3/videos?playlistId
and it's return the videos object with all videos ids, in this case i need to make an api call to get each video length with separate api call to :
https://youtube.googleapis.com/youtube/v3/videos
I searched for a solution for this and found that we can make a call to previous api with all ids each id with a query param ex. id=aaaaa&id=bbbbb, but i need to be the owner of these videos to make the request.
Is there any way to get all videos with one call and without being the owner of the videos ?

How can I query YouTube API to get videos from auto-generated 'Topic' channels?

How can I input search parameters using the YouTube API so that I only get video ID's from topic channels? For instance, if I go to youtube.com and manually search "Hello Adele - Topic" I correctly get the song, 'Hello' from the 'Adele - Topic' channel as my first search result, https://www.youtube.com/watch?v=_WS9w10ygpU.
However, if I perform the same query using the YouTube Data API, with the parameters:
part='snippet'
q='Hello Adele - Topic'
I won't get back the ID for the correct video. Is there any way to get this programmatically?
As stated in this thread, auto generated channels have no videos. They have only playlists with videos from other channels. So you have to look for playlists. You may check the sample request in this link.
Here's the URL sample of auto-generated Topic-based Id which grabs its playlist id:
GET https://www.googleapis.com/youtube/v3/playlists?part=snippet&channelId=HC9m3exs6zk1U&fields=items%2Fid&key={YOUR_API_KEY}
//Outputs sample playlist Id: LP9m3exs6zk1U
Now here's the URL sample using that playlist Id to get the videos from the auto-generated Topic-based channel Id:
GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=5&playlistId=LP9m3exs6zk1U&key={YOUR_API_KEY}
//Outputs video data you want.
Hope this helps.

Get all videos for a given user

I'm trying to find a way to retrieve all videos posted by a given user (eg: https://www.youtube.com/user/laliga/videos).
All the examples I've found online or the doc (https://developers.google.com/youtube/v3/docs/) seems to require either a playlist ID, channel ID or video ID.
Is there any way I can directly query the author's videos or am I forced to retrieve all playlists and then iterate over?
Thanks
You just need to map the user name to its channelID first via the YouTube API like so:
https://www.googleapis.com/youtube/v3/channels?forUsername=USER_NAME&part=id&key=API_KEY
Full docs: https://developers.google.com/youtube/v3/docs/channels/list
Then you can make a Videos:List call with that channelID to get the videos.
1)take your google key id and channel id and put inside below url
https://www.googleapis.com/youtube/v3/search?key=APIKEY&channelId=CHANNELID&part=snippet,id&order=date&maxResults=20
ex
https://www.googleapis.com/youtube/v3/search?key=adsjsdakhkjshd&channelId=sdahghsadhgj&part=snippet,id&order=date&maxResults=20

Can't get endAt on videos when calling

I'm using GET https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails%2Csnippet&maxResults=50&playlistId=PLFs4vir_WsTwwb2zqmtE2WTEFdc7AQHnc&key={YOUR_API_KEY}
This returns all data, but only videoId in each video contentDetails. Maybe I'm missing something here?
YouTube has removed the features that set start and end times to playlist items: here's a product forum post that details this (and indicates an official response from Google account reps):
https://productforums.google.com/forum/#!topic/youtube/Gipu_cCDScI
Since playlists can no longer set start/end times on its items, the API no longer delivers them.
Not an answer, but a workaround. You can retrieve a playlist and use videos list with up to 50 videoIds in the URL to retrieve each video duration.

How do I get a list of uploaded videos for a certain channel with the new YouTube Data API (V3)?

I am trying to get a list of video ids for all uploaded videos to a channel. I would also like to use the new version of the YouTube Data API (V3). How do I do this?
You have to get the upload playlist id to get each videos uploaded. To get that, you need to get the channel id. After you have the playlist id from the channel id, it is pretty simple. I have written out the steps for all three below.
Also, we offer PubSubHubBub which allows you to be alerted every time a new video is added to a channel, or you could use SUP (V2) to see which resources have changed before making the calls.
Instructions to get video ids for all uploaded videos for a channel in V3
Get the channel id for the channel you want (you probably only need to do this once, then you can save it)
Use search.list
Set type to channel
Set q to the name of the channel you want
Grab the channel id (something like this: "channelId": "UC0X2VuXXXXXXXXXXXXXXXX")
Get the playlist id for the channel uploads using the channel id from step 1 (you probably only need to do this once, then you can save it)
Use channels.list
Set id to UC0X2VuXXXXXXXXXXXXXXXX from step 1
Grab the uploads key from contentDetails (something like this: "uploads": "UU0XXXXXXXXXXXXXXXXXXXX")
Get the videos via the playlistitems in the playlist using the playlist id from step 2
Use playlistItems.list
Set playlistId to UU0XXXXXXXXXXXXXXXXXXXX from step 2
Go through each PlaylistItem and pull out the video id
In the meantime, there is a much easier way:
Use the channels.list
set forUsername = [CHANNELNAME]
set part = contentDetails
grab $data->items[0]->contentDetails->relatedPlaylists->uploads --> [PLAYLISTID]
Use playlistItems.list
Set playlistId = [PLAYLISTID] from step 1
Go through each PlaylistItem and pull out the video ids

Resources