1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Bulk embed youtube videos

This commit is contained in:
daniel 2019-07-13 21:10:55 -03:00
parent 2f03468bfa
commit 0113773c12

View file

@ -153,15 +153,14 @@ $obj = YouPHPTubePlugin::getObjectData("BulkEmbed");
function saveIt(videoLink) { function saveIt(videoLink) {
modal.showPleaseWait(); modal.showPleaseWait();
setTimeout(function () {
var itemsToSave = []; var itemsToSave = [];
for (x in videoLink) { for (x in videoLink) {
if (typeof videoLink[x] == 'function') { if (typeof videoLink[x] === 'function') {
continue; continue;
} }
$.ajax({ $.ajax({
url: "https://www.googleapis.com/youtube/v3/videos?id="+videoLink[x]+"&part=id,snippet,contentDetails&key="+gapikey, url: "https://www.googleapis.com/youtube/v3/videos?id=" + videoLink[x] + "&part=id,snippet,contentDetails&key=" + gapikey,
async: false, async: false,
success: function (data) { success: function (data) {
var item = {}; var item = {};
@ -174,7 +173,6 @@ $obj = YouPHPTubePlugin::getObjectData("BulkEmbed");
} }
}); });
} }
console.log(itemsToSave);
$.ajax({ $.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/BulkEmbed/save.json.php', url: '<?php echo $global['webSiteRootURL']; ?>plugin/BulkEmbed/save.json.php',
data: {"itemsToSave": itemsToSave}, data: {"itemsToSave": itemsToSave},
@ -188,7 +186,7 @@ $obj = YouPHPTubePlugin::getObjectData("BulkEmbed");
modal.hidePleaseWait(); modal.hidePleaseWait();
} }
}); });
}, 500);
} }
function search() { function search() {