I am trying to copy images from Daft the property site. All legit I have an API key and all that. However the Daft API provides links to images like this -
https://media.daft.ie/eyJidWNrZXQiOiJtZWRpYW1hc3Rlci1zM2V1IiwiZWRpdHMiOnsicmVzaXplIjp7ImZpdCI6ImNvdmVyIiwid2lkdGgiOjE0NDAsImhlaWdodCI6OTYwfX0sIm91dHB1dEZvcm1hdCI6ImpwZWciLCJrZXkiOiI3L2YvN2Y2MTRjOGY1MWJlMTA2ZmY4MjAzOGY1ZmM2ZDFjODguanBnIn0=?signature=a4a022137faf3f2e1e4a999399f66e89778dae1aedbbce893ba7224bd134a976
No file extension, I presume they store the image in the database and this is a reference or something. A simple PHP script like below will pull down an image
$image_url = 'https://files.hoganstand.com/common/newgallery/59b8e5f9-c34c-4239-bc40-737a0d93b2ac.jpg';
$image = file_get_contents($image_url);
$file_name = basename(parse_url($image_url, PHP_URL_PATH));
file_put_contents($file_name, $image);
echo "Image saved as $file_name in your current directory.";
This code however balks at the daft image. Any thoughts on how I can get around this?
Thanks in advance,
Sean