Just my two cents!
Had to change the function a bit, since I used a picture. This is what I included before my closing body tag.

(function() {
//populates url for lightbox
var scriptLightBox = document.getElementsByClassName("w-json");
var urlValue = document.querySelectorAll("img.lightbox_thumbnail_image");
for(j=0;j<urlValue.length;j++)
{
var jsonParse = JSON.parse(scriptLightBox[j].text);
var url = urlValue[j].src;
var obj=jsonParse.items[0];
obj.url= url;
scriptLightBox[j].text=JSON.stringify(jsonParse);
}
})();

Thank you for sharing!