mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
Added gui for importing youtube playlists
This commit is contained in:
@@ -113,6 +113,25 @@ var Search = {
|
||||
$(".main").removeClass("clickthrough");
|
||||
},
|
||||
|
||||
importPlaylist: function(pId){
|
||||
playlist_url = "https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&maxResults=49&key="+api_key+"&playlistId="+pId;
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: playlist_url,
|
||||
dataType:"jsonp",
|
||||
success: function(response)
|
||||
{
|
||||
var ids="";
|
||||
$.each(response.items, function(i,data)
|
||||
{
|
||||
ids+=data.contentDetails.videoId+",";
|
||||
});
|
||||
Search.addVideos(ids);
|
||||
document.getElementById("import").value = "";
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
addVideos: function(ids){
|
||||
var request_url="https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key=***REMOVED***&id=";
|
||||
request_url += ids;
|
||||
|
||||
Reference in New Issue
Block a user