I'm trying to download a banner for a series using the latest api and am not getting very far. I'm using CURL but the file I'm getting is actually a 404 html file with an image name.
This is the code I'm using, can anyone tell me the problem?
Code: Select all
$ch = curl_init('https://www.thetvdb.com/artwork/1313525');
$fp = fopen($seriesBanner, 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
$headers= array('Accept: image/jpeg','Content-Type: image/jpeg','Authorization: Bearer ' . $serverToken);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);